This program and the accompanying materials are made available under the
terms of the Eclipse Public License v1.0 which accompanies this distribution,
and is available at http://www.eclipse.org/legal/epl-v10.html
+
+ NOTE: This file is deprecated as wiring is now done via blueprint. This file is kept for
+ backwards compatibility. Runtime modifications are not honored.
-->
<snapshot>
<configuration>
<groupId>org.opendaylight.controller</groupId>
<artifactId>config-api</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>sal-common-util</artifactId>
+ </dependency>
<dependency>
<groupId>org.opendaylight.controller</groupId>
package org.opendaylight.openflowplugin.applications.config.yang.forwardingrules_manager;
-import org.opendaylight.openflowplugin.applications.frm.impl.ForwardingRulesManagerConfig;
-import org.opendaylight.openflowplugin.applications.frm.impl.ForwardingRulesManagerImpl;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.opendaylight.controller.sal.common.util.NoopAutoCloseable;
-public class ForwardingRulesManagerModule extends org.opendaylight.openflowplugin.applications.config.yang.forwardingrules_manager.AbstractForwardingRulesManagerModule {
-
- private static final Logger LOG = LoggerFactory.getLogger(ForwardingRulesManagerModule.class);
- private static final boolean ENABLE_FGM_STALE_MARKING = false;
- private static final int RECONCILIATION_RETRY_COUNT = 5;
+/**
+ * @deprecated Replaced by blueprint wiring
+ */
+@Deprecated
+public class ForwardingRulesManagerModule extends AbstractForwardingRulesManagerModule {
public ForwardingRulesManagerModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
super(identifier, dependencyResolver);
}
@Override
- public void customValidation() {
- // add custom validation form module attributes here.
- }
-
- @Override
- public java.lang.AutoCloseable createInstance() {
- LOG.info("FRM module initialization.");
- final ForwardingRulesManagerConfig config = readConfig();
- final ForwardingRulesManagerImpl forwardingrulessManagerProvider =
- new ForwardingRulesManagerImpl(getDataBrokerDependency(), getRpcRegistryDependency(), config, getEntityOwnershipServiceDependency());
- forwardingrulessManagerProvider.start();
- LOG.info("FRM module started successfully.");
- return new AutoCloseable() {
- @Override
- public void close() throws Exception {
- try {
- forwardingrulessManagerProvider.close();
- } catch (final Exception e) {
- LOG.warn("Unexpected error by stopping FRM", e);
- }
- LOG.info("FRM module stopped.");
- }
- };
- }
-
- private ForwardingRulesManagerConfig readConfig(){
-
- final ForwardingRulesManagerConfig.ForwardingRulesManagerConfigBuilder fwdRulesMgrCfgBuilder = ForwardingRulesManagerConfig.builder();
-
- if (getForwardingManagerSettings() != null && getForwardingManagerSettings().getStaleMarkingEnabled() != null){
- fwdRulesMgrCfgBuilder.setStaleMarkingEnabled(getForwardingManagerSettings().getStaleMarkingEnabled());
- }
- else{
- LOG.warn("Could not load XML configuration file via ConfigSubsystem! Fallback to default config value(s)");
- fwdRulesMgrCfgBuilder.setStaleMarkingEnabled(ENABLE_FGM_STALE_MARKING);
- }
-
- if(getForwardingManagerSettings() != null && getForwardingManagerSettings().getReconciliationRetryCount()>0){
- fwdRulesMgrCfgBuilder.setReconciliationRetryCount(getForwardingManagerSettings().getReconciliationRetryCount());
- }
- else{
- LOG.warn("Could not load XML configuration file via ConfigSubsystem for reconciliation retry! " +
- "Fallback to default config value(s)");
- fwdRulesMgrCfgBuilder.setReconciliationRetryCount(RECONCILIATION_RETRY_COUNT);
- }
-
-
-
- return fwdRulesMgrCfgBuilder.build();
-
+ public AutoCloseable createInstance() {
+ // FRM instance is created via blueprint so this in a no-op.
+ return NoopAutoCloseable.INSTANCE;
}
-
}
* Do not modify this file unless it is present under src/main directory
*/
package org.opendaylight.openflowplugin.applications.config.yang.forwardingrules_manager;
-public class ForwardingRulesManagerModuleFactory extends org.opendaylight.openflowplugin.applications.config.yang.forwardingrules_manager.AbstractForwardingRulesManagerModuleFactory {
+
+/**
+ * @deprecated Replaced by blueprint wiring
+ */
+@Deprecated
+public class ForwardingRulesManagerModuleFactory extends AbstractForwardingRulesManagerModuleFactory {
}
package org.opendaylight.openflowplugin.applications.frm;
-import org.opendaylight.openflowplugin.applications.frm.impl.ForwardingRulesManagerConfig;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.TableFeatures;
-
-import org.opendaylight.openflowplugin.applications.frm.impl.FlowNodeConnectorInventoryTranslatorImpl;
import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
+import org.opendaylight.openflowplugin.applications.frm.impl.FlowNodeConnectorInventoryTranslatorImpl;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.meters.Meter;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.SalGroupService;
import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group;
import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.SalMeterService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflowplugin.app.forwardingrules.manager.config.rev160511.ForwardingRulesManagerConfig;
import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.SalTableService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.TableFeatures;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
/**
* @return True if owner, else false
*/
public boolean isNodeOwner(InstanceIdentifier<FlowCapableNode> ident);
-
+
/**
* Content definition method and prevent code duplicity
* @return FlowNodeConnectorInventoryTranslatorImpl
+++ /dev/null
-/**
- * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.openflowplugin.applications.frm.impl;
-
-/**
- * Created by efiijjp on 10/14/2015.
- */
-public class ForwardingRulesManagerConfig {
-
- private final boolean m_staleMarkingEnabled;
- private final int m_reconciliationRetryCount;
-
- private ForwardingRulesManagerConfig(ForwardingRulesManagerConfigBuilder builder){
- m_staleMarkingEnabled = builder.isStaleMarkingEnabled();
- m_reconciliationRetryCount = builder.getReconciliationRetryCount();
- }
-
- public boolean isStaleMarkingEnabled(){
- return m_staleMarkingEnabled;
- }
-
- public int getReconciliationRetryCount() {
- return m_reconciliationRetryCount;
- }
-
-
- public static ForwardingRulesManagerConfigBuilder builder(){
- return new ForwardingRulesManagerConfigBuilder();
- }
-
-
-
- public static class ForwardingRulesManagerConfigBuilder {
- private boolean staleMarkingEnabled ;
- private int reconciliationRetryCount ;
-
- public boolean isStaleMarkingEnabled(){
- return staleMarkingEnabled;
- }
- public int getReconciliationRetryCount() {return reconciliationRetryCount;}
-
- public void setStaleMarkingEnabled(boolean staleMarkingEnabledFlag){
- staleMarkingEnabled = staleMarkingEnabledFlag;
- }
-
- public void setReconciliationRetryCount(int retryCount ){
- reconciliationRetryCount = retryCount;
- }
-
- public ForwardingRulesManagerConfig build(){
- return new ForwardingRulesManagerConfig(this);
- }
- }
-
-}
import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
import com.google.common.collect.Sets;
+import com.google.common.util.concurrent.CheckedFuture;
import java.util.Collections;
import java.util.Set;
import java.util.concurrent.atomic.AtomicLong;
-
-import com.google.common.util.concurrent.CheckedFuture;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
import org.opendaylight.controller.md.sal.common.api.clustering.Entity;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.SalMeterService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.TableFeatures;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflowplugin.app.forwardingrules.manager.config.rev160511.ForwardingRulesManagerConfig;
import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.SalTableService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.TableFeatures;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
this.tableListener = new TableForwarder(this, dataService);
this.nodeListener = new FlowNodeReconciliationImpl(this, dataService);
- flowNodeConnectorInventoryTranslatorImpl =
+ flowNodeConnectorInventoryTranslatorImpl =
new FlowNodeConnectorInventoryTranslatorImpl(this,dataService);
LOG.info("ForwardingRulesManager has started successfully.");
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0"
+ odl:use-default-for-reference-types="true">
+
+ <reference id="dataBroker" interface="org.opendaylight.controller.md.sal.binding.api.DataBroker"/>
+ <reference id="rpcRegistry" interface="org.opendaylight.controller.sal.binding.api.RpcProviderRegistry"/>
+ <reference id="entityOwnershipService" interface="org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipService"/>
+
+ <odl:clustered-app-config id="frmConfig"
+ binding-class="org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflowplugin.app.forwardingrules.manager.config.rev160511.ForwardingRulesManagerConfig"/>
+
+ <bean id="frmManager" class="org.opendaylight.openflowplugin.applications.frm.impl.ForwardingRulesManagerImpl"
+ init-method="start" destroy-method="close">
+ <argument ref="dataBroker"/>
+ <argument ref="rpcRegistry"/>
+ <argument ref="frmConfig"/>
+ <argument ref="entityOwnershipService"/>
+ </bean>
+</blueprint>
\ No newline at end of file
identity forwardingrules-manager {
base config:module-type;
config:java-name-prefix ForwardingRulesManager;
+ status deprecated;
}
augment "/config:modules/config:module/config:configuration" {
--- /dev/null
+module forwarding-rules-manager-config {
+ yang-version 1;
+ namespace "urn:opendaylight:params:xml:ns:yang:openflowplugin:app:forwardingrules-manager:config";
+ prefix "frm";
+
+ description
+ "Configuration for Forwarding Rules Manager application..";
+
+ revision "2016-05-11" {
+ description
+ "Initial revision.";
+ }
+
+ container forwarding-rules-manager-config {
+ leaf stale-marking-enabled {
+ type boolean;
+ default false;
+ }
+
+ leaf reconciliation-retry-count {
+ type uint16;
+ default 5;
+ }
+ }
+}
\ No newline at end of file
*/
package test.mock;
+import static org.junit.Assert.assertEquals;
+import java.util.Collections;
+import java.util.List;
import org.junit.Test;
import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipService;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
-import org.opendaylight.openflowplugin.applications.frm.impl.ForwardingRulesManagerConfig;
import org.opendaylight.openflowplugin.applications.frm.impl.ForwardingRulesManagerImpl;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Dscp;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.TableBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.TableKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.*;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.StaleFlow;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.StaleFlowBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.StaleFlowKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.UpdateFlowInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.IpMatch;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.IpMatchBuilder;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-
import test.mock.util.EntityOwnershipServiceMock;
import test.mock.util.FRMTest;
import test.mock.util.RpcProviderRegistryMock;
import test.mock.util.SalFlowServiceMock;
-import java.util.Collections;
-import java.util.List;
-
-import static org.junit.Assert.assertEquals;
-
public class FlowListenerTest extends FRMTest {
RpcProviderRegistry rpcProviderRegistryMock = new RpcProviderRegistryMock();
EntityOwnershipService eos = new EntityOwnershipServiceMock();
package test.mock.util;
-import org.opendaylight.openflowplugin.applications.frm.impl.ForwardingRulesManagerConfig;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.TableKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.TableBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
import java.util.Collections;
import java.util.concurrent.ExecutionException;
import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.TableBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.TableKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodesBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflowplugin.app.forwardingrules.manager.config.rev160511.ForwardingRulesManagerConfig;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflowplugin.app.forwardingrules.manager.config.rev160511.ForwardingRulesManagerConfigBuilder;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
public abstract class FRMTest extends AbstractDataBrokerTest {
}
public ForwardingRulesManagerConfig getConfig(){
- ForwardingRulesManagerConfig.ForwardingRulesManagerConfigBuilder cfgBuilder =
- new ForwardingRulesManagerConfig.ForwardingRulesManagerConfigBuilder();
+ ForwardingRulesManagerConfigBuilder cfgBuilder = new ForwardingRulesManagerConfigBuilder();
cfgBuilder.setStaleMarkingEnabled(false);
+ cfgBuilder.setReconciliationRetryCount(0);
return cfgBuilder.build();
}