本文整理汇总了Java中org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId类的典型用法代码示例。如果您正苦于以下问题:Java TopologyId类的具体用法?Java TopologyId怎么用?Java TopologyId使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TopologyId类属于org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021包,在下文中一共展示了TopologyId类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildNodeAttribute
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId; //导入依赖的package包/类
private void buildNodeAttribute(NodeBuilder builder, ComposeFabricInput input, FabricId fabricId) {
builder.setKey(new NodeKey(fabricId));
List<DeviceNodes> devices = input.getDeviceNodes();
if (devices != null) {
List<SupportingNode> snodes = Lists.newArrayList();
for (DeviceNodes device : devices) {
InstanceIdentifier<?> nodeRef = device.getDeviceRef().getValue();
NodeId nodeid = nodeRef.firstKeyOf(Node.class).getNodeId();
TopologyId topoId = nodeRef.firstKeyOf(Topology.class).getTopologyId();
SupportingNodeBuilder snodeBuilder = new SupportingNodeBuilder();
snodeBuilder.setNodeRef(nodeid);
snodeBuilder.setTopologyRef(topoId);
snodeBuilder.setKey(new SupportingNodeKey(nodeid, topoId));
snodes.add(snodeBuilder.build());
}
builder.setSupportingNode(snodes);
}
}
示例2: findGWLink
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId; //导入依赖的package包/类
private Link findGWLink(ReadWriteTransaction trans, FabricId fabricid, TpId tpid, NodeId routerid) {
InstanceIdentifier<Link> linkIId = InstanceIdentifier.create(NetworkTopology.class)
.child(Topology.class, new TopologyKey(new TopologyId(fabricid)))
.child(Link.class, new LinkKey(this.createGatewayLink(routerid, tpid)));
CheckedFuture<Optional<Link>,ReadFailedException> readFuture = trans.read(LogicalDatastoreType.OPERATIONAL,
linkIId);
try {
Optional<Link> optional = readFuture.get();
Link link = optional.get();
return link;
} catch (InterruptedException | ExecutionException e) {
LOG.error("", e);
}
return null;
}
示例3: getPhyLocation
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId; //导入依赖的package包/类
public static Location getPhyLocation(TopologyId fabricId, String inventoryNodeIdStr,
String inventoryNodeConnectorIdStr) {
LocationBuilder locBuilder = new LocationBuilder();
/*
* TODO: For now inventory nodeId and node connector id are directly mapped
* to topology. This is a kludge. A formal approach would involve an
* inventory-to-topology lookup.
*/
NodeId nodeId = new NodeId(inventoryNodeIdStr);
TpId tpId = new TpId(inventoryNodeConnectorIdStr);
locBuilder.setNodeRef(new NodeRef(createNodePath(fabricId, nodeId)));
locBuilder.setTpRef(new TpRef(createTpPath(fabricId, nodeId, tpId)));
return locBuilder.build();
}
示例4: createVcTopologyInstance
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId; //导入依赖的package包/类
private InstanceIdentifier<Topology> createVcTopologyInstance(String topoIdStr) {
TopologyId topoId = new TopologyId(topoIdStr);
TopologyKey topoKey = new TopologyKey(topoId);
InstanceIdentifier<Topology> topoPath = FabMgrYangDataUtil.buildTopologyPath(topoIdStr);
TopologyBuilder topoBuilder = new TopologyBuilder();
topoBuilder.setKey(topoKey);
topoBuilder.setTopologyId(topoId);
Topology topo = topoBuilder.build();
fabMgrDatastoreUtil.putData(OPERATIONAL, topoPath, topo);
InstanceIdentifier<TopologyTypes1> topoTypePath =
topoPath.child(TopologyTypes.class).augmentation(TopologyTypes1.class);
VcontainerTopology vcTopoType = new VcontainerTopologyBuilder().build();
TopologyTypes1 topologyTypeAugment = new TopologyTypes1Builder().setVcontainerTopology(vcTopoType).build();
fabMgrDatastoreUtil.putData(OPERATIONAL, topoTypePath, topologyTypeAugment);
return topoPath;
}
示例5: testPutCreateParentsSuccess
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId; //导入依赖的package包/类
@Test
public void testPutCreateParentsSuccess() throws Exception {
InstanceIdentifier<Node> iid = InstanceIdentifier.builder(NetworkTopology.class)
.child(Topology.class, new TopologyKey(new TopologyId("topology-netconf")))
.child(Node.class, new NodeKey(new NodeId(NODE_ID)))
.build();
Node node1 =
createNetconfNode(NODE_ID, V3PO_1704_CAPABILITY, V3PO_1701_CAPABILITY, INTERFACES);
WriteTransaction writeTx = getDataBroker().newWriteOnlyTransaction();
writeTx.put(LogicalDatastoreType.OPERATIONAL, iid, node1, true);
writeTx.submit().get();
Assert.assertEquals(sf.get(), Integer.valueOf(1));
sf = SettableFuture.create();
writeTx = getDataBroker().newWriteOnlyTransaction();
writeTx.delete(LogicalDatastoreType.OPERATIONAL, iid);
writeTx.submit().get();
Assert.assertEquals(sf.get(), Integer.valueOf(2));
}
示例6: configFileTest
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId; //导入依赖的package包/类
@Test
public void configFileTest() throws ReadFailedException, InterruptedException {
final KeyedInstanceIdentifier<Topology, TopologyKey> topologyIIdKeyed =
InstanceIdentifier.create(NetworkTopology.class).child(Topology.class,
new TopologyKey(new TopologyId("topology-test")));
checkNotPresentConfiguration(getDataBroker(), topologyIIdKeyed);
assertNotNull(ClassLoader.getSystemClassLoader().getResource("initial/network-topology-config.xml"));
final NetworkTopologyConfigFileProcessor processor = new NetworkTopologyConfigFileProcessor(this.configLoader,
getDataBroker());
processor.init();
checkPresentConfiguration(getDataBroker(), topologyIIdKeyed);
assertEquals(SchemaPath.create(true, NetworkTopology.QNAME), processor.getSchemaPath());
processor.close();
}
示例7: createTunnelTopologyProvider
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId; //导入依赖的package包/类
private synchronized void createTunnelTopologyProvider(final Topology topology) {
if (!filterPcepTopologies(topology.getTopologyTypes())) {
return;
}
final TopologyId topologyId = topology.getTopologyId();
if (this.pcepTunnelServices.containsKey(topology.getTopologyId())) {
LOG.warn("Tunnel Topology {} already exist. New instance won't be created", topologyId);
return;
}
LOG.debug("Create Tunnel Topology {}", topologyId);
final PcepTunnelTopologyConfig config = topology.getAugmentation(PcepTunnelTopologyConfig.class);
final String pcepTopoID = StringUtils
.substringBetween(config.getPcepTopologyReference().getValue(), "=\"", "\"");
final InstanceIdentifier<Topology> pcepTopoRef = InstanceIdentifier.builder(NetworkTopology.class)
.child(Topology.class, new TopologyKey(new TopologyId(pcepTopoID))).build();
final PCEPTunnelClusterSingletonService tunnelTopoCss =
new PCEPTunnelClusterSingletonService(this.dependencies, pcepTopoRef, topologyId);
this.pcepTunnelServices.put(topology.getTopologyId(), tunnelTopoCss);
}
示例8: createNode
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId; //导入依赖的package包/类
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();
}
示例9: createTopologyProvider
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId; //导入依赖的package包/类
private synchronized void createTopologyProvider(final Topology topology) {
if (!filterPcepTopologies(topology.getTopologyTypes())) {
return;
}
final TopologyId topologyId = topology.getTopologyId();
if (this.pcepTopologyServices.containsKey(topology.getTopologyId())) {
LOG.warn("Topology Provider {} already exist. New instance won't be created", topologyId);
return;
}
LOG.info("Creating Topology {}", topologyId);
LOG.trace("Topology {}.", topology);
final SessionConfig config = topology.getAugmentation(PcepTopologyTypeConfig.class).getSessionConfig();
final InstructionScheduler instructionScheduler = this.instructionSchedulerFactory
.createInstructionScheduler(topologyId.getValue());
final PCEPTopologyConfiguration dependencies = new PCEPTopologyConfiguration(config, topology);
final PCEPTopologyProviderBean pcepTopologyProviderBean = (PCEPTopologyProviderBean) this.container
.getComponentInstance(PCEPTopologyProviderBean.class.getSimpleName());
this.pcepTopologyServices.put(topologyId, pcepTopologyProviderBean);
pcepTopologyProviderBean.start(dependencies, instructionScheduler);
}
示例10: instantiateServiceInstance
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId; //导入依赖的package包/类
/**
* Create Base Topology.
*/
synchronized void instantiateServiceInstance() {
final TopologyKey key = InstanceIdentifier.keyOf(this.topology);
final TopologyId topologyId = key.getTopologyId();
final WriteTransaction tx = this.dependenciesProvider.getDataBroker().newWriteOnlyTransaction();
tx.put(LogicalDatastoreType.OPERATIONAL, this.topology, new TopologyBuilder().setKey(key)
.setTopologyId(topologyId).setTopologyTypes(new TopologyTypesBuilder()
.addAugmentation(TopologyTypes1.class, new TopologyTypes1Builder().setTopologyPcep(
new TopologyPcepBuilder().build()).build()).build())
.setNode(new ArrayList<>()).build(), true);
try {
tx.submit().get();
LOG.info("PCEP Topology {} created successfully.", topologyId.getValue());
ServerSessionManager.this.isClosed.set(false);
} catch (final ExecutionException | InterruptedException throwable) {
LOG.error("Failed to create PCEP Topology {}.", topologyId.getValue(), throwable);
ServerSessionManager.this.isClosed.set(true);
}
}
示例11: getOvsdbTopology
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId; //导入依赖的package包/类
private Boolean getOvsdbTopology() {
LOG.info("getOvsdbTopology: looking for {}...", SouthboundUtils.OVSDB_TOPOLOGY_ID.getValue());
Boolean found = false;
final TopologyId topologyId = SouthboundUtils.OVSDB_TOPOLOGY_ID;
InstanceIdentifier<Topology> path =
InstanceIdentifier.create(NetworkTopology.class).child(Topology.class, new TopologyKey(topologyId));
for (int i = 0; i < 60; i++) {
Topology topology = mdsalUtils.read(LogicalDatastoreType.OPERATIONAL, path);
if (topology != null) {
LOG.info("getOvsdbTopology: found {}...", SouthboundUtils.OVSDB_TOPOLOGY_ID.getValue());
found = true;
break;
} else {
LOG.info("getOvsdbTopology: still looking ({})...", i);
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
LOG.warn("Interrupted while waiting for {}", SouthboundUtils.OVSDB_TOPOLOGY_ID.getValue(), e);
}
}
}
return found;
}
示例12: getHwvtepTopology
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId; //导入依赖的package包/类
private Boolean getHwvtepTopology() {
LOG.info("getHwvtepTopology: looking for {}...", HwvtepSouthboundConstants.HWVTEP_TOPOLOGY_ID.getValue());
Boolean found = false;
final TopologyId topologyId = HwvtepSouthboundConstants.HWVTEP_TOPOLOGY_ID;
InstanceIdentifier<Topology> path =
InstanceIdentifier.create(NetworkTopology.class).child(Topology.class, new TopologyKey(topologyId));
for (int i = 0; i < 60; i++) {
Topology topology = mdsalUtils.read(LogicalDatastoreType.OPERATIONAL, path);
if (topology != null) {
LOG.info("getHwvtepTopology: found {}...", HwvtepSouthboundConstants.HWVTEP_TOPOLOGY_ID.getValue());
found = true;
break;
} else {
LOG.info("getHwvtepTopology: still looking ({})...", i);
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
LOG.warn("Interrupted while waiting for {}",
HwvtepSouthboundConstants.HWVTEP_TOPOLOGY_ID.getValue(), e);
}
}
}
return found;
}
示例13: initializeNetvirtTopology
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId; //导入依赖的package包/类
private void initializeNetvirtTopology() {
final TopologyId topologyId = new TopologyId("netvirt:1");
InstanceIdentifier<Topology> path =
InstanceIdentifier.create(NetworkTopology.class).child(Topology.class, new TopologyKey(topologyId));
TopologyBuilder tpb = new TopologyBuilder();
tpb.setTopologyId(topologyId);
if (!put(LogicalDatastoreType.OPERATIONAL, path, tpb.build())) {
LOG.error("StateManager error initializing netvirt topology");
}
}
示例14: createInstanceIdentifier
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId; //导入依赖的package包/类
public static InstanceIdentifier<Node> createInstanceIdentifier(String nodeIdString) {
NodeId nodeId = new NodeId(new Uri(nodeIdString));
NodeKey nodeKey = new NodeKey(nodeId);
TopologyKey topoKey = new TopologyKey(new TopologyId(new Uri("hwvtep:1")));
return InstanceIdentifier.builder(NetworkTopology.class)
.child(Topology.class, topoKey)
.child(Node.class, nodeKey)
.build();
}
示例15: getInstanceIdentifier
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId; //导入依赖的package包/类
public static InstanceIdentifier<Node> getInstanceIdentifier(String haUUidVal) {
String nodeString = "hwvtep://uuid/" + UUID.nameUUIDFromBytes(haUUidVal.getBytes()).toString();
NodeId nodeId = new NodeId(new Uri(nodeString));
NodeKey nodeKey = new NodeKey(nodeId);
TopologyKey topoKey = new TopologyKey(new TopologyId(new Uri("hwvtep:1")));
return InstanceIdentifier.builder(NetworkTopology.class).child(Topology.class, topoKey)
.child(Node.class, nodeKey).build();
}