本文整理汇总了Java中org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId类的典型用法代码示例。如果您正苦于以下问题:Java NodeId类的具体用法?Java NodeId怎么用?Java NodeId使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NodeId类属于org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021包,在下文中一共展示了NodeId类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: registerEventSourceTest
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; //导入依赖的package包/类
@Test
public void registerEventSourceTest() throws Exception {
topicTestHelper();
Node nodeMock = mock(Node.class);
EventSource eventSourceMock = mock(EventSource.class);
NodeId nodeId = new NodeId("nodeIdValue1");
nodeKey = new NodeKey(nodeId);
doReturn(nodeKey).when(nodeMock).getKey();
doReturn(nodeKey).when(eventSourceMock).getSourceNodeKey();
BindingAwareBroker.RoutedRpcRegistration routedRpcRegistrationMock = mock(BindingAwareBroker.RoutedRpcRegistration.class);
doReturn(routedRpcRegistrationMock).when(rpcProviderRegistryMock).addRoutedRpcImplementation(EventSourceService.class, eventSourceMock);
doNothing().when(routedRpcRegistrationMock).registerPath(eq(NodeContext.class), any(KeyedInstanceIdentifier.class));
assertNotNull("Return value has not been created correctly.", eventSourceTopology.registerEventSource(eventSourceMock));
}
示例2: onDataTreeChangedTest
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Test
public void onDataTreeChangedTest() {
InstanceIdentifier<Node> instanceIdentifierMock = mock(InstanceIdentifier.class);
DataTreeModification<Node> mockDataTreeModification = mock(DataTreeModification.class);
DataObjectModification<Node> mockModification = mock(DataObjectModification.class);
doReturn(mockModification).when(mockDataTreeModification).getRootNode();
doReturn(new DataTreeIdentifier<>(LogicalDatastoreType.OPERATIONAL, instanceIdentifierMock))
.when(mockDataTreeModification).getRootPath();
doReturn(DataObjectModification.ModificationType.WRITE).when(mockModification).getModificationType();
Node dataObjectNodeMock = mock(Node.class);
doReturn(getNodeKey("testNodeId01")).when(dataObjectNodeMock).getKey();
NodeId nodeIdMock = mock(NodeId.class);
doReturn(nodeIdMock).when(dataObjectNodeMock).getNodeId();
doReturn("nodeIdPattern1").when(nodeIdMock).getValue();
doReturn(dataObjectNodeMock).when(mockModification).getDataAfter();
eventSourceTopic.onDataTreeChanged(Collections.singletonList(mockDataTreeModification));
verify(dataObjectNodeMock).getNodeId();
verify(nodeIdMock).getValue();
}
示例3: remove
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; //导入依赖的package包/类
@Override
protected void remove(InstanceIdentifier<LocalUcastMacs> identifier,
LocalUcastMacs del) {
// Flow removal for table 18 is handled in Neutron Port delete.
//remove the new CR-DHCP
NodeId torNodeId = identifier.firstKeyOf(Node.class).getNodeId();
LogicalSwitches logicalSwitch = getLogicalSwitches(del);
if (null == logicalSwitch) {
LOG.error("DhcpUCastMacListener remove :Logical Switch ref doesn't have data");
return;
}
String elanInstanceName = logicalSwitch.getHwvtepNodeName().getValue();
L2GatewayDevice device = ElanL2GwCacheUtils.getL2GatewayDeviceFromCache(elanInstanceName, torNodeId.getValue());
if (device == null) {
LOG.error("Logical Switch Device with name {} is not present in L2GWCONN cache", elanInstanceName);
return;
}
IpAddress tunnelIp = device.getTunnelIp();
Pair<IpAddress, String> tunnelIpElanName = new ImmutablePair<>(tunnelIp, elanInstanceName);
dhcpExternalTunnelManager.removeFromAvailableCache(tunnelIpElanName);
}
示例4: createItmTunnels
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; //导入依赖的package包/类
protected static void createItmTunnels(ItmRpcService itmRpcService, String hwvtepId, String psName,
IpAddress tunnelIp) {
AddL2GwDeviceInputBuilder builder = new AddL2GwDeviceInputBuilder();
builder.setTopologyId(HwvtepSouthboundConstants.HWVTEP_TOPOLOGY_ID.getValue());
builder.setNodeId(HwvtepSouthboundUtils.createManagedNodeId(new NodeId(hwvtepId), psName).getValue());
builder.setIpAddress(tunnelIp);
try {
Future<RpcResult<Void>> result = itmRpcService.addL2GwDevice(builder.build());
RpcResult<Void> rpcResult = result.get();
if (rpcResult.isSuccessful()) {
LOG.info("Created ITM tunnels for {}", hwvtepId);
} else {
LOG.error("Failed to create ITM Tunnels: ", rpcResult.getErrors());
}
} catch (InterruptedException | ExecutionException e) {
LOG.error("RPC to create ITM tunnels failed", e);
}
}
示例5: deleteItmTunnels
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; //导入依赖的package包/类
protected static void deleteItmTunnels(ItmRpcService itmRpcService, String hwvtepId, String psName,
IpAddress tunnelIp) {
DeleteL2GwDeviceInputBuilder builder = new DeleteL2GwDeviceInputBuilder();
builder.setTopologyId(HwvtepSouthboundConstants.HWVTEP_TOPOLOGY_ID.getValue());
builder.setNodeId(HwvtepSouthboundUtils.createManagedNodeId(new NodeId(hwvtepId), psName).getValue());
builder.setIpAddress(tunnelIp);
try {
Future<RpcResult<Void>> result = itmRpcService.deleteL2GwDevice(builder.build());
RpcResult<Void> rpcResult = result.get();
if (rpcResult.isSuccessful()) {
LOG.info("Deleted ITM tunnels for {}", hwvtepId);
} else {
LOG.error("Failed to delete ITM Tunnels: ", rpcResult.getErrors());
}
} catch (InterruptedException | ExecutionException e) {
LOG.error("RPC to delete ITM tunnels failed", e);
}
}
示例6: buildManagersForHANode
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; //导入依赖的package包/类
/**
* Transform child managers (Source) to HA managers using HA node path.
*
* @param childNode Child Node
* @param haGlobalCfg HA global config node
* @return Transformed managers
*/
public static List<Managers> buildManagersForHANode(Node childNode, Optional<Node> haGlobalCfg) {
Set<NodeId> nodeIds = new HashSet<>();
nodeIds.add(childNode.getNodeId());
List<NodeId> childNodeIds = getChildNodeIdsFromManagerOtherConfig(haGlobalCfg);
nodeIds.addAll(childNodeIds);
ManagersBuilder builder1 = new ManagersBuilder();
builder1.setKey(new ManagersKey(new Uri(MANAGER_KEY)));
List<ManagerOtherConfigs> otherConfigses = new ArrayList<>();
StringBuffer stringBuffer = new StringBuffer();
for (NodeId nodeId : nodeIds) {
stringBuffer.append(nodeId.getValue());
stringBuffer.append(",");
}
String children = stringBuffer.substring(0, stringBuffer.toString().length() - 1);
otherConfigses.add(getOtherConfigBuilder(HA_CHILDREN, children).build());
builder1.setManagerOtherConfigs(otherConfigses);
List<Managers> managers = new ArrayList<>();
managers.add(builder1.build());
return managers;
}
示例7: deleteItmTunnels
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; //导入依赖的package包/类
public static void deleteItmTunnels(ItmRpcService itmRpcService, String hwvtepId, String psName,
IpAddress tunnelIp) {
DeleteL2GwDeviceInputBuilder builder = new DeleteL2GwDeviceInputBuilder();
builder.setTopologyId(HwvtepSouthboundConstants.HWVTEP_TOPOLOGY_ID.getValue());
builder.setNodeId(HwvtepSouthboundUtils.createManagedNodeId(new NodeId(hwvtepId), psName).getValue());
builder.setIpAddress(tunnelIp);
try {
Future<RpcResult<Void>> result = itmRpcService.deleteL2GwDevice(builder.build());
RpcResult<Void> rpcResult = result.get();
if (rpcResult.isSuccessful()) {
LOG.info("Deleted ITM tunnels for {}", hwvtepId);
} else {
LOG.error("Failed to delete ITM Tunnels: {}", rpcResult.getErrors());
}
} catch (InterruptedException | ExecutionException e) {
LOG.error("RPC to delete ITM tunnels failed", e);
}
}
示例8: putRemoteMcastMac
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; //导入依赖的package包/类
/**
* Put remote mcast mac in config DS.
*
* @param transaction
* the transaction
* @param nodeId
* the node id
* @param logicalSwitchName
* the logical switch name
* @param tepIps
* the tep ips
*/
private static void putRemoteMcastMac(WriteTransaction transaction, NodeId nodeId, String logicalSwitchName,
ArrayList<IpAddress> tepIps) {
List<LocatorSet> locators = new ArrayList<>();
for (IpAddress tepIp : tepIps) {
HwvtepPhysicalLocatorAugmentation phyLocatorAug = HwvtepSouthboundUtils
.createHwvtepPhysicalLocatorAugmentation(String.valueOf(tepIp.getValue()));
HwvtepPhysicalLocatorRef phyLocRef = new HwvtepPhysicalLocatorRef(
HwvtepSouthboundUtils.createPhysicalLocatorInstanceIdentifier(nodeId, phyLocatorAug));
locators.add(new LocatorSetBuilder().setLocatorRef(phyLocRef).build());
}
HwvtepLogicalSwitchRef lsRef = new HwvtepLogicalSwitchRef(HwvtepSouthboundUtils
.createLogicalSwitchesInstanceIdentifier(nodeId, new HwvtepNodeName(logicalSwitchName)));
RemoteMcastMacs remoteMcastMac = new RemoteMcastMacsBuilder()
.setMacEntryKey(new MacAddress(ElanConstants.UNKNOWN_DMAC)).setLogicalSwitchRef(lsRef)
.setLocatorSet(locators).build();
InstanceIdentifier<RemoteMcastMacs> iid = HwvtepSouthboundUtils.createRemoteMcastMacsInstanceIdentifier(nodeId,
remoteMcastMac.getKey());
ResourceBatchingManager.getInstance().put(ResourceBatchingManager.ShardResource.CONFIG_TOPOLOGY,
iid, remoteMcastMac);
}
示例9: getTepIpOfDesignatedSwitchForExternalTunnel
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; //导入依赖的package包/类
/**
* Gets the tep ip of designated switch for external tunnel.
*
* @param l2GwDevice
* the l2 gw device
* @param elanInstanceName
* the elan instance name
* @return the tep ip of designated switch for external tunnel
*/
public IpAddress getTepIpOfDesignatedSwitchForExternalTunnel(L2GatewayDevice l2GwDevice,
String elanInstanceName) {
IpAddress tepIp = null;
if (l2GwDevice.getTunnelIp() == null) {
LOG.warn("Tunnel IP not found for {}", l2GwDevice.getDeviceName());
return tepIp;
}
DesignatedSwitchForTunnel desgSwitch = getDesignatedSwitchForExternalTunnel(l2GwDevice.getTunnelIp(),
elanInstanceName);
if (desgSwitch != null) {
tepIp = elanItmUtils.getSourceDpnTepIp(BigInteger.valueOf(desgSwitch.getDpId()),
new NodeId(l2GwDevice.getHwvtepNodeId()));
}
return tepIp;
}
示例10: checkIfPhyLocatorAlreadyExistsInRemoteMcastEntry
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; //导入依赖的package包/类
/**
* Check if phy locator already exists in remote mcast entry.
*
* @param nodeId
* the node id
* @param remoteMcastMac
* the remote mcast mac
* @param expectedPhyLocatorIp
* the expected phy locator ip
* @return true, if successful
*/
public static boolean checkIfPhyLocatorAlreadyExistsInRemoteMcastEntry(NodeId nodeId,
RemoteMcastMacs remoteMcastMac, IpAddress expectedPhyLocatorIp) {
if (remoteMcastMac != null) {
HwvtepPhysicalLocatorAugmentation expectedPhyLocatorAug = HwvtepSouthboundUtils
.createHwvtepPhysicalLocatorAugmentation(String.valueOf(expectedPhyLocatorIp.getValue()));
HwvtepPhysicalLocatorRef expectedPhyLocRef = new HwvtepPhysicalLocatorRef(
HwvtepSouthboundUtils.createPhysicalLocatorInstanceIdentifier(nodeId, expectedPhyLocatorAug));
if (remoteMcastMac.getLocatorSet() != null) {
for (LocatorSet locatorSet : remoteMcastMac.getLocatorSet()) {
if (locatorSet.getLocatorRef().equals(expectedPhyLocRef)) {
LOG.trace("matched phyLocRef: {}", expectedPhyLocRef);
return true;
}
}
}
}
return false;
}
示例11: getRemoteUcastMacs
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; //导入依赖的package包/类
/**
* Gets the remote ucast macs from hwvtep node filtering based on logical
* switch.
*
* @param hwvtepNodeId
* the hwvtep node id
* @param logicalSwitch
* the logical switch
* @param datastoreType
* the datastore type
* @return the remote ucast macs
*/
public List<MacAddress> getRemoteUcastMacs(NodeId hwvtepNodeId, String logicalSwitch,
LogicalDatastoreType datastoreType) {
List<MacAddress> lstMacs = Collections.emptyList();
Node hwvtepNode = HwvtepUtils.getHwVtepNode(broker, datastoreType, hwvtepNodeId);
if (hwvtepNode != null) {
List<RemoteUcastMacs> remoteUcastMacs = hwvtepNode.getAugmentation(HwvtepGlobalAugmentation.class)
.getRemoteUcastMacs();
if (remoteUcastMacs != null && !remoteUcastMacs.isEmpty()) {
// Filtering remoteUcastMacs based on the logical switch and
// forming a list of MacAddress
lstMacs = remoteUcastMacs.stream()
.filter(mac -> logicalSwitch.equals(mac.getLogicalSwitchRef().getValue()
.firstKeyOf(LogicalSwitches.class).getHwvtepNodeName().getValue()))
.map(HwvtepMacTableGenericAttributes::getMacEntryKey).collect(Collectors.toList());
}
}
return lstMacs;
}
示例12: installElanMacsInL2GatewayDevice
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; //导入依赖的package包/类
/**
* Install ELAN macs in L2 Gateway device.<br>
* This includes installing ELAN mac table entries plus external device
* UcastLocalMacs which are part of the same ELAN.
*
* @param elanName
* the elan name
* @param l2GatewayDevice
* the l2 gateway device which has to be configured
* @return the listenable future
*/
public ListenableFuture<Void> installElanMacsInL2GatewayDevice(String elanName,
L2GatewayDevice l2GatewayDevice) {
String logicalSwitchName = getLogicalSwitchFromElan(elanName);
NodeId hwVtepNodeId = new NodeId(l2GatewayDevice.getHwvtepNodeId());
List<RemoteUcastMacs> lstL2GatewayDevicesMacs = getOtherDevicesMacs(elanName, l2GatewayDevice, hwVtepNodeId,
logicalSwitchName);
List<RemoteUcastMacs> lstElanMacTableEntries = getElanMacTableEntriesMacs(elanName, l2GatewayDevice,
hwVtepNodeId, logicalSwitchName);
List<RemoteUcastMacs> lstRemoteUcastMacs = new ArrayList<>(lstL2GatewayDevicesMacs);
lstRemoteUcastMacs.addAll(lstElanMacTableEntries);
ListenableFuture<Void> future = HwvtepUtils.addRemoteUcastMacs(broker, hwVtepNodeId, lstRemoteUcastMacs);
LOG.info("Added RemoteUcastMacs entries [{}] in config DS. NodeID: {}, LogicalSwitch: {}",
lstRemoteUcastMacs.size(), hwVtepNodeId.getValue(), logicalSwitchName);
return future;
}
示例13: createItmTunnels
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; //导入依赖的package包/类
public static void createItmTunnels(ItmRpcService itmRpcService, String hwvtepId, String psName,
IpAddress tunnelIp) {
AddL2GwDeviceInputBuilder builder = new AddL2GwDeviceInputBuilder();
builder.setTopologyId(HwvtepSouthboundConstants.HWVTEP_TOPOLOGY_ID.getValue());
builder.setNodeId(HwvtepSouthboundUtils.createManagedNodeId(new NodeId(hwvtepId), psName).getValue());
builder.setIpAddress(tunnelIp);
try {
Future<RpcResult<Void>> result = itmRpcService.addL2GwDevice(builder.build());
RpcResult<Void> rpcResult = result.get();
if (rpcResult.isSuccessful()) {
LOG.info("Created ITM tunnels for {}", hwvtepId);
} else {
LOG.error("Failed to create ITM Tunnels: ", rpcResult.getErrors());
}
} catch (InterruptedException | ExecutionException e) {
LOG.error("RPC to create ITM tunnels failed", e);
}
}
示例14: scheduleDeleteLogicalSwitch
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; //导入依赖的package包/类
public void scheduleDeleteLogicalSwitch(final NodeId hwvtepNodeId, final String lsName) {
final Pair<NodeId, String> nodeIdLogicalSwitchNamePair = new ImmutablePair<>(hwvtepNodeId, lsName);
if (logicalSwitchDeletedTasks.containsKey(nodeIdLogicalSwitchNamePair)) {
return;
}
TimerTask logicalSwitchDeleteTask = new TimerTask() {
@Override
public void run() {
DeleteLogicalSwitchJob deleteLsJob = new DeleteLogicalSwitchJob(broker,
ElanL2GatewayUtils.this, hwvtepNodeId, lsName);
jobCoordinator.enqueueJob(deleteLsJob.getJobKey(), deleteLsJob,
SystemPropertyReader.getDataStoreJobCoordinatorMaxRetries());
deleteJobs.put(nodeIdLogicalSwitchNamePair, deleteLsJob);
logicalSwitchDeletedTasks.remove(nodeIdLogicalSwitchNamePair);
}
};
if (logicalSwitchDeletedTasks.putIfAbsent(nodeIdLogicalSwitchNamePair, logicalSwitchDeleteTask) == null) {
logicalSwitchDeleteJobTimer.schedule(logicalSwitchDeleteTask, LOGICAL_SWITCH_DELETE_DELAY);
}
}
示例15: DisAssociateHwvtepFromElanJob
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; //导入依赖的package包/类
public DisAssociateHwvtepFromElanJob(ElanL2GatewayUtils elanL2GatewayUtils,
ElanL2GatewayMulticastUtils elanL2GatewayMulticastUtils,
@Nullable L2GatewayDevice l2GatewayDevice, String elanName,
Supplier<ElanInstance> elanInstanceSupplier, Devices l2Device,
Integer defaultVlan, String nodeId, boolean isLastL2GwConnDeleted) {
this.elanL2GatewayUtils = elanL2GatewayUtils;
this.elanL2GatewayMulticastUtils = elanL2GatewayMulticastUtils;
this.l2GatewayDevice = l2GatewayDevice;
this.elanName = elanName;
this.elanInstanceSupplier = elanInstanceSupplier;
this.l2Device = l2Device;
this.defaultVlan = defaultVlan;
this.isLastL2GwConnDeleted = isLastL2GwConnDeleted;
this.hwvtepNodeId = new NodeId(nodeId);
LOG.info("created disassociate l2gw connection job for {}", elanName);
}