Search in sources :

Example 1 with FlowCapableNodeSnapshotDao

use of org.opendaylight.openflowplugin.applications.frsync.dao.FlowCapableNodeSnapshotDao in project openflowplugin by opendaylight.

the class SimplifiedOperationalListenerTest method setUp.

@Before
public void setUp() throws Exception {
    final DataBroker db = Mockito.mock(DataBroker.class);
    final FlowCapableNodeSnapshotDao configSnapshot = new FlowCapableNodeSnapshotDao();
    final FlowCapableNodeSnapshotDao operationalSnapshot = new FlowCapableNodeSnapshotDao();
    final FlowCapableNodeDao configDao = new FlowCapableNodeCachedDao(configSnapshot, new FlowCapableNodeOdlDao(db, LogicalDatastoreType.CONFIGURATION));
    nodeListenerOperational = new SimplifiedOperationalListener(reactor, operationalSnapshot, configDao, reconciliationRegistry, deviceMastershipManager);
    InstanceIdentifier<Node> nodePath = InstanceIdentifier.create(Nodes.class).child(Node.class, new NodeKey(NODE_ID));
    fcNodePath = nodePath.augmentation(FlowCapableNode.class);
    final DataTreeIdentifier<Node> dataTreeIdentifier = new DataTreeIdentifier<>(LogicalDatastoreType.OPERATIONAL, nodePath);
    Mockito.when(db.newReadOnlyTransaction()).thenReturn(roTx);
    Mockito.when(operationalNode.getId()).thenReturn(NODE_ID);
    Mockito.when(dataTreeModification.getRootPath()).thenReturn(dataTreeIdentifier);
    Mockito.when(dataTreeModification.getRootNode()).thenReturn(operationalModification);
    Mockito.when(operationalNode.getAugmentation(FlowCapableNode.class)).thenReturn(fcOperationalNode);
}
Also used : FlowCapableNodeSnapshotDao(org.opendaylight.openflowplugin.applications.frsync.dao.FlowCapableNodeSnapshotDao) FlowCapableNodeOdlDao(org.opendaylight.openflowplugin.applications.frsync.dao.FlowCapableNodeOdlDao) FlowCapableNode(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode) Node(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node) FlowCapableNode(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode) DataBroker(org.opendaylight.controller.md.sal.binding.api.DataBroker) Nodes(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes) DataTreeIdentifier(org.opendaylight.controller.md.sal.binding.api.DataTreeIdentifier) FlowCapableNodeDao(org.opendaylight.openflowplugin.applications.frsync.dao.FlowCapableNodeDao) NodeKey(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey) FlowCapableNodeCachedDao(org.opendaylight.openflowplugin.applications.frsync.dao.FlowCapableNodeCachedDao) Before(org.junit.Before)

Example 2 with FlowCapableNodeSnapshotDao

use of org.opendaylight.openflowplugin.applications.frsync.dao.FlowCapableNodeSnapshotDao in project openflowplugin by opendaylight.

the class ForwardingRulesSyncProvider method onSessionInitiated.

@Override
public void onSessionInitiated(final ProviderContext providerContext) {
    final TableForwarder tableForwarder = new TableForwarder(salTableService);
    final SyncPlanPushStrategy syncPlanPushStrategy = new SyncPlanPushStrategyFlatBatchImpl().setFlatBatchService(flatBatchService).setTableForwarder(tableForwarder);
    final ReconciliationRegistry reconciliationRegistry = new ReconciliationRegistry();
    final DeviceMastershipManager deviceMastershipManager = new DeviceMastershipManager(clusterSingletonService, reconciliationRegistry);
    final SyncReactor syncReactorImpl = new SyncReactorImpl(syncPlanPushStrategy);
    final SyncReactor syncReactorRetry = new SyncReactorRetryDecorator(syncReactorImpl, reconciliationRegistry);
    final SyncReactor syncReactorGuard = new SyncReactorGuardDecorator(syncReactorRetry);
    final SyncReactor syncReactorFutureZip = new SyncReactorFutureZipDecorator(syncReactorGuard, syncThreadPool);
    final SyncReactor reactor = new SyncReactorClusterDecorator(syncReactorFutureZip, deviceMastershipManager);
    final FlowCapableNodeSnapshotDao configSnapshot = new FlowCapableNodeSnapshotDao();
    final FlowCapableNodeSnapshotDao operationalSnapshot = new FlowCapableNodeSnapshotDao();
    final FlowCapableNodeDao configDao = new FlowCapableNodeCachedDao(configSnapshot, new FlowCapableNodeOdlDao(dataService, LogicalDatastoreType.CONFIGURATION));
    final FlowCapableNodeDao operationalDao = new FlowCapableNodeCachedDao(operationalSnapshot, new FlowCapableNodeOdlDao(dataService, LogicalDatastoreType.OPERATIONAL));
    final NodeListener<FlowCapableNode> nodeListenerConfig = new SimplifiedConfigListener(reactor, configSnapshot, operationalDao);
    final NodeListener<Node> nodeListenerOperational = new SimplifiedOperationalListener(reactor, operationalSnapshot, configDao, reconciliationRegistry, deviceMastershipManager);
    dataTreeConfigChangeListener = dataService.registerDataTreeChangeListener(nodeConfigDataTreePath, nodeListenerConfig);
    dataTreeOperationalChangeListener = dataService.registerDataTreeChangeListener(nodeOperationalDataTreePath, nodeListenerOperational);
    LOG.info("ForwardingRulesSync has started.");
}
Also used : FlowCapableNodeSnapshotDao(org.opendaylight.openflowplugin.applications.frsync.dao.FlowCapableNodeSnapshotDao) FlowCapableNodeOdlDao(org.opendaylight.openflowplugin.applications.frsync.dao.FlowCapableNodeOdlDao) SyncPlanPushStrategyFlatBatchImpl(org.opendaylight.openflowplugin.applications.frsync.impl.strategy.SyncPlanPushStrategyFlatBatchImpl) FlowCapableNode(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode) FlowCapableNode(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode) Node(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node) ReconciliationRegistry(org.opendaylight.openflowplugin.applications.frsync.util.ReconciliationRegistry) SyncPlanPushStrategy(org.opendaylight.openflowplugin.applications.frsync.SyncPlanPushStrategy) SyncReactor(org.opendaylight.openflowplugin.applications.frsync.SyncReactor) TableForwarder(org.opendaylight.openflowplugin.applications.frsync.impl.strategy.TableForwarder) FlowCapableNodeDao(org.opendaylight.openflowplugin.applications.frsync.dao.FlowCapableNodeDao) FlowCapableNodeCachedDao(org.opendaylight.openflowplugin.applications.frsync.dao.FlowCapableNodeCachedDao) DeviceMastershipManager(org.opendaylight.openflowplugin.applications.frsync.impl.clustering.DeviceMastershipManager)

Example 3 with FlowCapableNodeSnapshotDao

use of org.opendaylight.openflowplugin.applications.frsync.dao.FlowCapableNodeSnapshotDao in project openflowplugin by opendaylight.

the class SimplifiedConfigListenerTest method setUp.

@Before
public void setUp() throws Exception {
    final DataBroker db = Mockito.mock(DataBroker.class);
    final FlowCapableNodeSnapshotDao configSnapshot = new FlowCapableNodeSnapshotDao();
    final FlowCapableNodeSnapshotDao operationalSnapshot = new FlowCapableNodeSnapshotDao();
    final FlowCapableNodeDao operationalDao = new FlowCapableNodeCachedDao(operationalSnapshot, new FlowCapableNodeOdlDao(db, LogicalDatastoreType.OPERATIONAL));
    nodeListenerConfig = new SimplifiedConfigListener(reactor, configSnapshot, operationalDao);
    fcNodePath = InstanceIdentifier.create(Nodes.class).child(Node.class, new NodeKey(NODE_ID)).augmentation(FlowCapableNode.class);
    final DataTreeIdentifier<FlowCapableNode> dataTreeIdentifier = new DataTreeIdentifier<>(LogicalDatastoreType.CONFIGURATION, fcNodePath);
    Mockito.when(db.newReadOnlyTransaction()).thenReturn(roTx);
    Mockito.when(dataTreeModification.getRootPath()).thenReturn(dataTreeIdentifier);
    Mockito.when(dataTreeModification.getRootNode()).thenReturn(configModification);
}
Also used : FlowCapableNodeSnapshotDao(org.opendaylight.openflowplugin.applications.frsync.dao.FlowCapableNodeSnapshotDao) FlowCapableNodeOdlDao(org.opendaylight.openflowplugin.applications.frsync.dao.FlowCapableNodeOdlDao) DataTreeIdentifier(org.opendaylight.controller.md.sal.binding.api.DataTreeIdentifier) FlowCapableNode(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode) DataBroker(org.opendaylight.controller.md.sal.binding.api.DataBroker) FlowCapableNodeDao(org.opendaylight.openflowplugin.applications.frsync.dao.FlowCapableNodeDao) NodeKey(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey) FlowCapableNodeCachedDao(org.opendaylight.openflowplugin.applications.frsync.dao.FlowCapableNodeCachedDao) Nodes(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes) Before(org.junit.Before)

Aggregations

FlowCapableNodeCachedDao (org.opendaylight.openflowplugin.applications.frsync.dao.FlowCapableNodeCachedDao)3 FlowCapableNodeDao (org.opendaylight.openflowplugin.applications.frsync.dao.FlowCapableNodeDao)3 FlowCapableNodeOdlDao (org.opendaylight.openflowplugin.applications.frsync.dao.FlowCapableNodeOdlDao)3 FlowCapableNodeSnapshotDao (org.opendaylight.openflowplugin.applications.frsync.dao.FlowCapableNodeSnapshotDao)3 FlowCapableNode (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode)3 Before (org.junit.Before)2 DataBroker (org.opendaylight.controller.md.sal.binding.api.DataBroker)2 DataTreeIdentifier (org.opendaylight.controller.md.sal.binding.api.DataTreeIdentifier)2 Nodes (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes)2 Node (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node)2 NodeKey (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey)2 SyncPlanPushStrategy (org.opendaylight.openflowplugin.applications.frsync.SyncPlanPushStrategy)1 SyncReactor (org.opendaylight.openflowplugin.applications.frsync.SyncReactor)1 DeviceMastershipManager (org.opendaylight.openflowplugin.applications.frsync.impl.clustering.DeviceMastershipManager)1 SyncPlanPushStrategyFlatBatchImpl (org.opendaylight.openflowplugin.applications.frsync.impl.strategy.SyncPlanPushStrategyFlatBatchImpl)1 TableForwarder (org.opendaylight.openflowplugin.applications.frsync.impl.strategy.TableForwarder)1 ReconciliationRegistry (org.opendaylight.openflowplugin.applications.frsync.util.ReconciliationRegistry)1