本文整理汇总了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类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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));
}
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:15,代码来源:EventSourceTopologyTest.java
示例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();
}
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:24,代码来源:EventSourceTopicTest.java
示例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);
}
开发者ID:opendaylight,项目名称:netvirt,代码行数:22,代码来源:DhcpUCastMacListener.java
示例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);
}
}
开发者ID:opendaylight,项目名称:netvirt,代码行数:19,代码来源:L2GatewayUtils.java
示例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);
}
}
开发者ID:opendaylight,项目名称:netvirt,代码行数:19,代码来源:L2GatewayUtils.java
示例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;
}
开发者ID:opendaylight,项目名称:netvirt,代码行数:33,代码来源:HwvtepHAUtil.java
示例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);
}
}
开发者ID:opendaylight,项目名称:netvirt,代码行数:19,代码来源:L2GatewayUtils.java
示例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);
}
开发者ID:opendaylight,项目名称:netvirt,代码行数:35,代码来源:ElanL2GatewayMulticastUtils.java
示例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;
}
开发者ID:opendaylight,项目名称:netvirt,代码行数:25,代码来源:ElanL2GatewayMulticastUtils.java
示例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;
}
开发者ID:opendaylight,项目名称:netvirt,代码行数:30,代码来源:ElanL2GatewayUtils.java
示例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;
}
开发者ID:opendaylight,项目名称:netvirt,代码行数:31,代码来源:ElanL2GatewayUtils.java
示例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;
}
开发者ID:opendaylight,项目名称:netvirt,代码行数:31,代码来源:ElanL2GatewayUtils.java
示例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);
}
}
开发者ID:opendaylight,项目名称:netvirt,代码行数:19,代码来源:ElanL2GatewayUtils.java
示例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);
}
}
开发者ID:opendaylight,项目名称:netvirt,代码行数:22,代码来源:ElanL2GatewayUtils.java
示例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);
}
开发者ID:opendaylight,项目名称:netvirt,代码行数:17,代码来源:DisAssociateHwvtepFromElanJob.java
示例16: call
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; //导入依赖的package包/类
@Override
public List<ListenableFuture<Void>> call() {
LOG.debug("Deleting l2gw device [{}] macs from other l2gw devices for elan [{}]",
this.l2GwDevice.getHwvtepNodeId(), this.elanName);
final String logicalSwitchName = ElanL2GatewayUtils.getLogicalSwitchFromElan(this.elanName);
List<MacAddress> macs = new ArrayList<>();
macAddresses.forEach((mac) -> macs.add(new MacAddress(mac.getValue().toLowerCase())));
ConcurrentMap<String, L2GatewayDevice> elanL2GwDevices = ElanL2GwCacheUtils
.getInvolvedL2GwDevices(this.elanName);
for (L2GatewayDevice otherDevice : elanL2GwDevices.values()) {
if (!otherDevice.getHwvtepNodeId().equals(this.l2GwDevice.getHwvtepNodeId())
&& !ElanL2GatewayUtils.areMLAGDevices(this.l2GwDevice, otherDevice)) {
final String hwvtepId = otherDevice.getHwvtepNodeId();
//This delete is batched using resourcebatchingmnagaer
deleteRemoteUcastMacs(new NodeId(hwvtepId), logicalSwitchName, macs);
// TODO: why to create a new arraylist for uninstallFuture?
}
}
return Collections.emptyList();
}
开发者ID:opendaylight,项目名称:netvirt,代码行数:23,代码来源:DeleteL2GwDeviceMacsFromElanJob.java
示例17: call
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; //导入依赖的package包/类
@Override
public List<ListenableFuture<Void>> call() throws Exception {
elanL2GatewayUtils.cancelDeleteLogicalSwitch(new NodeId(elanL2GwDevice.getHwvtepNodeId()), logicalSwitchName);
LOG.debug("running logical switch added job for {} {}", logicalSwitchName,
elanL2GwDevice.getHwvtepNodeId());
List<ListenableFuture<Void>> futures = new ArrayList<>();
LOG.info("creating vlan bindings for {} {}", logicalSwitchName, elanL2GwDevice.getHwvtepNodeId());
futures.add(elanL2GatewayUtils.updateVlanBindingsInL2GatewayDevice(
new NodeId(elanL2GwDevice.getHwvtepNodeId()), logicalSwitchName, physicalDevice, defaultVlanId));
LOG.info("creating mast mac entries for {} {}", logicalSwitchName, elanL2GwDevice.getHwvtepNodeId());
futures.add(elanL2GatewayMulticastUtils.handleMcastForElanL2GwDeviceAdd(logicalSwitchName,
elanInstanceSupplier.get(), elanL2GwDevice));
futures.add(elanL2GatewayUtils.installElanMacsInL2GatewayDevice(
logicalSwitchName, elanL2GwDevice));
return futures;
}
开发者ID:opendaylight,项目名称:netvirt,代码行数:18,代码来源:LogicalSwitchAddedJob.java
示例18: call
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; //导入依赖的package包/类
@Override
public List<ListenableFuture<Void>> call() throws Exception {
String hwvtepNodeId = l2GatewayDevice.getHwvtepNodeId();
String elanInstanceName = elanInstance.getElanInstanceName();
LOG.debug("running assosiate l2gw connection job for {} {} ", elanInstanceName, hwvtepNodeId);
elanL2GatewayUtils.cancelDeleteLogicalSwitch(new NodeId(hwvtepNodeId),
ElanL2GatewayUtils.getLogicalSwitchFromElan(elanInstanceName));
// Create Logical Switch if it's not created already in the device
if (createLogicalSwitch) {
LOG.info("creating logical switch {} for {} ", elanInstanceName, hwvtepNodeId);
return Collections.singletonList(createLogicalSwitch());
} else {
createLogicalSwitch();
String logicalSwitchName = ElanL2GatewayUtils.getLogicalSwitchFromElan(elanInstanceName);
LOG.info("{} is already created in {}; adding remaining configurations", logicalSwitchName, hwvtepNodeId);
LogicalSwitchAddedJob logicalSwitchAddedJob =
new LogicalSwitchAddedJob(elanL2GatewayUtils, elanL2GatewayMulticastUtils,
logicalSwitchName, l2Device, l2GatewayDevice, defaultVlan,
() -> elanInstanceManager.getElanInstanceByName(logicalSwitchName));
return logicalSwitchAddedJob.call();
}
}
开发者ID:opendaylight,项目名称:netvirt,代码行数:27,代码来源:AssociateHwvtepToElanJob.java
示例19: removed
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; //导入依赖的package包/类
@Override
protected void removed(InstanceIdentifier<PhysicalSwitchAugmentation> identifier,
PhysicalSwitchAugmentation phySwitchDeleted) {
NodeId nodeId = getNodeId(identifier);
String psName = phySwitchDeleted.getHwvtepNodeName().getValue();
LOG.info("Received physical switch {} removed event for node {}", psName, nodeId.getValue());
L2GatewayDevice l2GwDevice = l2GatewayCache.get(psName);
if (l2GwDevice != null) {
if (!L2GatewayConnectionUtils.isGatewayAssociatedToL2Device(l2GwDevice)) {
l2GatewayCache.remove(psName);
LOG.debug("{} details removed from L2Gateway Cache", psName);
MDSALUtil.syncDelete(this.dataBroker, LogicalDatastoreType.CONFIGURATION,
HwvtepSouthboundUtils.createInstanceIdentifier(nodeId));
} else {
LOG.debug("{} details are not removed from L2Gateway Cache as it has L2Gateway reference", psName);
}
l2GwDevice.setConnected(false);
//ElanL2GwCacheUtils.removeL2GatewayDeviceFromAllElanCache(psName);
} else {
LOG.error("Unable to find L2 Gateway details for {}", psName);
}
}
开发者ID:opendaylight,项目名称:netvirt,代码行数:25,代码来源:HwvtepPhysicalSwitchListener.java
示例20: handlePortAdded
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; //导入依赖的package包/类
private List<ListenableFuture<Void>> handlePortAdded(HwvtepPhysicalPortAugmentation portAugmentation,
TerminationPoint portAdded, NodeId psNodeId) {
Node psNode = HwvtepUtils.getHwVtepNode(broker, LogicalDatastoreType.OPERATIONAL, psNodeId);
if (psNode != null) {
String psName = psNode.getAugmentation(PhysicalSwitchAugmentation.class).getHwvtepNodeName().getValue();
L2GatewayDevice l2GwDevice = l2GatewayCache.get(psName);
if (l2GwDevice != null) {
if (isL2GatewayConfigured(l2GwDevice)) {
List<L2gatewayConnection> l2GwConns = L2GatewayConnectionUtils.getAssociatedL2GwConnections(broker,
l2GwDevice.getL2GatewayIds());
String newPortId = portAdded.getTpId().getValue();
NodeId hwvtepNodeId = new NodeId(l2GwDevice.getHwvtepNodeId());
List<VlanBindings> vlanBindings = getVlanBindings(l2GwConns, hwvtepNodeId, psName, newPortId);
return Collections.singletonList(
elanL2GatewayUtils.updateVlanBindingsInL2GatewayDevice(hwvtepNodeId, psName, newPortId,
vlanBindings));
}
} else {
LOG.error("{} details are not present in L2Gateway Cache", psName);
}
} else {
LOG.error("{} entry not in config datastore", psNodeId);
}
return Collections.emptyList();
}
开发者ID:opendaylight,项目名称:netvirt,代码行数:26,代码来源:HwvtepTerminationPointListener.java
注:本文中的org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论