use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey in project openflowplugin by opendaylight.
the class FlowCapableTopologyExporterTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
doReturn(mockTxChain).when(mockDataBroker).createTransactionChain(any(TransactionChainListener.class));
processor = new OperationProcessor(mockDataBroker);
topologyIID = InstanceIdentifier.create(NetworkTopology.class).child(Topology.class, new TopologyKey(new TopologyId("flow:1")));
exporter = new FlowCapableTopologyExporter(processor, topologyIID);
executor.execute(processor);
}
use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey in project openflowplugin by opendaylight.
the class FlowCapableTopologyProvider method start.
/**
* Gets called on start of a bundle.
*/
public void start() {
final TopologyKey key = new TopologyKey(new TopologyId(TOPOLOGY_ID));
final InstanceIdentifier<Topology> path = InstanceIdentifier.create(NetworkTopology.class).child(Topology.class, key);
final FlowCapableTopologyExporter listener = new FlowCapableTopologyExporter(processor, path);
this.listenerRegistration = notificationService.registerNotificationListener(listener);
this.transactionChainManager = new TransactionChainManager(dataBroker, TOPOLOGY_PROVIDER);
this.transactionChainManager.activateTransactionManager();
this.transactionChainManager.initialSubmitWriteTransaction();
if (!isFlowTopologyExist(path)) {
transactionChainManager.writeToTransaction(LogicalDatastoreType.OPERATIONAL, path, new TopologyBuilder().setKey(key).build(), true);
transactionChainManager.submitTransaction();
}
LOG.info("FlowCapableTopologyProvider started");
}
use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey in project openflowplugin by opendaylight.
the class DataTreeChangeListenerBase method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
doReturn(mockTxChain).when(mockDataBroker).createTransactionChain(any(TransactionChainListener.class));
processor = new OperationProcessor(mockDataBroker);
topologyIID = InstanceIdentifier.create(NetworkTopology.class).child(Topology.class, new TopologyKey(new TopologyId("flow:1")));
terminationPointListener = new TerminationPointChangeListenerImpl(mockDataBroker, processor);
nodeChangeListener = new NodeChangeListenerImpl(mockDataBroker, processor);
executor.execute(processor);
}
use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey in project bgpcep by opendaylight.
the class NodeChangedListenerTest method setUp.
@Before
public void setUp() throws TransactionCommitFailedException {
final WriteTransaction wTx = getDataBroker().newWriteOnlyTransaction();
wTx.put(LogicalDatastoreType.OPERATIONAL, PCEP_TOPO_IID, new TopologyBuilder().setKey(new TopologyKey(PCEP_TOPOLOGY_ID)).setNode(Lists.newArrayList()).setTopologyId(PCEP_TOPOLOGY_ID).build(), true);
wTx.put(LogicalDatastoreType.OPERATIONAL, TUNNEL_TOPO_IID, new TopologyBuilder().setKey(new TopologyKey(TUNNEL_TOPOLOGY_ID)).setTopologyId(TUNNEL_TOPOLOGY_ID).build(), true);
wTx.submit().checkedGet();
final NodeChangedListener nodeListener = new NodeChangedListener(getDataBroker(), PCEP_TOPOLOGY_ID, TUNNEL_TOPO_IID);
this.listenerRegistration = getDataBroker().registerDataTreeChangeListener(new DataTreeIdentifier<>(LogicalDatastoreType.OPERATIONAL, PCEP_TOPO_IID.child(Node.class)), nodeListener);
}
use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey in project bgpcep by opendaylight.
the class TunnelProgrammingTest method createInitialTopology.
private void createInitialTopology() throws TransactionCommitFailedException {
final TopologyBuilder topologyBuilder = new TopologyBuilder();
topologyBuilder.setKey(new TopologyKey(TOPOLOGY_ID));
topologyBuilder.setServerProvided(true);
topologyBuilder.setTopologyId(TOPOLOGY_ID);
topologyBuilder.setNode(Lists.newArrayList(createNode(NODE1_ID, TP1_ID, NODE1_IPV4), createNode(NODE2_ID, TP2_ID, NODE2_IPV4)));
final WriteTransaction wTx = getDataBroker().newWriteOnlyTransaction();
wTx.put(LogicalDatastoreType.OPERATIONAL, TOPO_IID, topologyBuilder.build(), true);
wTx.submit().checkedGet();
}
Aggregations