本文整理汇总了Java中org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node.getAugmentation方法的典型用法代码示例。如果您正苦于以下问题:Java Node.getAugmentation方法的具体用法?Java Node.getAugmentation怎么用?Java Node.getAugmentation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node
的用法示例。
在下文中一共展示了Node.getAugmentation方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getOpenvswitchOtherConfig
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node; //导入方法依赖的package包/类
private String getOpenvswitchOtherConfig(Node node, String key) {
OvsdbNodeAugmentation ovsdbNode = node.getAugmentation(OvsdbNodeAugmentation.class);
if (ovsdbNode == null) {
Optional<Node> nodeFromReadOvsdbNode = readOvsdbNode(node);
if (nodeFromReadOvsdbNode.isPresent()) {
ovsdbNode = nodeFromReadOvsdbNode.get().getAugmentation(OvsdbNodeAugmentation.class);
}
}
if (ovsdbNode != null && ovsdbNode.getOpenvswitchOtherConfigs() != null) {
for (OpenvswitchOtherConfigs openvswitchOtherConfigs : ovsdbNode.getOpenvswitchOtherConfigs()) {
if (openvswitchOtherConfigs.getOtherConfigKey().equals(key)) {
return openvswitchOtherConfigs.getOtherConfigValue();
}
}
}
return null;
}
示例2: deleteChildPSConfigIfHAPSConfigIsMissing
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node; //导入方法依赖的package包/类
private void deleteChildPSConfigIfHAPSConfigIsMissing(Optional<Node> haPSCfg,
Node childNode,
ReadWriteTransaction tx) throws ReadFailedException {
if (haPSCfg.isPresent()) {
return;
}
LOG.info("HA ps node not present cleanup child {}" , childNode);
HwvtepGlobalAugmentation augmentation = childNode.getAugmentation(HwvtepGlobalAugmentation.class);
if (augmentation != null) {
List<Switches> switches = augmentation.getSwitches();
if (switches != null) {
for (Switches ps : switches) {
HwvtepHAUtil.deleteNodeIfPresent(tx, CONFIGURATION, ps.getSwitchRef().getValue());
}
}
} else {
LOG.info("Global augumentation not present for connected ha child node {}" , childNode);
}
}
示例3: readAndCopyChildPSOpToHAPS
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node; //导入方法依赖的package包/类
/**
* Merge data of child PS node to HA ps node .
*
* @param childGlobalNode Ha Global Child node
* @param haNodePath Ha node path
* @param tx Transaction
* @throws ReadFailedException Exception thrown if read fails
* @throws ExecutionException Exception thrown if Execution fail
* @throws InterruptedException Thread interrupted Exception
*/
void readAndCopyChildPSOpToHAPS(Node childGlobalNode,
InstanceIdentifier<Node> haNodePath,
ReadWriteTransaction tx)
throws ReadFailedException, ExecutionException, InterruptedException {
if (childGlobalNode == null || childGlobalNode.getAugmentation(HwvtepGlobalAugmentation.class) == null) {
return;
}
List<Switches> switches = childGlobalNode.getAugmentation(HwvtepGlobalAugmentation.class).getSwitches();
if (switches == null) {
return;
}
for (Switches ps : switches) {
Node childPsNode = HwvtepHAUtil.readNode(tx, OPERATIONAL,
(InstanceIdentifier<Node>) ps.getSwitchRef().getValue());
if (childPsNode != null) {
InstanceIdentifier<Node> haPsPath = HwvtepHAUtil.convertPsPath(childPsNode, haNodePath);
copyChildPSOpToHAPS(childPsNode, haNodePath, haPsPath, tx);
}
}
}
示例4: copyHANodeConfigToChild
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node; //导入方法依赖的package包/类
/**
* Copy HA global node data to Child HA node of config data tree .
*
* @param srcNode Node which to be transformed
* @param childPath Path to which source node will be transformed
* @param tx Transaction
* @throws ReadFailedException Exception thrown if read fails
* @throws ExecutionException Exception thrown if Execution fail
* @throws InterruptedException Thread interrupted Exception
*/
private void copyHANodeConfigToChild(Node srcNode,
InstanceIdentifier<Node> childPath,
ReadWriteTransaction tx)
throws ReadFailedException, ExecutionException, InterruptedException {
if (srcNode == null) {
return;
}
HwvtepGlobalAugmentation src = srcNode.getAugmentation(HwvtepGlobalAugmentation.class);
if (src == null) {
return;
}
NodeBuilder nodeBuilder = HwvtepHAUtil.getNodeBuilderForPath(childPath);
HwvtepGlobalAugmentationBuilder dstBuilder = new HwvtepGlobalAugmentationBuilder();
globalAugmentationMerger.mergeConfigData(dstBuilder, src, childPath);
globalNodeMerger.mergeConfigData(nodeBuilder, srcNode, childPath);
nodeBuilder.addAugmentation(HwvtepGlobalAugmentation.class, dstBuilder.build());
Node dstNode = nodeBuilder.build();
tx.put(CONFIGURATION, childPath, dstNode, WriteTransaction.CREATE_MISSING_PARENTS);
}
示例5: compareLocalUcastMacs
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node; //导入方法依赖的package包/类
public static void compareLocalUcastMacs(Node d1, Node d2, Node ha, InstanceIdentifier<Node> nodePath) {
LocalUcastCmd cmd = new LocalUcastCmd();
HwvtepGlobalAugmentation d1Aug = d1.getAugmentation(HwvtepGlobalAugmentation.class);
HwvtepGlobalAugmentation d2Aug = d2.getAugmentation(HwvtepGlobalAugmentation.class);
HwvtepGlobalAugmentation haAug = ha.getAugmentation(HwvtepGlobalAugmentation.class);
List<LocalUcastMacs> d1Values =
d1Aug.getLocalUcastMacs() != null ? d1Aug.getLocalUcastMacs() : new ArrayList<>();
List<LocalUcastMacs> result1 = cmd.transform(nodePath, d1Values);
List<LocalUcastMacs> d2Values =
d2Aug.getLocalUcastMacs() != null ? d2Aug.getLocalUcastMacs() : new ArrayList<>();
List<LocalUcastMacs> result2 = cmd.transform(nodePath, d2Values);
List<LocalUcastMacs> result = cmd.transform(nodePath, haAug.getLocalUcastMacs());
List<LocalUcastMacs> luMacList = new ArrayList<>();
luMacList.addAll(result1);
luMacList.addAll(result2);
Set<LocalUcastMacs> set1 = Sets.newHashSet(luMacList);
Set<LocalUcastMacs> set2 = Sets.newHashSet(result);
assertEquals("should have equal Local ucast macs ", 0, Sets.symmetricDifference(set1, set2).size());
}
示例6: compareLogicalSwitches
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node; //导入方法依赖的package包/类
public static void compareLogicalSwitches(Node d1, Node d2, Node ha, InstanceIdentifier<Node> nodePath) {
LogicalSwitchesCmd cmd = new LogicalSwitchesCmd();
HwvtepGlobalAugmentation d1Aug = d1.getAugmentation(HwvtepGlobalAugmentation.class);
HwvtepGlobalAugmentation d2Aug = d2.getAugmentation(HwvtepGlobalAugmentation.class);
HwvtepGlobalAugmentation haAug = ha.getAugmentation(HwvtepGlobalAugmentation.class);
List<LogicalSwitches> d1Values =
d1Aug.getLogicalSwitches() != null ? d1Aug.getLogicalSwitches() : new ArrayList<>();
List<LogicalSwitches> result1 = cmd.transform(nodePath, d1Values);
List<LogicalSwitches> d2Values =
d2Aug.getLogicalSwitches() != null ? d2Aug.getLogicalSwitches() : new ArrayList<>();
List<LogicalSwitches> result2 = cmd.transform(nodePath, d2Values);
//Merge data of both d1 and d2 logical switch info should be same as ha
Set<LogicalSwitches> set1 = new HashSet<>();
set1.addAll(result1);
set1.addAll(result2);
List<LogicalSwitches> result = cmd.transform(nodePath, haAug.getLogicalSwitches());
Set<LogicalSwitches> set2 = Sets.newHashSet(result);
assertEquals("should have equal logical switches", 0, Sets.symmetricDifference(set1, set2).size());
}
示例7: deleteSwitchesManagedByNode
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node; //导入方法依赖的package包/类
/**
* Delete switches from Node in Operational Data Tree .
*
* @param haPath HA node path from whih switches will be deleted
* @param tx Transaction object
* @throws ReadFailedException Exception thrown if read fails
* @throws ExecutionException Exception thrown if Execution fail
* @throws InterruptedException Thread interrupted Exception
*/
public static void deleteSwitchesManagedByNode(InstanceIdentifier<Node> haPath,
ReadWriteTransaction tx)
throws InterruptedException, ExecutionException, ReadFailedException {
Optional<Node> nodeOptional = tx.read(OPERATIONAL, haPath).checkedGet();
if (!nodeOptional.isPresent()) {
return;
}
Node node = nodeOptional.get();
HwvtepGlobalAugmentation globalAugmentation = node.getAugmentation(HwvtepGlobalAugmentation.class);
if (globalAugmentation == null) {
return;
}
List<Switches> switches = globalAugmentation.getSwitches();
if (switches != null) {
for (Switches switche : switches) {
InstanceIdentifier<Node> id = (InstanceIdentifier<Node>)switche.getSwitchRef().getValue();
deleteNodeIfPresent(tx, OPERATIONAL, id);
}
}
}
示例8: compareLocalMcastMacs
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node; //导入方法依赖的package包/类
public static void compareLocalMcastMacs(Node d1, Node d2, Node ha, InstanceIdentifier<Node> nodePath) {
LocalMcastCmd cmd = new LocalMcastCmd();
HwvtepGlobalAugmentation d1Aug = d1.getAugmentation(HwvtepGlobalAugmentation.class);
HwvtepGlobalAugmentation d2Aug = d2.getAugmentation(HwvtepGlobalAugmentation.class);
HwvtepGlobalAugmentation haAug = ha.getAugmentation(HwvtepGlobalAugmentation.class);
List<LocalMcastMacs> d1Values =
d1Aug.getLocalUcastMacs() != null ? d1Aug.getLocalMcastMacs() : new ArrayList<>();
List<LocalMcastMacs> result1 = cmd.transform(nodePath, d1Values);
List<LocalMcastMacs> d2Values =
d2Aug.getLocalUcastMacs() != null ? d2Aug.getLocalMcastMacs() : new ArrayList<>();
List<LocalMcastMacs> result2 = cmd.transform(nodePath, d2Values);
List<LocalMcastMacs> result = cmd.transform(nodePath, haAug.getLocalMcastMacs());
List<LocalMcastMacs> lmMacList = new ArrayList<>();
lmMacList.addAll(result1);
lmMacList.addAll(result2);
Set<LocalMcastMacs> set1 = Sets.newHashSet(lmMacList);
Set<LocalMcastMacs> set2 = Sets.newHashSet(result);
assertEquals("should have equal Local Mcast macs ", 0, Sets.symmetricDifference(set1, set2).size());
}
示例9: printLocalUcastMacs
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node; //导入方法依赖的package包/类
@SuppressWarnings("checkstyle:HiddenField")
void printLocalUcastMacs(Node hwvtepNode, String elanName) {
session.getConsole().println("LocalUCast macs :");
session.getConsole().println(HEADINGUCAST);
if (hwvtepNode == null || hwvtepNode.getAugmentation(HwvtepGlobalAugmentation.class) == null) {
return;
}
List<LocalUcastMacs> localUcastMacs =
hwvtepNode.getAugmentation(HwvtepGlobalAugmentation.class).getLocalUcastMacs();
if (localUcastMacs == null || localUcastMacs.isEmpty()) {
return;
}
for (LocalUcastMacs localMac : localUcastMacs) {
String lsFromLocalMac = getLogicalSwitchValue(localMac.getLogicalSwitchRef());
if (elanName.equals(lsFromLocalMac)) {
String mac = localMac.getMacEntryKey().getValue();
String locator = getLocatorValue(localMac.getLocatorRef());
session.getConsole().println(mac + GAP + locator);
}
}
}
示例10: copyChildOpToHA
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node; //导入方法依赖的package包/类
/**
* Copy HA child node to HA node of Operational data tree.
*
* @param childNode HA Child Node
* @param haNodePath HA node path
* @param tx Transaction
* @throws ReadFailedException Exception thrown if read fails
* @throws ExecutionException Exception thrown if Execution fail
* @throws InterruptedException Thread interrupted Exception
*/
private void copyChildOpToHA(Node childNode,
InstanceIdentifier<Node> haNodePath,
ReadWriteTransaction tx)
throws ReadFailedException, ExecutionException, InterruptedException {
if (childNode == null) {
return;
}
HwvtepGlobalAugmentation childData = childNode.getAugmentation(HwvtepGlobalAugmentation.class);
if (childData == null) {
return;
}
NodeBuilder haNodeBuilder = HwvtepHAUtil.getNodeBuilderForPath(haNodePath);
HwvtepGlobalAugmentationBuilder haBuilder = new HwvtepGlobalAugmentationBuilder();
Optional<Node> existingHANodeOptional = tx.read(OPERATIONAL, haNodePath).checkedGet();
Node existingHANode = existingHANodeOptional.isPresent() ? existingHANodeOptional.get() : null;
HwvtepGlobalAugmentation existingHAData = HwvtepHAUtil.getGlobalAugmentationOfNode(existingHANode);
globalAugmentationMerger.mergeOperationalData(haBuilder, existingHAData, childData, haNodePath);
globalNodeMerger.mergeOperationalData(haNodeBuilder, existingHANode, childNode, haNodePath);
haBuilder.setManagers(HwvtepHAUtil.buildManagersForHANode(childNode, existingHANodeOptional));
haBuilder.setSwitches(HwvtepHAUtil.buildSwitchesForHANode(childNode, haNodePath, existingHANodeOptional));
haNodeBuilder.addAugmentation(HwvtepGlobalAugmentation.class, haBuilder.build());
Node haNode = haNodeBuilder.build();
tx.merge(OPERATIONAL, haNodePath, haNode, true);
}
示例11: comparePhysicalSwitches
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node; //导入方法依赖的package包/类
public static void comparePhysicalSwitches(Node d1ps, Node d2ps, Node haps, InstanceIdentifier<Node> d1psnodePath,
InstanceIdentifier<Node> d2psnodePath,
InstanceIdentifier<Node> haPsnodePath,
ReadWriteTransaction readWriteTransaction, String switchName,
Node d1, Node d2, Node ha) throws ReadFailedException {
PhysicalSwitchAugmentation d1PsAug = d1ps.getAugmentation(PhysicalSwitchAugmentation.class);
PhysicalSwitchAugmentation d2PsAug = d2ps.getAugmentation(PhysicalSwitchAugmentation.class);
PhysicalSwitchAugmentation haPsAug = haps.getAugmentation(PhysicalSwitchAugmentation.class);
HwvtepGlobalRef managerd1Ps = d1PsAug.getManagedBy();
assertEquals("Hwvtep node name should be same", d1PsAug.getHwvtepNodeName().getValue(),
haPsAug.getHwvtepNodeName().getValue());
assertEquals("Managers should be equal for d1 ", d1ps.getNodeId().getValue(),
managerd1Ps.getValue().firstKeyOf(Node.class).getNodeId().getValue() + "/physicalswitch/" + switchName);
HwvtepGlobalRef managerd2Ps = d2PsAug.getManagedBy();
assertEquals("Hwvtep node name should be same", d2PsAug.getHwvtepNodeName().getValue(),
haPsAug.getHwvtepNodeName().getValue());
assertEquals("Managers should be equal for d2 ", d2ps.getNodeId().getValue(),
managerd2Ps.getValue().firstKeyOf(Node.class).getNodeId().getValue() + "/physicalswitch/" + switchName);
HwvtepGlobalRef managerhaPs = haPsAug.getManagedBy();
assertEquals("Managers should be equal for ha ", haps.getNodeId().getValue(),
managerhaPs.getValue().firstKeyOf(Node.class).getNodeId().getValue() + "/physicalswitch/" + switchName);
assertEquals("Should have equal number TunnelIps",
d1PsAug.getTunnelIps().size(), haPsAug.getTunnelIps().size());
assertEquals("Should have equal number TunnelIps",
d2PsAug.getTunnelIps().size(), haPsAug.getTunnelIps().size());
if (d1PsAug.getTunnelIps().size() == haPsAug.getTunnelIps().size()
&& d2PsAug.getTunnelIps().size() == haPsAug.getTunnelIps().size()) {
assertTrue(d1PsAug.getTunnelIps().containsAll(haPsAug.getTunnelIps()));
assertTrue(d2PsAug.getTunnelIps().containsAll(haPsAug.getTunnelIps()));
}
//Compare Termination point
assertTerminationPoint(DataProvider.getPortNameListD1(),
d1psnodePath, haPsnodePath, readWriteTransaction, d1, ha);
assertTerminationPoint(DataProvider.getPortNameListD2(),
d2psnodePath, haPsnodePath, readWriteTransaction, d2, ha);
}
示例12: mergeManagedByNode
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node; //导入方法依赖的package包/类
public static void mergeManagedByNode(Node psNode,
PhysicalSwitchAugmentationBuilder builder,
InstanceIdentifier<Node> haNodePath,
InstanceIdentifier<Node> haPsPath, NodeId haPSNodeId) {
PhysicalSwitchAugmentation psAugmentation = psNode.getAugmentation(PhysicalSwitchAugmentation.class);
builder.setManagedBy(new HwvtepGlobalRef(haNodePath));
builder.setHwvtepNodeName(psAugmentation.getHwvtepNodeName());
builder.setHwvtepNodeDescription(psAugmentation.getHwvtepNodeDescription());
builder.setTunnelIps(psAugmentation.getTunnelIps());
builder.setPhysicalSwitchUuid(getUUid(psAugmentation.getHwvtepNodeName().getValue()));
}
示例13: containsLogicalSwitch
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node; //导入方法依赖的package包/类
private boolean containsLogicalSwitch(Node node) {
if (node == null || node.getAugmentation(HwvtepGlobalAugmentation.class) == null
|| HwvtepHAUtil.isEmptyList(
node.getAugmentation(HwvtepGlobalAugmentation.class).getLogicalSwitches())) {
return false;
}
return true;
}
示例14: getPSnode
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node; //导入方法依赖的package包/类
Node getPSnode(Node hwvtepNode, LogicalDatastoreType datastoreType) {
if (hwvtepNode.getAugmentation(HwvtepGlobalAugmentation.class) != null
&& hwvtepNode.getAugmentation(HwvtepGlobalAugmentation.class).getSwitches() != null) {
for (Switches switches : hwvtepNode.getAugmentation(HwvtepGlobalAugmentation.class).getSwitches()) {
NodeId psNodeId = switches.getSwitchRef().getValue().firstKeyOf(Node.class).getNodeId();
return HwvtepUtils.getHwVtepNode(dataBroker, datastoreType, psNodeId);
}
}
return null;
}
示例15: getPhysicalSwitchAugmentationOfNode
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node; //导入方法依赖的package包/类
public static PhysicalSwitchAugmentation getPhysicalSwitchAugmentationOfNode(Node psNode) {
PhysicalSwitchAugmentation result = null;
if (psNode != null) {
result = psNode.getAugmentation(PhysicalSwitchAugmentation.class);
}
if (result == null) {
result = new PhysicalSwitchAugmentationBuilder().build();
}
return result;
}