本文整理汇总了Java中org.opendaylight.yangtools.yang.binding.InstanceIdentifier.InstanceIdentifierBuilder类的典型用法代码示例。如果您正苦于以下问题:Java InstanceIdentifierBuilder类的具体用法?Java InstanceIdentifierBuilder怎么用?Java InstanceIdentifierBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
InstanceIdentifierBuilder类属于org.opendaylight.yangtools.yang.binding.InstanceIdentifier包,在下文中一共展示了InstanceIdentifierBuilder类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: removeFromIpMapDS
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.InstanceIdentifierBuilder; //导入依赖的package包/类
protected void removeFromIpMapDS(long segmentId, String internalIp) {
InstanceIdentifierBuilder<IpMap> idBuilder = InstanceIdentifier.builder(IntextIpMap.class)
.child(IpMapping.class, new IpMappingKey(segmentId))
.child(IpMap.class, new IpMapKey(internalIp));
InstanceIdentifier<IpMap> id = idBuilder.build();
// Get externalIp and decrement the counter
String externalIp = null;
Optional<IpMap> ipMap = MDSALUtil.read(dataBroker, LogicalDatastoreType.OPERATIONAL, id);
if (ipMap.isPresent()) {
externalIp = ipMap.get().getExternalIp();
LOG.debug("removeFromIpMapDS : externalIP is {}", externalIp);
} else {
LOG.warn("removeFromIpMapDS : ipMap not present for the internal IP {}", internalIp);
}
if (externalIp != null) {
updateCounter(segmentId, externalIp, false);
// remove from ipmap DS
LOG.debug("removeFromIpMapDS : Removing ipmap from datastore");
MDSALUtil.syncDelete(dataBroker, LogicalDatastoreType.OPERATIONAL, id);
} else {
LOG.warn("removeFromIpMapDS : externalIp not present for the internal IP {}", internalIp);
}
}
开发者ID:opendaylight,项目名称:netvirt,代码行数:25,代码来源:NaptManager.java
示例2: removeIpMappingForRouterID
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.InstanceIdentifierBuilder; //导入依赖的package包/类
private void removeIpMappingForRouterID(long segmentId) {
InstanceIdentifierBuilder<IpMapping> idBuilder = InstanceIdentifier.builder(IntextIpMap.class)
.child(IpMapping.class, new IpMappingKey(segmentId));
InstanceIdentifier<IpMapping> id = idBuilder.build();
// Get all externalIps and decrement their counters before deleting the ipmap
String externalIp = null;
Optional<IpMapping> ipMapping = MDSALUtil.read(dataBroker, LogicalDatastoreType.OPERATIONAL, id);
if (ipMapping.isPresent()) {
List<IpMap> ipMaps = ipMapping.get().getIpMap();
for (IpMap ipMap : ipMaps) {
externalIp = ipMap.getExternalIp();
LOG.debug("removeIpMappingForRouterID : externalIP is {}", externalIp);
if (externalIp != null) {
updateCounter(segmentId, externalIp, false);
}
}
// remove from ipmap DS
LOG.debug("removeIpMappingForRouterID : Removing Ipmap for router {} from datastore", segmentId);
MDSALUtil.syncDelete(dataBroker, LogicalDatastoreType.OPERATIONAL, id);
}
}
开发者ID:opendaylight,项目名称:netvirt,代码行数:22,代码来源:NaptManager.java
示例3: addVpnNexthopToDS
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.InstanceIdentifierBuilder; //导入依赖的package包/类
protected void addVpnNexthopToDS(BigInteger dpnId, long vpnId, String ipPrefix, long egressPointer) {
InstanceIdentifierBuilder<VpnNexthops> idBuilder = InstanceIdentifier.builder(L3nexthop.class)
.child(VpnNexthops.class, new VpnNexthopsKey(vpnId));
// Add nexthop to vpn node
VpnNexthop nh = new VpnNexthopBuilder()
.setKey(new VpnNexthopKey(ipPrefix))
.setDpnId(dpnId)
.setIpAddress(ipPrefix)
.setFlowrefCount(1)
.setEgressPointer(egressPointer).build();
InstanceIdentifier<VpnNexthop> id1 = idBuilder
.child(VpnNexthop.class, new VpnNexthopKey(ipPrefix)).build();
LOG.trace("Adding vpnnextHop {} to Operational DS", nh);
MDSALUtil.syncWrite(dataBroker, LogicalDatastoreType.OPERATIONAL, id1, nh);
}
开发者ID:opendaylight,项目名称:netvirt,代码行数:19,代码来源:NexthopManager.java
示例4: getVpnNexthop
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.InstanceIdentifierBuilder; //导入依赖的package包/类
protected VpnNexthop getVpnNexthop(long vpnId, String ipAddress) {
// check if vpn node is there
InstanceIdentifierBuilder<VpnNexthops> idBuilder =
InstanceIdentifier.builder(L3nexthop.class).child(VpnNexthops.class,
new VpnNexthopsKey(vpnId));
InstanceIdentifier<VpnNexthops> id = idBuilder.build();
Optional<VpnNexthops> vpnNexthops = MDSALUtil.read(dataBroker, LogicalDatastoreType.OPERATIONAL, id);
if (vpnNexthops.isPresent()) {
// get nexthops list for vpn
List<VpnNexthop> nexthops = vpnNexthops.get().getVpnNexthop();
for (VpnNexthop nexthop : nexthops) {
if (nexthop.getIpAddress().equals(ipAddress)) {
// return nexthop
LOG.trace("VpnNextHop : {}", nexthop);
return nexthop;
}
}
// return null if not found
}
return null;
}
开发者ID:opendaylight,项目名称:netvirt,代码行数:23,代码来源:NexthopManager.java
示例5: importSubnetRouteForNewVpn
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.InstanceIdentifierBuilder; //导入依赖的package包/类
public synchronized void importSubnetRouteForNewVpn(String rd, String prefix, String nextHop, int label,
SubnetRoute route, WriteTransaction writeConfigTxn) {
RouteOrigin origin = RouteOrigin.SELF_IMPORTED;
VrfEntry vrfEntry = FibHelper.getVrfEntryBuilder(prefix, label, nextHop, origin, null /* parentVpnRd */)
.addAugmentation(SubnetRoute.class, route).build();
List<VrfEntry> vrfEntryList = Collections.singletonList(vrfEntry);
InstanceIdentifierBuilder<VrfTables> idBuilder =
InstanceIdentifier.builder(FibEntries.class).child(VrfTables.class, new VrfTablesKey(rd));
InstanceIdentifier<VrfTables> vrfTableId = idBuilder.build();
VrfTables vrfTableNew = new VrfTablesBuilder().setRouteDistinguisher(rd).setVrfEntry(vrfEntryList).build();
if (writeConfigTxn != null) {
writeConfigTxn.merge(LogicalDatastoreType.CONFIGURATION, vrfTableId, vrfTableNew, true);
} else {
VpnUtil.syncUpdate(dataBroker, LogicalDatastoreType.CONFIGURATION, vrfTableId, vrfTableNew);
}
LOG.info("SUBNETROUTE: importSubnetRouteForNewVpn: Created vrfEntry for rd {} prefix {} nexthop {} label {}"
+ " and elantag {}", rd, prefix, nextHop, label, route.getElantag());
}
开发者ID:opendaylight,项目名称:netvirt,代码行数:20,代码来源:VpnInterfaceManager.java
示例6: getNodeConnRef
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.InstanceIdentifierBuilder; //导入依赖的package包/类
/**
* Gets the node conn ref.
*
* @param nodeId
* the node id
* @param port
* the port
* @return the node conn ref
*/
public static NodeConnectorRef getNodeConnRef(final NodeId nodeId, final Long port) {
StringBuilder _stringBuilder = new StringBuilder(nodeId.getValue());
StringBuilder _append = _stringBuilder.append(":");
StringBuilder sBuild = _append.append(port);
String _string = sBuild.toString();
NodeConnectorId _nodeConnectorId = new NodeConnectorId(_string);
NodeConnectorKey _nodeConnectorKey = new NodeConnectorKey(_nodeConnectorId);
NodeConnectorKey nConKey = _nodeConnectorKey;
InstanceIdentifierBuilder<Nodes> _builder = InstanceIdentifier.<Nodes> builder(Nodes.class);
NodeId _nodeId = new NodeId(nodeId);
NodeKey _nodeKey = new NodeKey(_nodeId);
InstanceIdentifierBuilder<Node> _child = _builder.<Node, NodeKey> child(Node.class, _nodeKey);
InstanceIdentifierBuilder<NodeConnector> _child_1 = _child
.<NodeConnector, NodeConnectorKey> child(NodeConnector.class, nConKey);
NodeConnectorRef _nodeConnectorRef = new NodeConnectorRef(_child_1.build());
return _nodeConnectorRef;
}
开发者ID:onfsdn,项目名称:atrium-odl,代码行数:27,代码来源:AtriumUtils.java
示例7: buildStateInterfaceId
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.InstanceIdentifierBuilder; //导入依赖的package包/类
/**
* Build the interface state.
* @param interfaceName the interface name.
* @return the interface state.
*/
public static InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508
.interfaces.state.Interface> buildStateInterfaceId(String interfaceName) {
InstanceIdentifierBuilder<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508
.interfaces.state.Interface> idBuilder = InstanceIdentifier.builder(InterfacesState.class)
.child(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces
.state.Interface.class, new org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces
.rev140508.interfaces.state.InterfaceKey(interfaceName));
return idBuilder.build();
}
开发者ID:opendaylight,项目名称:netvirt,代码行数:15,代码来源:AclServiceUtils.java
示例8: checkIpPortMap
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.InstanceIdentifierBuilder; //导入依赖的package包/类
private SessionAddress checkIpPortMap(long segmentId, String internalIpPort,
NAPTEntryEvent.Protocol protocol) {
LOG.debug("checkIpPortMap : called with segmentId {} and internalIpPort {}",
segmentId, internalIpPort);
ProtocolTypes protocolType = NatUtil.getProtocolType(protocol);
// check if ip-port-map node is there
InstanceIdentifierBuilder<IpPortMap> idBuilder =
InstanceIdentifier.builder(IntextIpPortMap.class)
.child(IpPortMapping.class, new IpPortMappingKey(segmentId))
.child(IntextIpProtocolType.class, new IntextIpProtocolTypeKey(protocolType))
.child(IpPortMap.class, new IpPortMapKey(internalIpPort));
InstanceIdentifier<IpPortMap> id = idBuilder.build();
Optional<IpPortMap> ipPortMapType =
MDSALUtil.read(dataBroker, LogicalDatastoreType.CONFIGURATION, id);
if (ipPortMapType.isPresent()) {
LOG.debug("checkIpPortMap : {}", ipPortMapType.get());
SessionAddress externalIpPort = new SessionAddress(ipPortMapType.get().getIpPortExternal().getIpAddress(),
ipPortMapType.get().getIpPortExternal().getPortNum());
LOG.debug("checkIpPortMap : returning successfully externalIP {} and port {}",
externalIpPort.getIpAddress(), externalIpPort.getPortNumber());
return externalIpPort;
}
// return null if not found
LOG.warn("checkIpPortMap : no-entry in checkIpPortMap, returning NULL [should be OK] for "
+ "segmentId {} and internalIPPort {}", segmentId, internalIpPort);
return null;
}
开发者ID:opendaylight,项目名称:netvirt,代码行数:28,代码来源:NaptManager.java
示例9: checkIpMap
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.InstanceIdentifierBuilder; //导入依赖的package包/类
protected String checkIpMap(long segmentId, String internalIp) {
LOG.debug("checkIpMap : called with segmentId {} and internalIp {}", segmentId, internalIp);
String externalIp;
// check if ip-map node is there
InstanceIdentifierBuilder<IpMapping> idBuilder =
InstanceIdentifier.builder(IntextIpMap.class).child(IpMapping.class, new IpMappingKey(segmentId));
InstanceIdentifier<IpMapping> id = idBuilder.build();
Optional<IpMapping> ipMapping = MDSALUtil.read(dataBroker, LogicalDatastoreType.OPERATIONAL, id);
if (ipMapping.isPresent()) {
List<IpMap> ipMaps = ipMapping.get().getIpMap();
for (IpMap ipMap : ipMaps) {
if (ipMap.getInternalIp().equals(internalIp)) {
LOG.debug("checkIpMap : IpMap : {}", ipMap);
externalIp = ipMap.getExternalIp();
LOG.debug("checkIpMap : successfully returning externalIp {}", externalIp);
return externalIp;
} else if (ipMap.getInternalIp().contains("/")) { // subnet case
SubnetUtils subnetUtils = new SubnetUtils(ipMap.getInternalIp());
SubnetInfo subnetInfo = subnetUtils.getInfo();
if (subnetInfo.isInRange(internalIp)) {
LOG.debug("checkIpMap : internalIp {} found to be IpMap of internalIpSubnet {}",
internalIp, ipMap.getInternalIp());
externalIp = ipMap.getExternalIp();
LOG.debug("checkIpMap : checkIpMap successfully returning externalIp {}", externalIp);
return externalIp;
}
}
}
}
// return null if not found
LOG.error("checkIpMap : failed, returning NULL for segmentId {} and internalIp {}",
segmentId, internalIp);
return null;
}
开发者ID:opendaylight,项目名称:netvirt,代码行数:35,代码来源:NaptManager.java
示例10: removeFromIpPortMapDS
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.InstanceIdentifierBuilder; //导入依赖的package包/类
protected void removeFromIpPortMapDS(long segmentId, String internalIpPort, ProtocolTypes protocolType) {
InstanceIdentifierBuilder<IpPortMap> idBuilder = InstanceIdentifier.builder(IntextIpPortMap.class)
.child(IpPortMapping.class, new IpPortMappingKey(segmentId))
.child(IntextIpProtocolType.class, new IntextIpProtocolTypeKey(protocolType))
.child(IpPortMap.class, new IpPortMapKey(internalIpPort));
InstanceIdentifier<IpPortMap> id = idBuilder.build();
// remove from ipportmap DS
LOG.debug("removeFromIpPortMapDS : Removing ipportmap from datastore : {}", id);
MDSALUtil.syncDelete(dataBroker, LogicalDatastoreType.CONFIGURATION, id);
}
开发者ID:opendaylight,项目名称:netvirt,代码行数:11,代码来源:NaptManager.java
示例11: removeIntExtIpMapDS
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.InstanceIdentifierBuilder; //导入依赖的package包/类
protected void removeIntExtIpMapDS(long segmentId, String internalIp) {
InstanceIdentifierBuilder<IpMap> idBuilder = InstanceIdentifier.builder(IntextIpMap.class)
.child(IpMapping.class, new IpMappingKey(segmentId))
.child(IpMap.class, new IpMapKey(internalIp));
InstanceIdentifier<IpMap> id = idBuilder.build();
LOG.debug("removeIntExtIpMapDS : Removing ipmap from datastore");
MDSALUtil.syncDelete(dataBroker, LogicalDatastoreType.OPERATIONAL, id);
}
开发者ID:opendaylight,项目名称:netvirt,代码行数:10,代码来源:NaptManager.java
示例12: getExternalIpAllocatedForSubnet
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.InstanceIdentifierBuilder; //导入依赖的package包/类
protected String getExternalIpAllocatedForSubnet(long segmentId, String internalIp) {
InstanceIdentifierBuilder<IpMap> idBuilder = InstanceIdentifier.builder(IntextIpMap.class)
.child(IpMapping.class, new IpMappingKey(segmentId))
.child(IpMap.class, new IpMapKey(internalIp));
InstanceIdentifier<IpMap> id = idBuilder.build();
Optional<IpMap> ipMap = MDSALUtil.read(dataBroker, LogicalDatastoreType.OPERATIONAL, id);
if (ipMap.isPresent()) {
return ipMap.get().getExternalIp();
}
return null;
}
开发者ID:opendaylight,项目名称:netvirt,代码行数:13,代码来源:NaptManager.java
示例13: buildRoutePathId
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.InstanceIdentifierBuilder; //导入依赖的package包/类
public static InstanceIdentifier<RoutePaths> buildRoutePathId(String rd, String prefix, String nextHop) {
InstanceIdentifierBuilder<RoutePaths> idBuilder =
InstanceIdentifier.builder(FibEntries.class)
.child(VrfTables.class, new VrfTablesKey(rd))
.child(VrfEntry.class, new VrfEntryKey(prefix))
.child(RoutePaths.class, new RoutePathsKey(nextHop));
return idBuilder.build();
}
开发者ID:opendaylight,项目名称:netvirt,代码行数:9,代码来源:FibHelper.java
示例14: removeVpnNexthopFromDS
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.InstanceIdentifierBuilder; //导入依赖的package包/类
private void removeVpnNexthopFromDS(long vpnId, String ipPrefix) {
InstanceIdentifierBuilder<VpnNexthop> idBuilder = InstanceIdentifier.builder(L3nexthop.class)
.child(VpnNexthops.class, new VpnNexthopsKey(vpnId))
.child(VpnNexthop.class, new VpnNexthopKey(ipPrefix));
InstanceIdentifier<VpnNexthop> id = idBuilder.build();
// remove from DS
LOG.trace("Removing vpn next hop from datastore : {}", id);
MDSALUtil.syncDelete(dataBroker, LogicalDatastoreType.OPERATIONAL, id);
}
开发者ID:opendaylight,项目名称:netvirt,代码行数:11,代码来源:NexthopManager.java
示例15: buildVrfEntryId
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.InstanceIdentifierBuilder; //导入依赖的package包/类
public static InstanceIdentifier<VrfEntry> buildVrfEntryId(String rd, String prefix) {
InstanceIdentifierBuilder<VrfEntry> idBuilder =
InstanceIdentifier.builder(FibEntries.class).child(VrfTables.class, new VrfTablesKey(rd))
.child(VrfEntry.class, new VrfEntryKey(prefix));
InstanceIdentifier<VrfEntry> vrfEntryId = idBuilder.build();
return vrfEntryId;
}
开发者ID:opendaylight,项目名称:netvirt,代码行数:8,代码来源:FibManagerTest.java
示例16: removeFibEntryFromDS
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.InstanceIdentifierBuilder; //导入依赖的package包/类
public synchronized void removeFibEntryFromDS(String rd, String prefix) {
if (rd == null || rd.isEmpty()) {
LOG.error("Prefix {} not associated with vpn", prefix);
return;
}
LOG.debug("Removing fib entry with destination prefix {} from vrf table for rd {}", prefix, rd);
InstanceIdentifierBuilder<VrfEntry> idBuilder =
InstanceIdentifier.builder(FibEntries.class).child(VrfTables.class, new VrfTablesKey(rd)).child(
VrfEntry.class, new VrfEntryKey(prefix));
InstanceIdentifier<VrfEntry> vrfEntryId = idBuilder.build();
bgpUtil.delete(LogicalDatastoreType.CONFIGURATION, vrfEntryId);
}
开发者ID:opendaylight,项目名称:netvirt,代码行数:16,代码来源:FibDSWriter.java
示例17: removeMacEntryFromDS
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.InstanceIdentifierBuilder; //导入依赖的package包/类
public void removeMacEntryFromDS(String rd, String macAddress) {
if (StringUtils.isEmpty(rd)) {
LOG.error("Mac {} not associated with vpn", macAddress);
return;
}
LOG.debug("Removing Mac fib entry with Mac {} from vrf table for rd {}", macAddress, rd);
InstanceIdentifierBuilder<MacVrfEntry> idBuilder =
InstanceIdentifier.builder(FibEntries.class).child(VrfTables.class, new VrfTablesKey(rd)).child(
MacVrfEntry.class, new MacVrfEntryKey(macAddress));
InstanceIdentifier<MacVrfEntry> macEntryId = idBuilder.build();
bgpUtil.delete(LogicalDatastoreType.CONFIGURATION, macEntryId);
}
开发者ID:opendaylight,项目名称:netvirt,代码行数:16,代码来源:FibDSWriter.java
示例18: startConfig
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.InstanceIdentifierBuilder; //导入依赖的package包/类
public void startConfig(String bgpHost, int thriftPort) {
InstanceIdentifier.InstanceIdentifierBuilder<ConfigServer> iib =
InstanceIdentifier.builder(Bgp.class).child(ConfigServer.class);
InstanceIdentifier<ConfigServer> iid = iib.build();
Ipv4Address ipAddr = new Ipv4Address(bgpHost);
ConfigServer dto = new ConfigServerBuilder().setHost(ipAddr)
.setPort((long) thriftPort).build();
update(iid, dto);
}
开发者ID:opendaylight,项目名称:netvirt,代码行数:10,代码来源:BgpConfigurationManager.java
示例19: startBgp
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.InstanceIdentifierBuilder; //导入依赖的package包/类
public void startBgp(long as, String routerId, int spt, boolean fbit) {
IpAddress rid = routerId == null ? null : new IpAddress(routerId.toCharArray());
Long staleTime = (long) spt;
InstanceIdentifier.InstanceIdentifierBuilder<AsId> iib =
InstanceIdentifier.builder(Bgp.class).child(AsId.class);
InstanceIdentifier<AsId> iid = iib.build();
AsId dto = new AsIdBuilder().setLocalAs(as)
.setRouterId(rid)
.setStalepathTime(staleTime)
.setAnnounceFbit(fbit).build();
update(iid, dto);
}
开发者ID:opendaylight,项目名称:netvirt,代码行数:13,代码来源:BgpConfigurationManager.java
示例20: addLogging
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.InstanceIdentifierBuilder; //导入依赖的package包/类
public void addLogging(String fileName, String logLevel) {
InstanceIdentifier.InstanceIdentifierBuilder<Logging> iib =
InstanceIdentifier.builder(Bgp.class).child(Logging.class);
InstanceIdentifier<Logging> iid = iib.build();
Logging dto = new LoggingBuilder().setFile(fileName)
.setLevel(logLevel).build();
update(iid, dto);
}
开发者ID:opendaylight,项目名称:netvirt,代码行数:9,代码来源:BgpConfigurationManager.java
注:本文中的org.opendaylight.yangtools.yang.binding.InstanceIdentifier.InstanceIdentifierBuilder类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论