Search in sources :

Example 11 with TopologyId

use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId 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);
}
Also used : TransactionChainListener(org.opendaylight.controller.md.sal.common.api.data.TransactionChainListener) TopologyKey(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey) NetworkTopology(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology) Topology(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology) TopologyId(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId) Before(org.junit.Before)

Example 12 with TopologyId

use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId 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");
}
Also used : TopologyKey(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey) TopologyBuilder(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyBuilder) NetworkTopology(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology) NetworkTopology(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology) Topology(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology) TransactionChainManager(org.opendaylight.openflowplugin.common.txchain.TransactionChainManager) TopologyId(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId)

Example 13 with TopologyId

use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId 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);
}
Also used : TransactionChainListener(org.opendaylight.controller.md.sal.common.api.data.TransactionChainListener) TopologyKey(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey) NetworkTopology(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology) Topology(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology) TopologyId(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId) Before(org.junit.Before)

Example 14 with TopologyId

use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId in project bgpcep by opendaylight.

the class TunnelProviderDeployer method updateTunnelTopologyProvider.

private synchronized void updateTunnelTopologyProvider(final Topology topology) {
    if (!filterPcepTopologies(topology.getTopologyTypes())) {
        return;
    }
    final TopologyId topologyId = topology.getTopologyId();
    final PCEPTunnelClusterSingletonService previous = this.pcepTunnelServices.remove(topology.getTopologyId());
    closeTopology(previous, topologyId);
    createTunnelTopologyProvider(topology);
}
Also used : TopologyId(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId)

Example 15 with TopologyId

use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId in project bgpcep by opendaylight.

the class TunnelProgrammingTest method createNode.

private static Node createNode(final NodeId nodeId, final TpId tpId, final String ipv4Address) {
    final TerminationPointBuilder tpBuilder = new TerminationPointBuilder();
    tpBuilder.setTpId(tpId);
    tpBuilder.setKey(new TerminationPointKey(tpId));
    tpBuilder.addAugmentation(TerminationPoint1.class, new TerminationPoint1Builder().setIgpTerminationPointAttributes(new IgpTerminationPointAttributesBuilder().setTerminationPointType(new IpBuilder().setIpAddress(Collections.singletonList(new IpAddress(new Ipv4Address(ipv4Address)))).build()).build()).build());
    final NodeBuilder nodeBuilder = new NodeBuilder();
    nodeBuilder.setNodeId(nodeId);
    nodeBuilder.setKey(new NodeKey(nodeId));
    nodeBuilder.setTerminationPoint(Lists.newArrayList(tpBuilder.build()));
    final SupportingNode supportingNode = new SupportingNodeBuilder().setKey(new SupportingNodeKey(nodeId, new TopologyId("dummy"))).addAugmentation(SupportingNode1.class, new SupportingNode1Builder().setPathComputationClient(new PathComputationClientBuilder().setControlling(true).build()).build()).build();
    nodeBuilder.setSupportingNode(Lists.newArrayList(supportingNode));
    return nodeBuilder.build();
}
Also used : SupportingNodeBuilder(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.node.attributes.SupportingNodeBuilder) TerminationPointKey(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPointKey) PathComputationClientBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.tunnel.pcep.rev130820.tunnel.pcep.supporting.node.attributes.PathComputationClientBuilder) TerminationPointBuilder(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPointBuilder) SupportingNode(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.node.attributes.SupportingNode) SupportingNode1(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.tunnel.pcep.rev130820.SupportingNode1) NodeBuilder(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeBuilder) SupportingNodeBuilder(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.node.attributes.SupportingNodeBuilder) SupportingNode1Builder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.tunnel.pcep.rev130820.SupportingNode1Builder) IpBuilder(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.nt.l3.unicast.igp.topology.rev131021.igp.termination.point.attributes.igp.termination.point.attributes.termination.point.type.IpBuilder) IpAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress) SupportingNodeKey(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.node.attributes.SupportingNodeKey) IgpTerminationPointAttributesBuilder(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.nt.l3.unicast.igp.topology.rev131021.igp.termination.point.attributes.IgpTerminationPointAttributesBuilder) SupportingNodeKey(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.node.attributes.SupportingNodeKey) NodeKey(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey) TerminationPoint1Builder(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.nt.l3.unicast.igp.topology.rev131021.TerminationPoint1Builder) TopologyId(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId) Ipv4Address(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address)

Aggregations

TopologyId (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId)18 TopologyKey (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey)12 NetworkTopology (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology)11 Topology (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology)7 Node (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node)6 NodeKey (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey)6 NodeId (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId)5 ExecutionException (java.util.concurrent.ExecutionException)4 ArrayList (java.util.ArrayList)2 Before (org.junit.Before)2 WriteTransaction (org.opendaylight.controller.md.sal.binding.api.WriteTransaction)2 TransactionChainListener (org.opendaylight.controller.md.sal.common.api.data.TransactionChainListener)2 IpAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress)2 Uri (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri)2 Tunnels (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical._switch.attributes.Tunnels)2 TunnelsBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical._switch.attributes.TunnelsBuilder)2 TunnelsKey (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical._switch.attributes.TunnelsKey)2 BfdParams (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.tunnel.attributes.BfdParams)2 PcepTopologyNodeStatsAug (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.stats.rev171113.PcepTopologyNodeStatsAug)2 TopologyBuilder (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyBuilder)2