Search in sources :

Example 1 with NetworkTopologyBuilder

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

the class AbstractTopologyBuilderTest method createEmptyTopology.

private void createEmptyTopology() {
    final WriteTransaction wTx = getDataBroker().newWriteOnlyTransaction();
    wTx.put(LogicalDatastoreType.OPERATIONAL, InstanceIdentifier.builder(NetworkTopology.class).build(), new NetworkTopologyBuilder().setTopology(Map.of()).build());
    wTx.commit();
}
Also used : WriteTransaction(org.opendaylight.mdsal.binding.api.WriteTransaction) NetworkTopologyBuilder(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopologyBuilder)

Example 2 with NetworkTopologyBuilder

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

the class TopologyStatsRpcServiceImplTest method setUp.

@Before
public void setUp() throws Exception {
    rpcService = new TopologyStatsRpcServiceImpl(getDataBroker());
    rpcService.init();
    // PCEP topology with one PCC node
    final Topology t1 = createTopology(TOPOLOGY_ID1, BindingMap.of(createPcepNode(NODE_ID1)));
    // PCEP topology with two PCC node
    final Topology t2 = createTopology(TOPOLOGY_ID2, BindingMap.of(createPcepNode(NODE_ID2), createPcepNode(NODE_ID3)));
    // Non-PCEP topology with one non-PCC node
    final Topology t3 = createTopology(NONPCEP_TOPOLOGY, BindingMap.of(new NodeBuilder().setNodeId(new NodeId(NONPCEP_NODE)).build()));
    final WriteTransaction wtx = getDataBroker().newWriteOnlyTransaction();
    final NetworkTopologyBuilder ntb = new NetworkTopologyBuilder();
    ntb.setTopology(BindingMap.of(t1, t2, t3));
    wtx.put(LogicalDatastoreType.OPERATIONAL, InstanceIdentifier.builder(NetworkTopology.class).build(), ntb.build());
    wtx.commit().get();
}
Also used : WriteTransaction(org.opendaylight.mdsal.binding.api.WriteTransaction) NodeId(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId) NetworkTopologyBuilder(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopologyBuilder) 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) NodeBuilder(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeBuilder) Before(org.junit.Before)

Aggregations

WriteTransaction (org.opendaylight.mdsal.binding.api.WriteTransaction)2 NetworkTopologyBuilder (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopologyBuilder)2 Before (org.junit.Before)1 NetworkTopology (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology)1 NodeId (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId)1 Topology (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology)1 NodeBuilder (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeBuilder)1