public HwvtepConnectionInstance getConnectionInstance(Node node) {
Preconditions.checkNotNull(node);
- HwvtepGlobalAugmentation hwvtepGlobal = node.getAugmentation(HwvtepGlobalAugmentation.class);
- PhysicalSwitchAugmentation switchNode = node.getAugmentation(PhysicalSwitchAugmentation.class);
+ HwvtepGlobalAugmentation hwvtepGlobal = node.augmentation(HwvtepGlobalAugmentation.class);
+ PhysicalSwitchAugmentation switchNode = node.augmentation(PhysicalSwitchAugmentation.class);
if (hwvtepGlobal != null) {
if (hwvtepGlobal.getConnectionInfo() != null) {
return getConnectionInstance(hwvtepGlobal.getConnectionInfo());
public void onSuccess(@Nonnull Optional<Node> node) {
if (node.isPresent()) {
HwvtepGlobalAugmentation augmentation = node.get()
- .getAugmentation(HwvtepGlobalAugmentation.class);
+ .augmentation(HwvtepGlobalAugmentation.class);
if (augmentation == null || augmentation.getConnectionInfo() == null) {
return;
}
final DataObjectModification<Node> mod = change.getRootNode();
Node node = getCreated(mod);
if (node != null) {
- HwvtepGlobalAugmentation hwvtepGlobal = node.getAugmentation(HwvtepGlobalAugmentation.class);
+ HwvtepGlobalAugmentation hwvtepGlobal = node.augmentation(HwvtepGlobalAugmentation.class);
// We can only connect if user configured connection info
if (hwvtepGlobal != null && hwvtepGlobal.getConnectionInfo() != null) {
ConnectionInfo connection = hwvtepGlobal.getConnectionInfo();
Node updated = getUpdated(mod);
if (updated != null) {
Node original = getOriginal(mod);
- HwvtepGlobalAugmentation hgUpdated = updated.getAugmentation(HwvtepGlobalAugmentation.class);
- HwvtepGlobalAugmentation hgOriginal = original.getAugmentation(HwvtepGlobalAugmentation.class);
+ HwvtepGlobalAugmentation hgUpdated = updated.augmentation(HwvtepGlobalAugmentation.class);
+ HwvtepGlobalAugmentation hgOriginal = original.augmentation(HwvtepGlobalAugmentation.class);
// Check if user has updated connection information
if (hgUpdated != null && hgOriginal != null && hgUpdated.getConnectionInfo() != null
&& !hgUpdated.getConnectionInfo().equals(hgOriginal.getConnectionInfo())) {
final DataObjectModification<Node> mod = change.getRootNode();
Node deleted = getRemoved(mod);
if (deleted != null) {
- HwvtepGlobalAugmentation hgDeleted = deleted.getAugmentation(HwvtepGlobalAugmentation.class);
+ HwvtepGlobalAugmentation hgDeleted = deleted.augmentation(HwvtepGlobalAugmentation.class);
if (hgDeleted != null) {
try {
hcm.disconnect(hgDeleted);
result.get(connection).add(change);
}
} else {
- LOG.warn("Failed to get the connection of changed node: {}", node.getKey().getNodeId().getValue());
+ LOG.warn("Failed to get the connection of changed node: {}", node.key().getNodeId().getValue());
}
}
LOG.trace("Connection Change Map: {}", result);
public static InstanceIdentifier<VlanBindings> createInstanceIdentifier(HwvtepConnectionInstance client,
InstanceIdentifier<TerminationPoint> tpPath, VlanBindings vlanBindings) {
return tpPath.augmentation(HwvtepPhysicalPortAugmentation.class).child(VlanBindings.class,
- new VlanBindingsKey(vlanBindings.getKey()));
+ new VlanBindingsKey(vlanBindings.key()));
}
if (node instanceof HwvtepGlobalAugmentation) {
hwvtepNode = (HwvtepGlobalAugmentation) node;
} else if (node != null) {
- hwvtepNode = node.getAugmentation(HwvtepGlobalAugmentation.class);
+ hwvtepNode = node.augmentation(HwvtepGlobalAugmentation.class);
}
if (hwvtepNode != null) {
return Optional.of(hwvtepNode);
}
public static Integer getRemotePort(Node node) {
- HwvtepGlobalAugmentation augmentation = node.getAugmentation(HwvtepGlobalAugmentation.class);
+ HwvtepGlobalAugmentation augmentation = node.augmentation(HwvtepGlobalAugmentation.class);
if (augmentation != null && augmentation.getConnectionInfo() != null) {
return augmentation.getConnectionInfo().getRemotePort().getValue();
}
NodeBuilder newNodeBuilder = getNodeBuilderFromNode(configNode);
NodeBuilder oldNodeBuilder = getNodeBuilderFromNode(opNode);
- HwvtepGlobalAugmentationBuilder newAugmentation = getAugmentationFromNode(configNode);
- HwvtepGlobalAugmentationBuilder oldAugmentation = getAugmentationFromNode(opNode);
+ HwvtepGlobalAugmentationBuilder newAugmentation = augmentationFromNode(configNode);
+ HwvtepGlobalAugmentationBuilder oldAugmentation = augmentationFromNode(opNode);
//fire removal of local ucast macs so that logical switches will be deleted
fillLocalMacsToBeRemoved(oldAugmentation, configNode, opNode);
}
static List<LocalUcastMacs> getLocalUcastMacsToBeRemoved(Node opNode, final Set<String> removedSwitchNames) {
- if (opNode == null || opNode.getAugmentation(HwvtepGlobalAugmentation.class) == null) {
+ if (opNode == null || opNode.augmentation(HwvtepGlobalAugmentation.class) == null) {
return null;
}
- List<LocalUcastMacs> localUcastMacs = opNode.getAugmentation(HwvtepGlobalAugmentation.class)
+ List<LocalUcastMacs> localUcastMacs = opNode.augmentation(HwvtepGlobalAugmentation.class)
.getLocalUcastMacs();
if (localUcastMacs == null) {
return null;
}
static List<LocalMcastMacs> getLocalMcastMacsToBeRemoved(Node opNode, final Set<String> removedSwitchNames) {
- if (opNode == null || opNode.getAugmentation(HwvtepGlobalAugmentation.class) == null) {
+ if (opNode == null || opNode.augmentation(HwvtepGlobalAugmentation.class) == null) {
return null;
}
- List<LocalMcastMacs> localMcastMacs = opNode.getAugmentation(HwvtepGlobalAugmentation.class)
+ List<LocalMcastMacs> localMcastMacs = opNode.augmentation(HwvtepGlobalAugmentation.class)
.getLocalMcastMacs();
if (localMcastMacs == null) {
return null;
List<LogicalSwitches> cfgLogicalSwitches = new ArrayList<>();
List<LogicalSwitches> opLogicalSwitches = new ArrayList<>();
- if (opNode != null && opNode.getAugmentation(HwvtepGlobalAugmentation.class) != null) {
- opLogicalSwitches = opNode.getAugmentation(HwvtepGlobalAugmentation.class).getLogicalSwitches();
+ if (opNode != null && opNode.augmentation(HwvtepGlobalAugmentation.class) != null) {
+ opLogicalSwitches = opNode.augmentation(HwvtepGlobalAugmentation.class).getLogicalSwitches();
}
- if (configNode != null && configNode.getAugmentation(HwvtepGlobalAugmentation.class) != null) {
- cfgLogicalSwitches = configNode.getAugmentation(HwvtepGlobalAugmentation.class).getLogicalSwitches();
+ if (configNode != null && configNode.augmentation(HwvtepGlobalAugmentation.class) != null) {
+ cfgLogicalSwitches = configNode.augmentation(HwvtepGlobalAugmentation.class).getLogicalSwitches();
}
if (opLogicalSwitches != null) {
for (LogicalSwitches ls : opLogicalSwitches) {
return removedSwitchNames;
}
- static HwvtepGlobalAugmentationBuilder getAugmentationFromNode(Node node) {
+ static HwvtepGlobalAugmentationBuilder augmentationFromNode(Node node) {
if (node == null) {
return new HwvtepGlobalAugmentationBuilder();
}
- HwvtepGlobalAugmentation src = node.getAugmentation(HwvtepGlobalAugmentation.class);
+ HwvtepGlobalAugmentation src = node.augmentation(HwvtepGlobalAugmentation.class);
HwvtepGlobalAugmentationBuilder builder = new HwvtepGlobalAugmentationBuilder();
if (src != null) {
builder.setLogicalSwitches(src.getLogicalSwitches());
final DataObjectModification<Node> mod = change.getRootNode();
Node deleted = getRemoved(mod);
if (deleted != null) {
- if (deleted.getAugmentation(HwvtepGlobalAugmentation.class) != null) {
- LOG.trace("Cancel config reconciliation for node {}", deleted.getKey());
+ if (deleted.augmentation(HwvtepGlobalAugmentation.class) != null) {
+ LOG.trace("Cancel config reconciliation for node {}", deleted.key());
hcm.stopConfigurationReconciliation(key);
}
}
DataObjectModification<Node> mod = change.getRootNode();
Node node = getCreated(mod);
if (node != null) {
- PhysicalSwitchAugmentation physicalSwitch = node.getAugmentation(PhysicalSwitchAugmentation.class);
+ PhysicalSwitchAugmentation physicalSwitch = node.augmentation(PhysicalSwitchAugmentation.class);
if (physicalSwitch != null) {
HwvtepConnectionInstance connection =
hcm.getConnectionInstance(physicalSwitch);
if (connection != null) {
- LOG.trace("Reconcile config for node {}, IP : {}", node.getKey(),
+ LOG.trace("Reconcile config for node {}, IP : {}", node.key(),
connection.getConnectionInfo().getRemoteAddress());
hcm.reconcileConfigurations(connection, node);
}
changes.add(change);
if (globalConfigNode != null) {
- HwvtepGlobalAugmentation augmentation = globalConfigNode.getAugmentation(HwvtepGlobalAugmentation.class);
+ HwvtepGlobalAugmentation augmentation = globalConfigNode.augmentation(HwvtepGlobalAugmentation.class);
if (augmentation != null) {
if (augmentation.getLogicalSwitches() != null) {
for (LogicalSwitches logicalSwitches : augmentation.getLogicalSwitches()) {
connectionInstance.getDeviceInfo().updateConfigData(LogicalSwitches.class,
nodeId.augmentation(HwvtepGlobalAugmentation.class).child(LogicalSwitches.class,
- logicalSwitches.getKey()), logicalSwitches);
+ logicalSwitches.key()), logicalSwitches);
}
}
}
TerminationPointBuilder terminationPointBuilder = new TerminationPointBuilder(tp);
terminationPointBuilder.removeAugmentation(HwvtepPhysicalPortAugmentation.class);
- HwvtepPhysicalPortAugmentation augmentation = tp.getAugmentation(HwvtepPhysicalPortAugmentation.class);
+ HwvtepPhysicalPortAugmentation augmentation = tp.augmentation(HwvtepPhysicalPortAugmentation.class);
HwvtepPhysicalPortAugmentationBuilder builder = new HwvtepPhysicalPortAugmentationBuilder();
if (augmentation != null) {
builder = new HwvtepPhysicalPortAugmentationBuilder(augmentation);
//tobe removed as part of refactoring patch
}
- protected A getAugmentation(Node node) {
+ protected A augmentation(Node node) {
if (node == null) {
return null;
}
ParameterizedType parameterizedType = (ParameterizedType) getClass().getGenericSuperclass();
Class<? extends Augmentation<Node>> augType =
(Class<? extends Augmentation<Node>>) parameterizedType.getActualTypeArguments()[1];
- Augmentation<Node> augmentation = node.getAugmentation(augType);
+ Augmentation<Node> augmentation = node.augmentation(augType);
return (A) augmentation;
}
}
protected List<T> getData(Node node) {
- A augmentation = getAugmentation(node);
+ A augmentation = augmentation(node);
if (augmentation != null) {
List<T> data = getData(augmentation);
if (data != null) {
boolean found = false;
while (it2.hasNext()) {
T other = it2.next();
- found = compareKeyOnly ? Objects.equals(ele.getKey(), other.getKey()) : areEqual(ele, other);
+ found = compareKeyOnly ? Objects.equals(ele.key(), other.key()) : areEqual(ele, other);
if (found) {
it2.remove();
break;
}
protected boolean areEqual(T obj1, T obj2) {
- return obj1.getKey().equals(obj2.getKey());
+ return obj1.key().equals(obj2.key());
}
protected UnMetDependencyGetter getDependencyGetter() {
final Node psNode) {
this(db, connectionInstance, changes);
operationalNodes.put(connectionInstance.getInstanceIdentifier(), globalOperNode);
- HwvtepGlobalAugmentation globalAugmentation = globalOperNode.getAugmentation(HwvtepGlobalAugmentation.class);
+ HwvtepGlobalAugmentation globalAugmentation = globalOperNode.augmentation(HwvtepGlobalAugmentation.class);
if (globalAugmentation != null) {
if (!HwvtepSouthboundUtil.isEmpty(globalAugmentation.getSwitches())) {
operationalNodes.put((InstanceIdentifier<Node>)
if (readNode.isPresent()) {
operationalNodes.put(entry.getKey(), readNode.get());
HwvtepGlobalAugmentation hgAugmentation =
- readNode.get().getAugmentation(HwvtepGlobalAugmentation.class);
+ readNode.get().augmentation(HwvtepGlobalAugmentation.class);
PhysicalSwitchAugmentation psAugmentation =
- readNode.get().getAugmentation(PhysicalSwitchAugmentation.class);
+ readNode.get().augmentation(PhysicalSwitchAugmentation.class);
if (hgAugmentation != null && hgAugmentation.getSwitches() != null) {
for (Switches pswitch : hgAugmentation.getSwitches()) {
@SuppressWarnings("unchecked")
Preconditions.checkNotNull(iid);
Optional<Node> nodeOptional = getGlobalNode(iid);
if (nodeOptional.isPresent()) {
- return Optional.fromNullable(nodeOptional.get().getAugmentation(HwvtepGlobalAugmentation.class));
+ return Optional.fromNullable(nodeOptional.get().augmentation(HwvtepGlobalAugmentation.class));
}
return Optional.absent();
}
Preconditions.checkNotNull(iid);
Optional<Node> nodeOptional = getGlobalNode(iid);
if (nodeOptional.isPresent()) {
- return Optional.fromNullable(nodeOptional.get().getAugmentation(PhysicalSwitchAugmentation.class));
+ return Optional.fromNullable(nodeOptional.get().augmentation(PhysicalSwitchAugmentation.class));
}
return Optional.absent();
}
}
if (lswitchList != null) {
for (LogicalSwitches lswitch: lswitchList) {
- if (lswitch.getKey().equals(logicalSwitchesKey)) {
+ if (lswitch.key().equals(logicalSwitchesKey)) {
return Optional.fromNullable(lswitch);
}
}
}
if (tunnelList != null) {
for (Tunnels tunnel: tunnelList) {
- if (tunnel.getKey().equals(tunnelsKey)) {
+ if (tunnel.key().equals(tunnelsKey)) {
return Optional.fromNullable(tunnel);
}
}
List<TerminationPoint> tpList = nodeOptional.get();
for (TerminationPoint tp : tpList) {
HwvtepPhysicalPortAugmentation hppAugmentation =
- tp.getAugmentation(HwvtepPhysicalPortAugmentation.class);
+ tp.augmentation(HwvtepPhysicalPortAugmentation.class);
if (hppAugmentation != null && hppAugmentation.getHwvtepNodeName().equals(hwvtepNodeName)) {
return Optional.fromNullable(hppAugmentation);
}
List<TerminationPoint> tpList = nodeOptional.get();
for (TerminationPoint tp : tpList) {
HwvtepPhysicalLocatorAugmentation hppAugmentation =
- tp.getAugmentation(HwvtepPhysicalLocatorAugmentation.class);
+ tp.augmentation(HwvtepPhysicalLocatorAugmentation.class);
if (hppAugmentation != null && hppAugmentation.getDstIp().equals(dstIp)
&& hppAugmentation.getEncapsulationType().equals(encapType)) {
return Optional.fromNullable(hppAugmentation);
getPhysicalLocatorAugmentation(InstanceIdentifier<TerminationPoint> iid) {
Optional<TerminationPoint> tp = new MdsalUtils(db).readOptional(LogicalDatastoreType.OPERATIONAL, iid);
if (tp.isPresent()) {
- return Optional.fromNullable(tp.get().getAugmentation(HwvtepPhysicalLocatorAugmentation.class));
+ return Optional.fromNullable(tp.get().augmentation(HwvtepPhysicalLocatorAugmentation.class));
}
return Optional.absent();
}
}
if (macList != null) {
for (LocalMcastMacs mac: macList) {
- if (mac.getKey().equals(key)) {
+ if (mac.key().equals(key)) {
return Optional.fromNullable(mac);
}
}
}
if (macList != null) {
for (RemoteMcastMacs mac: macList) {
- if (mac.getKey().equals(key)) {
+ if (mac.key().equals(key)) {
return Optional.fromNullable(mac);
}
}
}
if (macList != null) {
for (LocalUcastMacs mac: macList) {
- if (mac.getKey().equals(key)) {
+ if (mac.key().equals(key)) {
return Optional.fromNullable(mac);
}
}
}
if (macList != null) {
for (RemoteUcastMacs mac: macList) {
- if (mac.getKey().equals(key)) {
+ if (mac.key().equals(key)) {
return Optional.fromNullable(mac);
}
}
HwvtepGlobalAugmentation hgAugmentation = nodeOptional.get();
if (hgAugmentation != null && hgAugmentation.getLogicalRouters() != null) {
for (LogicalRouters lrouter: hgAugmentation.getLogicalRouters()) {
- if (lrouter.getKey().equals(logicalRoutersKey)) {
+ if (lrouter.key().equals(logicalRoutersKey)) {
return Optional.fromNullable(lrouter);
}
}
for (LogicalRouters lrouter: routerList) {
LOG.debug("Removing logical router named: {}", lrouter.getHwvtepNodeName().getValue());
Optional<LogicalRouters> operationalRouterOptional =
- getOperationalState().getLogicalRouters(instanceIdentifier, lrouter.getKey());
+ getOperationalState().getLogicalRouters(instanceIdentifier, lrouter.key());
if (operationalRouterOptional.isPresent()
&& operationalRouterOptional.get().getLogicalRouterUuid() != null) {
@Override
protected boolean areEqual(final LogicalRouters routers1, final LogicalRouters routers2) {
- return routers1.getKey().equals(routers2.getKey());
+ return routers1.key().equals(routers2.key());
}
}
final List<LogicalRouters> routerList) {
for (LogicalRouters lrouter: routerList) {
InstanceIdentifier<LogicalRouters> routerKey = instanceIdentifier
- .augmentation(HwvtepGlobalAugmentation.class).child(LogicalRouters.class, lrouter.getKey());
+ .augmentation(HwvtepGlobalAugmentation.class).child(LogicalRouters.class, lrouter.key());
LOG.debug("Creating logical router named: {}", lrouter.getHwvtepNodeName());
final Optional<LogicalRouters> operationalRouterOptional =
- getOperationalState().getLogicalRouters(instanceIdentifier, lrouter.getKey());
+ getOperationalState().getLogicalRouters(instanceIdentifier, lrouter.key());
LogicalRouter logicalRouter = TyperUtils.getTypedRowWrapper(transaction.getDatabaseSchema(),
LogicalRouter.class);
setDescription(logicalRouter, lrouter);
final InstanceIdentifier<Node> nodeIid, final List<LogicalSwitches> lswitchList) {
for (LogicalSwitches lswitch: lswitchList) {
InstanceIdentifier<LogicalSwitches> lsKey = nodeIid.augmentation(HwvtepGlobalAugmentation.class)
- .child(LogicalSwitches.class, lswitch.getKey());
+ .child(LogicalSwitches.class, lswitch.key());
onConfigUpdate(transaction, nodeIid, lswitch, lsKey);
}
}
@Override
protected boolean areEqual(LogicalSwitches sw1, LogicalSwitches sw2) {
- return sw1.getKey().equals(sw2.getKey()) && Objects.equals(sw1.getTunnelKey(), sw2.getTunnelKey());
+ return sw1.key().equals(sw2.key()) && Objects.equals(sw1.getTunnelKey(), sw2.getTunnelKey());
}
@Override
final InstanceIdentifier<Node> nodeIid, final List<LogicalSwitches> lswitchList) {
for (LogicalSwitches lswitch: lswitchList) {
InstanceIdentifier<LogicalSwitches> lsKey = nodeIid.augmentation(HwvtepGlobalAugmentation.class)
- .child(LogicalSwitches.class, lswitch.getKey());
+ .child(LogicalSwitches.class, lswitch.key());
onConfigUpdate(transaction, nodeIid, lswitch, lsKey);
}
}
@Override
protected boolean areEqual(LogicalSwitches sw1, LogicalSwitches sw2) {
- return sw1.getKey().equals(sw2.getKey()) && Objects.equals(sw1.getTunnelKey(), sw2.getTunnelKey());
+ return sw1.key().equals(sw2.key()) && Objects.equals(sw1.getTunnelKey(), sw2.getTunnelKey());
}
}
for (LocalMcastMacs mac: macList) {
LOG.debug("Removing localMcastMacs, mac address: {}", mac.getMacEntryKey().getValue());
Optional<LocalMcastMacs> operationalMacOptional =
- getOperationalState().getLocalMcastMacs(instanceIdentifier, mac.getKey());
+ getOperationalState().getLocalMcastMacs(instanceIdentifier, mac.key());
McastMacsLocal mcastMacsLocal = TyperUtils.getTypedRowWrapper(transaction.getDatabaseSchema(),
McastMacsLocal.class, null);
if (operationalMacOptional.isPresent() && operationalMacOptional.get().getMacEntryUuid() != null) {
for (LocalMcastMacs localMcastMac: localMcastMacs) {
LOG.debug("Creating localMcastMac, mac address: {}", localMcastMac.getMacEntryKey().getValue());
final Optional<LocalMcastMacs> operationalMacOptional =
- getOperationalState().getLocalMcastMacs(instanceIdentifier, localMcastMac.getKey());
+ getOperationalState().getLocalMcastMacs(instanceIdentifier, localMcastMac.key());
McastMacsLocal mcastMacsLocal = TyperUtils.getTypedRowWrapper(transaction.getDatabaseSchema(),
McastMacsLocal.class);
setIpAddress(mcastMacsLocal, localMcastMac);
final InstanceIdentifier<Node> nodeIid, final List<RemoteMcastMacs> macList) {
for (RemoteMcastMacs mac : macList) {
InstanceIdentifier<RemoteMcastMacs> macKey = nodeIid.augmentation(HwvtepGlobalAugmentation.class)
- .child(RemoteMcastMacs.class, mac.getKey());
+ .child(RemoteMcastMacs.class, mac.key());
onConfigUpdate(transaction, nodeIid, mac, macKey);
}
}
@Override
protected boolean areEqual(RemoteMcastMacs macs1, RemoteMcastMacs macs2) {
- return macs1.getKey().equals(macs2.getKey()) && Objects.equals(macs1.getLocatorSet(), macs2.getLocatorSet());
+ return macs1.key().equals(macs2.key()) && Objects.equals(macs1.getLocatorSet(), macs2.getLocatorSet());
}
@Override
InstanceIdentifier macKey,
Object... extraData) {
InstanceIdentifier<RemoteMcastMacs> macIid = nodeIid.augmentation(HwvtepGlobalAugmentation.class)
- .child(RemoteMcastMacs.class, remoteMcastMac.getKey());
+ .child(RemoteMcastMacs.class, remoteMcastMac.key());
processDependencies(MCAST_MAC_DATA_VALIDATOR, transaction, nodeIid, macIid, remoteMcastMac);
}
@Override
protected boolean areEqual(RemoteMcastMacs macs1, RemoteMcastMacs macs2) {
- return macs1.getKey().equals(macs2.getKey()) && Objects.equals(macs1.getLocatorSet(), macs2.getLocatorSet());
+ return macs1.key().equals(macs2.key()) && Objects.equals(macs1.getLocatorSet(), macs2.getLocatorSet());
}
static class McastMacUnMetDependencyGetter extends UnMetDependencyGetter<RemoteMcastMacs> {
if (removed.getTerminationPoint() != null) {
for (TerminationPoint tp : removed.getTerminationPoint()) {
HwvtepPhysicalPortAugmentation hppAugmentation =
- tp.getAugmentation(HwvtepPhysicalPortAugmentation.class);
+ tp.augmentation(HwvtepPhysicalPortAugmentation.class);
if (hppAugmentation != null) {
lswitchListRemoved.add(hppAugmentation);
}
if (updated.getTerminationPoint() != null) {
for (TerminationPoint tp : updated.getTerminationPoint()) {
HwvtepPhysicalPortAugmentation hppAugmentation =
- tp.getAugmentation(HwvtepPhysicalPortAugmentation.class);
+ tp.augmentation(HwvtepPhysicalPortAugmentation.class);
if (hppAugmentation != null) {
portListUpdated.add(hppAugmentation);
}
if (before.getTerminationPoint() != null) {
for (TerminationPoint tp : before.getTerminationPoint()) {
HwvtepPhysicalPortAugmentation hppAugmentation =
- tp.getAugmentation(HwvtepPhysicalPortAugmentation.class);
+ tp.augmentation(HwvtepPhysicalPortAugmentation.class);
if (hppAugmentation != null) {
portListBefore.add(hppAugmentation);
}
if (created.getTerminationPoint() != null) {
for (TerminationPoint tp : created.getTerminationPoint()) {
HwvtepPhysicalPortAugmentation hppAugmentation =
- tp.getAugmentation(HwvtepPhysicalPortAugmentation.class);
+ tp.augmentation(HwvtepPhysicalPortAugmentation.class);
if (hppAugmentation != null) {
portListUpdated.add(hppAugmentation);
}
if (updated.getTerminationPoint() != null) {
for (TerminationPoint tp : updated.getTerminationPoint()) {
HwvtepPhysicalPortAugmentation hppAugmentation =
- tp.getAugmentation(HwvtepPhysicalPortAugmentation.class);
+ tp.augmentation(HwvtepPhysicalPortAugmentation.class);
if (hppAugmentation != null) {
portListUpdated.add(hppAugmentation);
}
if (before.getTerminationPoint() != null) {
for (TerminationPoint tp : before.getTerminationPoint()) {
HwvtepPhysicalPortAugmentation hppAugmentation =
- tp.getAugmentation(HwvtepPhysicalPortAugmentation.class);
+ tp.augmentation(HwvtepPhysicalPortAugmentation.class);
if (hppAugmentation != null) {
portListBefore.add(hppAugmentation);
}
Node removed = TransactUtils.getRemoved(mod);
if (removed != null) {
PhysicalSwitchAugmentation physicalSwitch =
- removed.getAugmentation(PhysicalSwitchAugmentation.class);
+ removed.augmentation(PhysicalSwitchAugmentation.class);
if (physicalSwitch != null) {
result.put(key, physicalSwitch);
}
//TODO: needs more testing
if (physicalSwitchAugmentation.getTunnels() != null) {
for (Tunnels tunnel : physicalSwitchAugmentation.getTunnels()) {
- Optional<Tunnels> opTunnelOpt = getOperationalState().getTunnels(iid, tunnel.getKey());
+ Optional<Tunnels> opTunnelOpt = getOperationalState().getTunnels(iid, tunnel.key());
Tunnel newTunnel = TyperUtils.getTypedRowWrapper(transaction.getDatabaseSchema(), Tunnel.class);
UUID localUUID = getLocatorUUID(transaction,
Node created = TransactUtils.getCreated(mod);
if (created != null) {
PhysicalSwitchAugmentation physicalSwitch =
- created.getAugmentation(PhysicalSwitchAugmentation.class);
+ created.augmentation(PhysicalSwitchAugmentation.class);
if (physicalSwitch != null) {
result.put(key, physicalSwitch);
}
Node updated = TransactUtils.getUpdated(mod);
if (updated != null) {
PhysicalSwitchAugmentation physicalSwitch =
- updated.getAugmentation(PhysicalSwitchAugmentation.class);
+ updated.augmentation(PhysicalSwitchAugmentation.class);
if (physicalSwitch != null) {
result.put(key, physicalSwitch);
}
for (LocalUcastMacs mac: macList) {
LOG.debug("Removing remoteUcastMacs, mac address: {}", mac.getMacEntryKey().getValue());
Optional<LocalUcastMacs> operationalMacOptional =
- getOperationalState().getLocalUcastMacs(instanceIdentifier, mac.getKey());
+ getOperationalState().getLocalUcastMacs(instanceIdentifier, mac.key());
UcastMacsLocal ucastMacsLocal = TyperUtils.getTypedRowWrapper(transaction.getDatabaseSchema(),
UcastMacsLocal.class, null);
if (operationalMacOptional.isPresent() && operationalMacOptional.get().getMacEntryUuid() != null) {
for (LocalUcastMacs localUcastMac: localUcastMacs) {
LOG.debug("Creating localUcastMacs, mac address: {}", localUcastMac.getMacEntryKey().getValue());
final Optional<LocalUcastMacs> operationalMacOptional =
- getOperationalState().getLocalUcastMacs(instanceIdentifier, localUcastMac.getKey());
+ getOperationalState().getLocalUcastMacs(instanceIdentifier, localUcastMac.key());
UcastMacsLocal ucastMacsLocal = TyperUtils.getTypedRowWrapper(transaction.getDatabaseSchema(),
UcastMacsLocal.class);
setIpAddress(ucastMacsLocal, localUcastMac);
getOperationalState().getDataBroker()).readOptional(LogicalDatastoreType.CONFIGURATION, iid);
if (configLocatorOptional.isPresent()) {
HwvtepPhysicalLocatorAugmentation locatorAugmentation =
- configLocatorOptional.get().getAugmentation(HwvtepPhysicalLocatorAugmentation.class);
+ configLocatorOptional.get().augmentation(HwvtepPhysicalLocatorAugmentation.class);
locatorUuid = TransactUtils.createPhysicalLocator(transaction, locatorAugmentation);
} else {
LOG.warn("Create or update localUcastMac: No physical locator found in operational datastore!"
final InstanceIdentifier macKey,
final Object... extraData) {
InstanceIdentifier<RemoteUcastMacs> macIid = nodeIid.augmentation(HwvtepGlobalAugmentation.class)
- .child(RemoteUcastMacs.class, remoteUcastMacs.getKey());
+ .child(RemoteUcastMacs.class, remoteUcastMacs.key());
processDependencies(null, transaction, nodeIid, macIid, remoteUcastMacs);
}
final Object... extraData) {
LOG.debug("Removing remoteUcastMacs, mac address: {}", mac.getMacEntryKey().getValue());
InstanceIdentifier<RemoteUcastMacs> macIid = instanceIdentifier.augmentation(HwvtepGlobalAugmentation.class)
- .child(RemoteUcastMacs.class, mac.getKey());
+ .child(RemoteUcastMacs.class, mac.key());
HwvtepDeviceInfo.DeviceData deviceData =
getOperationalState().getDeviceInfo().getDeviceOperData(RemoteUcastMacs.class, macIid);
UcastMacsRemote ucastMacsRemote = TyperUtils.getTypedRowWrapper(transaction.getDatabaseSchema(),
final InstanceIdentifier macKey,
final Object... extraData) {
InstanceIdentifier<RemoteUcastMacs> macIid = nodeIid.augmentation(HwvtepGlobalAugmentation.class)
- .child(RemoteUcastMacs.class, remoteUcastMacs.getKey());
+ .child(RemoteUcastMacs.class, remoteUcastMacs.key());
processDependencies(UCAST_MAC_DATA_VALIDATOR, transaction, nodeIid, macIid, remoteUcastMacs);
}
Optional<Node> hwvtepGlobalOptional = hwvtepGlobalFuture.get();
if (hwvtepGlobalOptional.isPresent()) {
Node hwvtepNode = hwvtepGlobalOptional.get();
- HwvtepGlobalAugmentation hgAugmentation = hwvtepNode.getAugmentation(HwvtepGlobalAugmentation.class);
+ HwvtepGlobalAugmentation hgAugmentation = hwvtepNode.augmentation(HwvtepGlobalAugmentation.class);
if (checkIfOnlyConnectedManager(hgAugmentation)) {
if (hgAugmentation != null) {
if (hgAugmentation.getSwitches() != null) {
lrBuilder.setHwvtepNodeDescription(router.getDescription());
HwvtepNodeName hwvtepName = new HwvtepNodeName(router.getName());
lrBuilder.setHwvtepNodeName(hwvtepName);
- lrBuilder.setKey(new LogicalRoutersKey(hwvtepName));
+ lrBuilder.withKey(new LogicalRoutersKey(hwvtepName));
setSwitchBindings(router, lrBuilder);
setStaticRoutes(router, lrBuilder);
}
HwvtepNodeName hwvtepName = new HwvtepNodeName(logicalSwitch.getName());
lsBuilder.setHwvtepNodeName(hwvtepName);
- lsBuilder.setKey(new LogicalSwitchesKey(hwvtepName));
+ lsBuilder.withKey(new LogicalSwitchesKey(hwvtepName));
if (logicalSwitch.getTunnelKeyColumn().getData() != null
&& !logicalSwitch.getTunnelKeyColumn().getData().isEmpty()) {
lsBuilder.setTunnelKey(logicalSwitch.getTunnelKeyColumn().getData().iterator().next().toString());
InstanceIdentifier<RemoteMcastMacs> getMacIid(InstanceIdentifier<Node> connectionIId, Node connectionNode) {
RemoteMcastMacsKey macsKey =
- connectionNode.getAugmentation(HwvtepGlobalAugmentation.class).getRemoteMcastMacs().get(0).getKey();
+ connectionNode.augmentation(HwvtepGlobalAugmentation.class).getRemoteMcastMacs().get(0).key();
InstanceIdentifier<RemoteMcastMacs> key = connectionIId.augmentation(HwvtepGlobalAugmentation.class)
.child(RemoteMcastMacs.class, macsKey);
return key;
TerminationPointKey tpKey = HwvtepSouthboundMapper.getTerminationPointKey(locator);
if (nodeIid != null && tpKey != null) {
TerminationPointBuilder tpBuilder = new TerminationPointBuilder();
- tpBuilder.setKey(tpKey);
+ tpBuilder.withKey(tpKey);
tpBuilder.setTpId(tpKey.getTpId());
InstanceIdentifier<TerminationPoint> tpPath =
HwvtepSouthboundMapper.createInstanceIdentifier(nodeIid, locator);
if (switchIid.isPresent()) {
TerminationPointKey tpKey = new TerminationPointKey(new TpId(portName));
TerminationPointBuilder tpBuilder = new TerminationPointBuilder();
- tpBuilder.setKey(tpKey);
+ tpBuilder.withKey(tpKey);
tpBuilder.setTpId(tpKey.getTpId());
InstanceIdentifier<TerminationPoint> tpPath = getInstanceIdentifier(switchIid.get(), portUpdate);
HwvtepPhysicalPortAugmentationBuilder tpAugmentationBuilder =
new FutureCallback<Optional<TerminationPoint>>() {
@Override
public void onSuccess(@Nonnull Optional<TerminationPoint> optionalConfigTp) {
- if (!optionalConfigTp.isPresent() || optionalConfigTp.get().getAugmentation(
+ if (!optionalConfigTp.isPresent() || optionalConfigTp.get().augmentation(
HwvtepPhysicalPortAugmentation.class) == null) {
//TODO port came with some vlan bindings clean them up use PortRemovedCommand
return;
PhysicalPortUpdateCommand portUpdateCommand = new PhysicalPortUpdateCommand(
operState, Collections.EMPTY_LIST);
portUpdateCommand.updatePhysicalPort(transactionBuilder, psIid,
- Lists.newArrayList(configTp.getAugmentation(HwvtepPhysicalPortAugmentation.class)));
+ Lists.newArrayList(configTp.augmentation(HwvtepPhysicalPortAugmentation.class)));
});
}
private VlanBindings createVlanBinding(Long key, UUID value) {
VlanBindingsBuilder vbBuilder = new VlanBindingsBuilder();
VlanBindingsKey vbKey = new VlanBindingsKey(new VlanId(key.intValue()));
- vbBuilder.setKey(vbKey);
+ vbBuilder.withKey(vbKey);
vbBuilder.setVlanIdKey(vbKey.getVlanIdKey());
HwvtepLogicalSwitchRef switchRef = this.getLogicalSwitchRef(value);
vbBuilder.setLogicalSwitchRef(switchRef);
private Optional<InstanceIdentifier<Node>> getTerminationPointSwitch(final ReadWriteTransaction transaction,
Node node, String tpName) {
- HwvtepGlobalAugmentation hwvtepNode = node.getAugmentation(HwvtepGlobalAugmentation.class);
+ HwvtepGlobalAugmentation hwvtepNode = node.augmentation(HwvtepGlobalAugmentation.class);
List<Switches> switchNodes = hwvtepNode.getSwitches();
for (Switches managedNodeEntry : switchNodes) {
@SuppressWarnings("unchecked")
TerminationPointKey tpKey = new TerminationPointKey(new TpId(tpName));
if (switchNode.getTerminationPoint() != null) {
for (TerminationPoint terminationPoint : switchNode.getTerminationPoint()) {
- if (terminationPoint.getKey().equals(tpKey)) {
+ if (terminationPoint.key().equals(tpKey)) {
return Optional.of((InstanceIdentifier<Node>) managedNodeEntry.getSwitchRef().getValue());
}
}
&& !portUpdate.getPortFaultStatusColumn().getData().isEmpty()) {
List<PortFaultStatus> portFaultStatusLst = new ArrayList<>();
for (String portFaultStatus : portUpdate.getPortFaultStatusColumn().getData()) {
- portFaultStatusLst.add(new PortFaultStatusBuilder().setKey(new PortFaultStatusKey(portFaultStatus))
+ portFaultStatusLst.add(new PortFaultStatusBuilder().withKey(new PortFaultStatusKey(portFaultStatus))
.setPortFaultStatusKey(portFaultStatus).build());
}
tpAugmentationBuilder.setPortFaultStatus(portFaultStatusLst);
private InstanceIdentifier<TunnelIps> getTunnelIpIid(final String tunnelIp, final InstanceIdentifier<Node> psIid) {
IpAddress ip = new IpAddress(tunnelIp.toCharArray());
- TunnelIps tunnelIps = new TunnelIpsBuilder().setKey(new TunnelIpsKey(ip)).setTunnelIpsKey(ip).build();
- return psIid.augmentation(PhysicalSwitchAugmentation.class).child(TunnelIps.class, tunnelIps.getKey());
+ TunnelIps tunnelIps = new TunnelIpsBuilder().withKey(new TunnelIpsKey(ip)).setTunnelIpsKey(ip).build();
+ return psIid.augmentation(PhysicalSwitchAugmentation.class).child(TunnelIps.class, tunnelIps.key());
}
private void updateTunnelIps(@Nonnull final PhysicalSwitch newPSwitch, @Nullable final PhysicalSwitch oldPSwitch,
for (String tunnelIp : addedTunnelIps) {
IpAddress ip = new IpAddress(tunnelIp.toCharArray());
InstanceIdentifier<TunnelIps> tunnelIpsInstanceIdentifier = getTunnelIpIid(tunnelIp, psIid);
- TunnelIps tunnelIps = new TunnelIpsBuilder().setKey(new TunnelIpsKey(ip)).setTunnelIpsKey(ip).build();
+ TunnelIps tunnelIps = new TunnelIpsBuilder().withKey(new TunnelIpsKey(ip)).setTunnelIpsKey(ip).build();
transaction.put(LogicalDatastoreType.OPERATIONAL, tunnelIpsInstanceIdentifier, tunnelIps, true);
}
}
for (String mgmtIp : phySwitch.getManagementIpsColumn().getData()) {
IpAddress ip = new IpAddress(mgmtIp.toCharArray());
mgmtIps.add(
- new ManagementIpsBuilder().setKey(new ManagementIpsKey(ip)).setManagementIpsKey(ip).build());
+ new ManagementIpsBuilder().withKey(new ManagementIpsKey(ip)).setManagementIpsKey(ip).build());
}
psAugmentationBuilder.setManagementIps(mgmtIps);
}
List<SwitchFaultStatus> switchFaultStatusLst = new ArrayList<>();
for (String switchFaultStatus : phySwitch.getSwitchFaultStatusColumn().getData()) {
switchFaultStatusLst
- .add(new SwitchFaultStatusBuilder().setKey(new SwitchFaultStatusKey(switchFaultStatus))
+ .add(new SwitchFaultStatusBuilder().withKey(new SwitchFaultStatusKey(switchFaultStatus))
.setSwitchFaultStatusKey(switchFaultStatus).build());
}
psAugmentationBuilder.setSwitchFaultStatus(switchFaultStatusLst);
private InstanceIdentifier<RemoteUcastMacs> getMacIid(final RemoteUcastMacs remoteUcastMacs) {
return getOvsdbConnectionInstance().getInstanceIdentifier()
- .augmentation(HwvtepGlobalAugmentation.class).child(RemoteUcastMacs.class, remoteUcastMacs.getKey());
+ .augmentation(HwvtepGlobalAugmentation.class).child(RemoteUcastMacs.class, remoteUcastMacs.key());
}
}
for (LogicalSwitches ls : logicalSwitches) {
InstanceIdentifier<LogicalSwitches> key =
- nodeIid.augmentation(HwvtepGlobalAugmentation.class).child(LogicalSwitches.class, ls.getKey());
+ nodeIid.augmentation(HwvtepGlobalAugmentation.class).child(LogicalSwitches.class, ls.key());
tx.delete(logicalDatastoreType, key);
}
}
List<RemoteUcastMacs> macs = TestBuilders.addRemoteUcastMacs(nodeIid, builder, data);
for (RemoteUcastMacs mac : macs) {
InstanceIdentifier<RemoteUcastMacs> key =
- nodeIid.augmentation(HwvtepGlobalAugmentation.class).child(RemoteUcastMacs.class, mac.getKey());
+ nodeIid.augmentation(HwvtepGlobalAugmentation.class).child(RemoteUcastMacs.class, mac.key());
tx.delete(logicalDatastoreType, key);
}
}
List<RemoteMcastMacs> macs = TestBuilders.addRemoteMcastMacs(nodeIid, builder, data);
for (RemoteMcastMacs mac : macs) {
InstanceIdentifier<RemoteMcastMacs> key =
- nodeIid.augmentation(HwvtepGlobalAugmentation.class).child(RemoteMcastMacs.class, mac.getKey());
+ nodeIid.augmentation(HwvtepGlobalAugmentation.class).child(RemoteMcastMacs.class, mac.key());
tx.delete(logicalDatastoreType, key);
}
}
lsIid = nodeIid.augmentation(HwvtepGlobalAugmentation.class)
.child(LogicalSwitches.class, new LogicalSwitchesKey(new HwvtepNodeName("ls0")));
macIid = nodeIid.augmentation(HwvtepGlobalAugmentation.class)
- .child(RemoteMcastMacs.class, new RemoteMcastMacsKey(mac.getKey()));
+ .child(RemoteMcastMacs.class, new RemoteMcastMacsKey(mac.key()));
setFinalStatic(DependencyQueue.class, "EXECUTOR_SERVICE", PowerMockito.mock(SameThreadScheduledExecutor.class,
Mockito.CALLS_REAL_METHODS));
}
if (LogicalSwitches.class == childClass) {
LogicalSwitches ls = (LogicalSwitches)data;
instanceIdentifier = key.augmentation(HwvtepGlobalAugmentation.class).child(LogicalSwitches.class,
- ls.getKey());
+ ls.key());
} else if (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology
.topology.node.TerminationPoint.class == childClass) {
TerminationPoint tp = (TerminationPoint)data;
- instanceIdentifier = key.child(TerminationPoint.class, tp.getKey());
+ instanceIdentifier = key.child(TerminationPoint.class, tp.key());
} else if (RemoteUcastMacs.class == childClass) {
RemoteUcastMacs mac = (RemoteUcastMacs)data;
instanceIdentifier = key.augmentation(HwvtepGlobalAugmentation.class).child(RemoteUcastMacs.class,
- mac.getKey());
+ mac.key());
} else if (RemoteMcastMacs.class == childClass) {
RemoteMcastMacs mac = (RemoteMcastMacs)data;
instanceIdentifier = key.augmentation(HwvtepGlobalAugmentation.class).child(RemoteMcastMacs.class,
- mac.getKey());
+ mac.key());
}
return instanceIdentifier;
}
TerminationPointKey tpKey = new TerminationPointKey(new TpId("vxlan_over_ipv4:" + ip));
TerminationPointBuilder tpBuilder = new TerminationPointBuilder();
if (nodeIid != null) {
- tpBuilder.setKey(tpKey);
+ tpBuilder.withKey(tpKey);
tpBuilder.setTpId(tpKey.getTpId());
HwvtepPhysicalLocatorAugmentationBuilder tpAugmentationBuilder =
new HwvtepPhysicalLocatorAugmentationBuilder();
String logicalSwitch = keys[0];
String tunnelKey = keys[1];
LogicalSwitchesBuilder logicalSwitchesBuilder = new LogicalSwitchesBuilder();
- logicalSwitchesBuilder.setKey(new LogicalSwitchesKey(new HwvtepNodeName(logicalSwitch)));
+ logicalSwitchesBuilder.withKey(new LogicalSwitchesKey(new HwvtepNodeName(logicalSwitch)));
logicalSwitchesBuilder.setHwvtepNodeName(new HwvtepNodeName(logicalSwitch));
logicalSwitchesBuilder.setTunnelKey(tunnelKey);
Uuid uuid = getUUid(logicalSwitch);
LogicalDatastoreType dataStore) {
Node psNode = getPhysicalSwitchNode(connectionInfo, psName, dataStore);
Assert.assertNotNull(psNode);
- PhysicalSwitchAugmentation psAugmentation = psNode.getAugmentation(PhysicalSwitchAugmentation.class);
+ PhysicalSwitchAugmentation psAugmentation = psNode.augmentation(PhysicalSwitchAugmentation.class);
Assert.assertNotNull(psAugmentation);
return psAugmentation;
}
public OvsdbConnectionInstance getConnectionInstance(Node node) {
Preconditions.checkNotNull(node);
- OvsdbNodeAugmentation ovsdbNode = node.getAugmentation(OvsdbNodeAugmentation.class);
- OvsdbBridgeAugmentation ovsdbManagedNode = node.getAugmentation(OvsdbBridgeAugmentation.class);
+ OvsdbNodeAugmentation ovsdbNode = node.augmentation(OvsdbNodeAugmentation.class);
+ OvsdbBridgeAugmentation ovsdbManagedNode = node.augmentation(OvsdbBridgeAugmentation.class);
if (ovsdbNode != null) {
return getConnectionInstance(ovsdbNode.getConnectionInfo());
} else if (ovsdbManagedNode != null) {
Optional<Node> ovsdbNodeOpt = SouthboundUtil.readNode(transaction, nodeIid);
if (ovsdbNodeOpt.isPresent()) {
Node ovsdbNode = ovsdbNodeOpt.get();
- OvsdbNodeAugmentation nodeAugmentation = ovsdbNode.getAugmentation(OvsdbNodeAugmentation.class);
+ OvsdbNodeAugmentation nodeAugmentation = ovsdbNode.augmentation(OvsdbNodeAugmentation.class);
if (nodeAugmentation != null) {
if (nodeAugmentation.getManagedNodeEntry() != null) {
for (ManagedNodeEntry managedNode : nodeAugmentation.getManagedNodeEntry()) {
? change.getRootNode().getDataAfter() : change.getRootNode().getDataBefore();
if (node != null) {
InstanceIdentifier<Node> nodeIid;
- Augmentation nodeAug = node.getAugmentation(OvsdbNodeAugmentation.class) != null
- ? node.getAugmentation(OvsdbNodeAugmentation.class)
- : node.getAugmentation(OvsdbBridgeAugmentation.class);
+ Augmentation nodeAug = node.augmentation(OvsdbNodeAugmentation.class) != null
+ ? node.augmentation(OvsdbNodeAugmentation.class)
+ : node.augmentation(OvsdbBridgeAugmentation.class);
if (nodeAug instanceof OvsdbNodeAugmentation) {
OvsdbNodeAugmentation ovsdbNode = (OvsdbNodeAugmentation) nodeAug;
bridgeNode, updatedControllerRows);
final List<ControllerEntry> controllerEntriesCreated = new ArrayList<>();
final OvsdbBridgeAugmentation ovsdbBridgeAugmentation =
- bridgeNode.getAugmentation(OvsdbBridgeAugmentation.class);
+ bridgeNode.augmentation(OvsdbBridgeAugmentation.class);
if (ovsdbBridgeAugmentation == null) {
return controllerEntriesCreated;
}
ovsdbNode, updatedManagerRows);
final List<ManagerEntry> managerEntriesCreated = new ArrayList<>();
final OvsdbNodeAugmentation ovsdbNodeAugmentation =
- ovsdbNode.getAugmentation(OvsdbNodeAugmentation.class);
+ ovsdbNode.augmentation(OvsdbNodeAugmentation.class);
if (ovsdbNodeAugmentation == null) {
return managerEntriesCreated;
}
if (terminationPoints != null && !terminationPoints.isEmpty()) {
for (TerminationPoint tp : terminationPoints) {
OvsdbTerminationPointAugmentation ovsdbTerminationPointAugmentation =
- tp.getAugmentation(OvsdbTerminationPointAugmentation.class);
+ tp.augmentation(OvsdbTerminationPointAugmentation.class);
if (ovsdbTerminationPointAugmentation != null) {
final InstanceIdentifier<OvsdbTerminationPointAugmentation> tpIid =
bridgeNodeIid
if (node instanceof OvsdbNodeAugmentation) {
ovsdbNode = (OvsdbNodeAugmentation) node;
} else if (node != null) {
- ovsdbNode = node.getAugmentation(OvsdbNodeAugmentation.class);
+ ovsdbNode = node.augmentation(OvsdbNodeAugmentation.class);
}
if (ovsdbNode != null) {
return Optional.of(ovsdbNode);
public static String getControllerTarget(Node ovsdbNode) {
String target = null;
String ipAddr = null;
- OvsdbNodeAugmentation ovsdbNodeAugmentation = ovsdbNode.getAugmentation(OvsdbNodeAugmentation.class);
+ OvsdbNodeAugmentation ovsdbNodeAugmentation = ovsdbNode.augmentation(OvsdbNodeAugmentation.class);
ConnectionInfo connectionInfo = ovsdbNodeAugmentation.getConnectionInfo();
LOG.info("connectionInfo: {}", connectionInfo);
if (connectionInfo != null && connectionInfo.getLocalIp() != null) {
return;
}
final OvsdbNodeAugmentation currentOvsdbNode =
- state.getBridgeNode(ovsdbNodeIid).get().getAugmentation(OvsdbNodeAugmentation.class);
+ state.getBridgeNode(ovsdbNodeIid).get().augmentation(OvsdbNodeAugmentation.class);
final List<Autoattach> currentAutoAttach = currentOvsdbNode.getAutoattach();
for (final Autoattach origAutoattach : origAutoattachList) {
final Uri autoAttachId = origAutoattach.getAutoattachId();
final Optional<Node> nodeOptional = transaction.read(LogicalDatastoreType.OPERATIONAL, nodeIid).get();
if (nodeOptional.isPresent()) {
final List<ManagedNodeEntry> managedNodes =
- nodeOptional.get().getAugmentation(OvsdbNodeAugmentation.class).getManagedNodeEntry();
+ nodeOptional.get().augmentation(OvsdbNodeAugmentation.class).getManagedNodeEntry();
for (final ManagedNodeEntry managedNode : managedNodes) {
final OvsdbBridgeRef ovsdbBridgeRef = managedNode.getBridgeRef();
final InstanceIdentifier<OvsdbBridgeAugmentation> brIid = ovsdbBridgeRef.getValue()
}
final OvsdbNodeAugmentation currentOvsdbNode =
- state.getBridgeNode(iid).get().getAugmentation(OvsdbNodeAugmentation.class);
+ state.getBridgeNode(iid).get().augmentation(OvsdbNodeAugmentation.class);
final List<Autoattach> currentAutoAttach = currentOvsdbNode.getAutoattach();
for (final Autoattach autoAttach : autoAttachList) {
final AutoAttach autoAttachWrapper =
public Optional<OvsdbBridgeAugmentation> getOvsdbBridgeAugmentation(InstanceIdentifier<?> iid) {
Optional<Node> nodeOptional = getBridgeNode(iid);
if (nodeOptional.isPresent()) {
- return Optional.fromNullable(nodeOptional.get().getAugmentation(OvsdbBridgeAugmentation.class));
+ return Optional.fromNullable(nodeOptional.get().augmentation(OvsdbBridgeAugmentation.class));
}
return Optional.absent();
}
TerminationPointKey key = iid.firstKeyOf(TerminationPoint.class);
if (key != null) {
for (TerminationPoint tp:nodeOptional.get().getTerminationPoint()) {
- if (tp.getKey().equals(key)) {
+ if (tp.key().equals(key)) {
return Optional.of(tp);
}
}
public Optional<OvsdbTerminationPointAugmentation> getOvsdbTerminationPointAugmentation(InstanceIdentifier<?> iid) {
Optional<TerminationPoint> tpOptional = getBridgeTerminationPoint(iid);
if (tpOptional.isPresent()) {
- return Optional.fromNullable(tpOptional.get().getAugmentation(OvsdbTerminationPointAugmentation.class));
+ return Optional.fromNullable(tpOptional.get().augmentation(OvsdbTerminationPointAugmentation.class));
}
return Optional.absent();
}
ControllerEntryKey key = iid.firstKeyOf(ControllerEntry.class);
if (key != null) {
for (ControllerEntry entry: ovsdbBridgeOptional.get().getControllerEntry()) {
- if (entry.getKey().equals(key)) {
+ if (entry.key().equals(key)) {
return Optional.of(entry);
}
}
ProtocolEntryKey key = iid.firstKeyOf(ProtocolEntry.class);
if (key != null) {
for (ProtocolEntry entry: ovsdbBridgeOptional.get().getProtocolEntry()) {
- if (entry.getKey().equals(key)) {
+ if (entry.key().equals(key)) {
return Optional.of(entry);
}
}
Optional<?> bridgeNode = SouthboundUtil.readNode(db.newReadWriteTransaction(),nodeEntryIid);
if (bridgeNode.isPresent() && bridgeNode.get() instanceof Node) {
Node node = (Node)bridgeNode.get();
- OvsdbBridgeAugmentation bridge = node.getAugmentation(OvsdbBridgeAugmentation.class);
+ OvsdbBridgeAugmentation bridge = node.augmentation(OvsdbBridgeAugmentation.class);
if (bridge != null && bridge.getManagedBy() != null) {
return bridge.getManagedBy().getValue();
}
// If we are contained in a bridge managed by this iid
if (dataObject != null && dataObject instanceof Node) {
Node node = (Node)dataObject;
- OvsdbBridgeAugmentation bridge = node.getAugmentation(OvsdbBridgeAugmentation.class);
+ OvsdbBridgeAugmentation bridge = node.augmentation(OvsdbBridgeAugmentation.class);
if (bridge != null && bridge.getManagedBy() != null && bridge.getManagedBy().getValue().equals(this.iid)) {
return bridge.getManagedBy().getValue();
}
if (origQosEntries != null && !origQosEntries.isEmpty()) {
for (QosEntries origQosEntry : origQosEntries) {
OvsdbNodeAugmentation operNode =
- state.getBridgeNode(ovsdbNodeIid).get().getAugmentation(OvsdbNodeAugmentation.class);
+ state.getBridgeNode(ovsdbNodeIid).get().augmentation(OvsdbNodeAugmentation.class);
List<QosEntries> operQosEntries = operNode.getQosEntries();
boolean found = false;
return;
}
OvsdbNodeAugmentation operNode =
- state.getBridgeNode(iid).get().getAugmentation(OvsdbNodeAugmentation.class);
+ state.getBridgeNode(iid).get().augmentation(OvsdbNodeAugmentation.class);
QosEntries qosEntry = qosMapEntry.getValue();
Qos qos = TyperUtils.getTypedRowWrapper(transaction.getDatabaseSchema(), Qos.class);
if (origQueues != null && !origQueues.isEmpty()) {
for (Queues origQueue : origQueues) {
OvsdbNodeAugmentation operNode =
- state.getBridgeNode(ovsdbNodeIid).get().getAugmentation(
+ state.getBridgeNode(ovsdbNodeIid).get().augmentation(
OvsdbNodeAugmentation.class);
List<Queues> operQueues = operNode.getQueues();
}
OvsdbNodeAugmentation operNode =
- state.getBridgeNode(iid).get().getAugmentation(OvsdbNodeAugmentation.class);
+ state.getBridgeNode(iid).get().augmentation(OvsdbNodeAugmentation.class);
Uuid operQueueUuid = getQueueEntryUuid(operNode.getQueues(), queueEntry.getQueueId());
if (operQueueUuid == null) {
UUID namedUuid = new UUID(SouthboundConstants.QUEUE_NAMED_UUID_PREFIX
InstanceIdentifier<Node> nodeIid = key.firstIdentifierOf(Node.class);
if (nodes != null && nodes.get(nodeIid) != null) {
Node node = nodes.get(nodeIid);
- bridge = node.getAugmentation(OvsdbBridgeAugmentation.class);
+ bridge = node.augmentation(OvsdbBridgeAugmentation.class);
if (bridge == null) {
ReadOnlyTransaction transaction = SouthboundProvider.getDb().newReadOnlyTransaction();
CheckedFuture<Optional<Node>, ReadFailedException> future =
try {
Optional<Node> nodeOptional = future.get();
if (nodeOptional.isPresent()) {
- bridge = nodeOptional.get().getAugmentation(OvsdbBridgeAugmentation.class);
+ bridge = nodeOptional.get().augmentation(OvsdbBridgeAugmentation.class);
}
} catch (InterruptedException | ExecutionException e) {
LOG.warn("Error reading from datastore",e);
OvsdbTerminationPointAugmentation original = originals.get(removedTpIid);
Node originalNode = originalNodes.get(removedTpIid.firstIdentifierOf(Node.class));
OvsdbBridgeAugmentation originalOvsdbBridgeAugmentation =
- originalNode.getAugmentation(OvsdbBridgeAugmentation.class);
+ originalNode.augmentation(OvsdbBridgeAugmentation.class);
String bridgeName = null;
if (originalOvsdbBridgeAugmentation != null) {
bridgeName = originalOvsdbBridgeAugmentation.getBridgeName().getValue();
try {
Optional<Node> nodeOptional = future.get();
if (nodeOptional.isPresent()) {
- operNode = nodeOptional.get().getAugmentation(OvsdbNodeAugmentation.class);
+ operNode = nodeOptional.get().augmentation(OvsdbNodeAugmentation.class);
}
} catch (InterruptedException | ExecutionException e) {
LOG.warn("Error reading from datastore", e);
Preconditions.checkNotNull(bridgeNodes, "Bridge Node list must not be null");
if (!bridgeNodes.isEmpty()) {
for (Node node : bridgeNodes) {
- bridgeNodeCache.put(node.getKey(),
+ bridgeNodeCache.put(node.key(),
new NodeConnectionMetadata(node, connectionManager, connectionInstance));
}
registerBridgeCreatedDataTreeChangeListener();
final List<Node> tpChanges = new ArrayList<>();
for (Node node : topology.getNode()) {
LOG.debug("Reconcile Configuration for node {}", node.getNodeId());
- OvsdbBridgeAugmentation bridge = node.getAugmentation(OvsdbBridgeAugmentation.class);
+ OvsdbBridgeAugmentation bridge = node.augmentation(OvsdbBridgeAugmentation.class);
if (bridge != null && bridge.getManagedBy() != null
&& bridge.getManagedBy().getValue().equals(ndIid)) {
brChanges.putAll(extractBridgeConfigurationChanges(node, bridge));
tpChanges.add(node);
- } else if (node.getKey().getNodeId().getValue().startsWith(
+ } else if (node.key().getNodeId().getValue().startsWith(
nodeIid.firstKeyOf(Node.class).getNodeId().getValue())
&& node.getTerminationPoint() != null && !node.getTerminationPoint().isEmpty()) {
tpChanges.add(node);
for (ProtocolEntry protocol : ovsdbBridge.getProtocolEntry()) {
if (SouthboundConstants.OVSDB_PROTOCOL_MAP.get(protocol.getProtocol()) != null) {
KeyedInstanceIdentifier<ProtocolEntry, ProtocolEntryKey> protocolIid =
- ovsdbBridgeIid.child(ProtocolEntry.class, protocol.getKey());
+ ovsdbBridgeIid.child(ProtocolEntry.class, protocol.key());
changes.put(protocolIid, protocol);
} else {
throw new IllegalArgumentException("Unknown protocol " + protocol.getProtocol());
if (ovsdbBridge.getControllerEntry() != null) {
for (ControllerEntry controller : ovsdbBridge.getControllerEntry()) {
KeyedInstanceIdentifier<ControllerEntry, ControllerEntryKey> controllerIid =
- ovsdbBridgeIid.child(ControllerEntry.class, controller.getKey());
+ ovsdbBridgeIid.child(ControllerEntry.class, controller.key());
changes.put(controllerIid, controller);
}
}
}
private AutoattachKey getAutoAttachKeyToRemove(Node node, UUID autoAttachUuid) {
- final List<Autoattach> autoAttachList = node.getAugmentation(OvsdbNodeAugmentation.class).getAutoattach();
+ final List<Autoattach> autoAttachList = node.augmentation(OvsdbNodeAugmentation.class).getAutoattach();
if (autoAttachList == null || autoAttachList.isEmpty()) {
return null;
}
for (final Autoattach autoAttach : autoAttachList) {
if (autoAttach.getAutoattachUuid()
.equals(new Uuid(autoAttachUuid.toString()))) {
- return autoAttach.getKey();
+ return autoAttach.key();
}
}
return null;
: new AutoattachBuilder()
.setAutoattachUuid(new Uuid(entry.getKey().toString()))
.setAutoattachId(uri)
- .setKey(new AutoattachKey(uri));
+ .withKey(new AutoattachKey(uri));
if (autoAttach.getSystemNameColumn() != null
&& autoAttach.getSystemNameColumn().getData() != null
ovsdbNode.get().getNodeId(), autoAttachEntry);
final InstanceIdentifier<Autoattach> iid = nodeIId
.augmentation(OvsdbNodeAugmentation.class)
- .child(Autoattach.class, autoAttachEntry.getKey());
+ .child(Autoattach.class, autoAttachEntry.key());
transaction.put(LogicalDatastoreType.OPERATIONAL,
iid, autoAttachEntry);
}
final Integer mappingsValue = Integer.valueOf(entry.getValue().intValue());
if (mappingsKey != null) {
mappingsList.add(new MappingsBuilder()
- .setKey(new MappingsKey(mappingsKey))
+ .withKey(new MappingsKey(mappingsKey))
.setMappingsKey(mappingsKey)
.setMappingsValue(mappingsValue)
.build());
final InstanceIdentifier<Node> bridgeIid = bridgeNodeEntry.getKey();
InstanceIdentifier<ControllerEntry> iid = bridgeIid
.augmentation(OvsdbBridgeAugmentation.class)
- .child(ControllerEntry.class, controllerEntry.getKey());
+ .child(ControllerEntry.class, controllerEntry.key());
transaction.merge(LogicalDatastoreType.OPERATIONAL,
iid, controllerEntry);
}
final InstanceIdentifier<Node> connectionIId = getOvsdbConnectionInstance().getInstanceIdentifier();
final Optional<Node> ovsdbNode = SouthboundUtil.readNode(transaction, connectionIId);
if (ovsdbNode.isPresent()) {
- OvsdbNodeAugmentation ovsdbNodeAugmentation = ovsdbNode.get().getAugmentation(OvsdbNodeAugmentation.class);
+ OvsdbNodeAugmentation ovsdbNodeAugmentation = ovsdbNode.get().augmentation(OvsdbNodeAugmentation.class);
if (ovsdbNodeAugmentation != null) {
final List<ManagedNodeEntry> managedNodeEntries = ovsdbNodeAugmentation.getManagedNodeEntry();
for (ManagedNodeEntry managedNodeEntry : managedNodeEntries) {
return bridgeIid
.augmentation(OvsdbBridgeAugmentation.class)
- .child(ControllerEntry.class, controllerEntry.getKey());
+ .child(ControllerEntry.class, controllerEntry.key());
}
}
for (ManagerEntry managerEntry : managerEntries) {
InstanceIdentifier<ManagerEntry> iid = connectionIId
.augmentation(OvsdbNodeAugmentation.class)
- .child(ManagerEntry.class, managerEntry.getKey());
+ .child(ManagerEntry.class, managerEntry.key());
transaction.merge(LogicalDatastoreType.OPERATIONAL,
iid, managerEntry);
}
return ovsdbNodeIid
.augmentation(OvsdbNodeAugmentation.class)
- .child(ManagerEntry.class, managerEntry.getKey());
+ .child(ManagerEntry.class, managerEntry.key());
}
private Map<Uri, Manager> getUriManagerMap(Map<UUID,Manager> uuidManagerMap) {
ovsdbNodeOptional = ovsdbNodeFuture.get();
if (ovsdbNodeOptional.isPresent()) {
Node ovsdbNode = ovsdbNodeOptional.get();
- OvsdbNodeAugmentation ovsdbNodeAugmentation = ovsdbNode.getAugmentation(OvsdbNodeAugmentation.class);
+ OvsdbNodeAugmentation ovsdbNodeAugmentation = ovsdbNode.augmentation(OvsdbNodeAugmentation.class);
if (checkIfOnlyConnectedManager(ovsdbNodeAugmentation)) {
if (ovsdbNodeAugmentation != null) {
if (ovsdbNodeAugmentation.getManagedNodeEntry() != null) {
if (bridgeIid.isPresent()) {
TerminationPointKey tpKey = new TerminationPointKey(new TpId(portName));
TerminationPointBuilder tpBuilder = new TerminationPointBuilder();
- tpBuilder.setKey(tpKey);
+ tpBuilder.withKey(tpKey);
tpBuilder.setTpId(tpKey.getTpId());
InstanceIdentifier<TerminationPoint> tpPath =
getInstanceIdentifier(bridgeIid.get(), portUpdate.getValue());
if (bridgeIid.isPresent()) {
TerminationPointKey tpKey = new TerminationPointKey(new TpId(interfaceName));
TerminationPointBuilder tpBuilder = new TerminationPointBuilder();
- tpBuilder.setKey(tpKey);
+ tpBuilder.withKey(tpKey);
tpBuilder.setTpId(tpKey.getTpId());
OvsdbTerminationPointAugmentationBuilder tpAugmentationBuilder =
new OvsdbTerminationPointAugmentationBuilder();
@SuppressWarnings("unchecked")
private Optional<InstanceIdentifier<Node>> getTerminationPointBridge(
final ReadWriteTransaction transaction, Node node, String tpName) {
- OvsdbNodeAugmentation ovsdbNode = node.getAugmentation(OvsdbNodeAugmentation.class);
+ OvsdbNodeAugmentation ovsdbNode = node.augmentation(OvsdbNodeAugmentation.class);
List<ManagedNodeEntry> managedNodes = ovsdbNode.getManagedNodeEntry();
TpId tpId = new TpId(tpName);
for (ManagedNodeEntry managedNodeEntry : managedNodes) {
UUID qosUuid = qosUuidCol.iterator().next();
NodeId nodeId = node.getNodeId();
- OvsdbNodeAugmentation ovsdbNode = node.getAugmentation(OvsdbNodeAugmentation.class);
+ OvsdbNodeAugmentation ovsdbNode = node.augmentation(OvsdbNodeAugmentation.class);
// Delete an older QoS entry
if (portOldRows.containsKey(port.getKey()) && portOldRows.get(port.getKey()).getQosColumn() != null) {
List<QosEntry> qosList = new ArrayList<>();
OvsdbQosRef qosRef = new OvsdbQosRef(qosIid);
qosList.add(new QosEntryBuilder()
- .setKey(new QosEntryKey(Long.valueOf(SouthboundConstants.PORT_QOS_LIST_KEY)))
+ .withKey(new QosEntryKey(Long.valueOf(SouthboundConstants.PORT_QOS_LIST_KEY)))
.setQosRef(qosRef).build());
ovsdbTerminationPointBuilder.setQosEntry(qosList);
}
if (optionsKeyString != null && optionsValueString != null) {
OptionsKey optionsKey = new OptionsKey(optionsKeyString);
options.add(new OptionsBuilder()
- .setKey(optionsKey)
+ .withKey(optionsKey)
.setValue(optionsValueString).build());
}
}
String interfaceLldpValueString = entry.getValue();
if (interfaceLldpKeyString != null && interfaceLldpValueString != null) {
interfaceLldpList.add(new InterfaceLldpBuilder()
- .setKey(new InterfaceLldpKey(interfaceLldpKeyString))
+ .withKey(new InterfaceLldpKey(interfaceLldpKeyString))
.setLldpKey(interfaceLldpKeyString)
.setLldpValue(interfaceLldpValueString)
.build());
String interfaceBfdStatusValueString = entry.getValue();
if (interfaceBfdStatusKeyString != null && interfaceBfdStatusValueString != null) {
interfaceBfdStatusList.add(new InterfaceBfdStatusBuilder()
- .setKey(new InterfaceBfdStatusKey(interfaceBfdStatusKeyString))
+ .withKey(new InterfaceBfdStatusKey(interfaceBfdStatusKeyString))
.setBfdStatusKey(interfaceBfdStatusKeyString)
.setBfdStatusValue(interfaceBfdStatusValueString)
.build());
String interfaceBfdValueString = entry.getValue();
if (interfaceBfdKeyString != null && interfaceBfdValueString != null) {
interfaceBfdList.add(new InterfaceBfdBuilder()
- .setKey(new InterfaceBfdKey(interfaceBfdKeyString))
+ .withKey(new InterfaceBfdKey(interfaceBfdKeyString))
.setBfdKey(interfaceBfdKeyString)
.setBfdValue(interfaceBfdValueString)
.build());
}
private QosEntriesKey getQosEntriesKey(Node node, UUID qosUuid) {
- List<QosEntries> qosList = node.getAugmentation(OvsdbNodeAugmentation.class).getQosEntries();
+ List<QosEntries> qosList = node.augmentation(OvsdbNodeAugmentation.class).getQosEntries();
if (qosList == null || qosList.isEmpty()) {
LOG.debug("Deleting Qos {}, Ovsdb Node {} does not have a Qos list.", qosUuid.toString(), node);
return null;
while (itr.hasNext()) {
QosEntries qos = itr.next();
if (qos.getQosUuid().equals(quUuid)) {
- return qos.getKey();
+ return qos.key();
}
}
LOG.debug("Deleted Queue {} not found in Ovsdb Node {}", qosUuid.toString(), node);
LOG.debug("Update Ovsdb Node {} with qos entries {}",ovsdbNode.get(), qosEntry);
InstanceIdentifier<QosEntries> iid = nodeIId
.augmentation(OvsdbNodeAugmentation.class)
- .child(QosEntries.class, qosEntry.getKey());
+ .child(QosEntries.class, qosEntry.key());
transaction.merge(LogicalDatastoreType.OPERATIONAL,
iid, qosEntry);
}
return (InstanceIdentifier<Queues>) instanceIdentifierCodec.bindingDeserializerOrNull(
queue.getExternalIdsColumn().getData().get(SouthboundConstants.IID_EXTERNAL_ID_KEY));
} else {
- OvsdbNodeAugmentation node = ovsdbNode.getAugmentation(OvsdbNodeAugmentation.class);
+ OvsdbNodeAugmentation node = ovsdbNode.augmentation(OvsdbNodeAugmentation.class);
if (node.getQueues() != null && !node.getQueues().isEmpty()) {
for (Queues q : node.getQueues()) {
if (q.getQueueUuid().equals(new Uuid(queueUuid.toString()))) {
Qos qos, InstanceIdentifier<Node> nodeIId) {
InstanceIdentifier<QosEntries> qosIId = nodeIId
.augmentation(OvsdbNodeAugmentation.class)
- .child(QosEntries.class, qosEntryBuilder.build().getKey());
+ .child(QosEntries.class, qosEntryBuilder.build().key());
Set<String> otherConfigKeys = oldOtherConfigs.keySet();
for (String otherConfigKey : otherConfigKeys) {
KeyedInstanceIdentifier<QosOtherConfig, QosOtherConfigKey> otherIId =
Qos qos, InstanceIdentifier<Node> nodeIId) {
InstanceIdentifier<QosEntries> qosIId = nodeIId
.augmentation(OvsdbNodeAugmentation.class)
- .child(QosEntries.class, qosEntryBuilder.build().getKey());
+ .child(QosEntries.class, qosEntryBuilder.build().key());
Set<String> externalIdsKeys = oldExternalIds.keySet();
for (String extIdKey : externalIdsKeys) {
KeyedInstanceIdentifier<QosExternalIds, QosExternalIdsKey> externalIId =
Qos qos, InstanceIdentifier<Node> nodeIId) {
InstanceIdentifier<QosEntries> qosIId = nodeIId
.augmentation(OvsdbNodeAugmentation.class)
- .child(QosEntries.class, qosEntryBuilder.build().getKey());
+ .child(QosEntries.class, qosEntryBuilder.build().key());
Collection<Long> queueListKeys = oldQueueList.keySet();
for (Long queueListKey : queueListKeys) {
KeyedInstanceIdentifier<QueueList, QueueListKey> otherIId =
}
private QueuesKey getQueueKey(Node node, UUID queueUuid) {
- List<Queues> queueList = node.getAugmentation(OvsdbNodeAugmentation.class).getQueues();
+ List<Queues> queueList = node.augmentation(OvsdbNodeAugmentation.class).getQueues();
if (queueList == null || queueList.isEmpty()) {
LOG.debug("Deleting Queue {}, Ovsdb Node {} does not have a Queue list.", queueUuid.toString(), node);
return null;
while (itr.hasNext()) {
Queues queue = itr.next();
if (queue.getQueueUuid().equals(quUuid)) {
- return queue.getKey();
+ return queue.key();
}
}
LOG.debug("Deleted Queue {} not found in Ovsdb Node {}", queueUuid.toString(), node);
LOG.debug("Update Ovsdb Node {} with queue entries {}",ovsdbNode.get(), queues);
InstanceIdentifier<Queues> iid = nodeIId
.augmentation(OvsdbNodeAugmentation.class)
- .child(Queues.class, queues.getKey());
+ .child(Queues.class, queues.key());
transaction.merge(LogicalDatastoreType.OPERATIONAL,
iid, queues);
}
Queue queue, InstanceIdentifier<Node> nodeIId) {
InstanceIdentifier<Queues> queueIId = nodeIId
.augmentation(OvsdbNodeAugmentation.class)
- .child(Queues.class, queuesBuilder.build().getKey());
+ .child(Queues.class, queuesBuilder.build().key());
Set<String> otherConfigKeys = oldOtherConfigs.keySet();
for (String otherConfigKey : otherConfigKeys) {
KeyedInstanceIdentifier<QueuesOtherConfig, QueuesOtherConfigKey> otherIId =
Queue queue, InstanceIdentifier<Node> nodeIId) {
InstanceIdentifier<Queues> queueIId = nodeIId
.augmentation(OvsdbNodeAugmentation.class)
- .child(Queues.class, queuesBuilder.build().getKey());
+ .child(Queues.class, queuesBuilder.build().key());
Set<String> externalIdsKeys = oldExternalIds.keySet();
for (String extIdKey : externalIdsKeys) {
KeyedInstanceIdentifier<QueuesExternalIds, QueuesExternalIdsKey> externalIId =
List<ManagerEntry> managerEntriesCreated = new ArrayList<>();
//ovsdbNodeAugmentation is null
- when(ovsdbNode.getAugmentation(OvsdbNodeAugmentation.class)).thenReturn(null);
+ when(ovsdbNode.augmentation(OvsdbNodeAugmentation.class)).thenReturn(null);
assertEquals(managerEntriesCreated, SouthboundMapper.createManagerEntries(ovsdbNode, updatedManagerRows));
//ovsdbNodeAugmentation not null
OvsdbNodeAugmentation ovsdbNodeAugmentation = mock(OvsdbNodeAugmentation.class);
- when(ovsdbNode.getAugmentation(OvsdbNodeAugmentation.class)).thenReturn(ovsdbNodeAugmentation);
+ when(ovsdbNode.augmentation(OvsdbNodeAugmentation.class)).thenReturn(ovsdbNodeAugmentation);
List<ManagerEntry> managerEntries = new ArrayList<>();
ManagerEntry managerEntry = mock(ManagerEntry.class);
Node node = mock(Node.class);
OvsdbNodeAugmentation ovsdbNode = mock(OvsdbNodeAugmentation.class);
when(nf.get()).thenReturn(Optional.of(node));
- when(node.getAugmentation(OvsdbNodeAugmentation.class)).thenReturn(ovsdbNode);
+ when(node.augmentation(OvsdbNodeAugmentation.class)).thenReturn(ovsdbNode);
assertEquals("Failed to return correct Optional object", Optional.of(ovsdbNode),
SouthboundUtil.getManagingNode(db, mn));
public void testGetControllerTarget() throws Exception {
Node ovsdbNode = mock(Node.class);
OvsdbNodeAugmentation ovsdbNodeAugmentation = mock(OvsdbNodeAugmentation.class);
- when(ovsdbNode.getAugmentation(OvsdbNodeAugmentation.class)).thenReturn(ovsdbNodeAugmentation);
+ when(ovsdbNode.augmentation(OvsdbNodeAugmentation.class)).thenReturn(ovsdbNodeAugmentation);
ConnectionInfo connectionInfo = mock(ConnectionInfo.class, Mockito.RETURNS_DEEP_STUBS);
when(ovsdbNodeAugmentation.getConnectionInfo()).thenReturn(connectionInfo);
String testTarget = SouthboundConstants.OPENFLOW_CONNECTION_PROTOCOL + ":"
+ String.valueOf(ipAddress) + ":" + SouthboundConstants.DEFAULT_OPENFLOW_PORT;
assertEquals("Incorrect controller IP", testTarget, SouthboundUtil.getControllerTarget(ovsdbNode));
- verify(ovsdbNode).getAugmentation(OvsdbNodeAugmentation.class);
+ verify(ovsdbNode).augmentation(OvsdbNodeAugmentation.class);
verify(ovsdbNodeAugmentation).getConnectionInfo();
//ipAddr null case
Optional<Node> optNode = Optional.of(node);
when(briOperationState.getBridgeNode(any(InstanceIdentifier.class))).thenReturn(optNode);
OvsdbBridgeAugmentation ovsdbBriAug = mock(OvsdbBridgeAugmentation.class);
- when(node.getAugmentation(OvsdbBridgeAugmentation.class)).thenReturn(ovsdbBriAug);
+ when(node.augmentation(OvsdbBridgeAugmentation.class)).thenReturn(ovsdbBriAug);
Optional<OvsdbBridgeAugmentation> ovsdbBriAugOptional = briOperationState.getOvsdbBridgeAugmentation(iid);
assertNotNull(ovsdbBriAugOptional);
assertTrue(ovsdbBriAugOptional.get() instanceof OvsdbBridgeAugmentation);
when(briOperationState.getBridgeNode(any(InstanceIdentifier.class))).thenReturn(optNode);
when(node.getTerminationPoint()).thenReturn(termPntList);
TerminationPointKey termPntKey = mock(TerminationPointKey.class);
- when(termPnt.getKey()).thenReturn(termPntKey);
+ when(termPnt.key()).thenReturn(termPntKey);
final InstanceIdentifier<?> iid2 = PowerMockito.mock(InstanceIdentifier.class);
//PowerMockito.suppress(MemberMatcher.method(InstanceIdentifier.class, "firstKeyOf", Class.class, Class.class));
Optional<TerminationPoint> termPntOptional = Optional.of(termPoint);
when(briOperationState.getBridgeTerminationPoint(any(InstanceIdentifier.class))).thenReturn(termPntOptional);
OvsdbTerminationPointAugmentation ovsdbTermPntAug = mock(OvsdbTerminationPointAugmentation.class);
- when(termPoint.getAugmentation(OvsdbTerminationPointAugmentation.class)).thenReturn(ovsdbTermPntAug);
+ when(termPoint.augmentation(OvsdbTerminationPointAugmentation.class)).thenReturn(ovsdbTermPntAug);
Optional<OvsdbTerminationPointAugmentation> ovsdbTermPointOpt = briOperationState
.getOvsdbTerminationPointAugmentation(iid);
assertNotNull(ovsdbTermPointOpt);
OvsdbTerminationPointAugmentation terminationPoint = mock(OvsdbTerminationPointAugmentation.class);
when(terminationPoint.getName()).thenReturn(TERMINATION_POINT_NAME);
Node node = mock(Node.class);
- when(node.getAugmentation(OvsdbBridgeAugmentation.class)).thenReturn(mock(OvsdbBridgeAugmentation.class));
+ when(node.augmentation(OvsdbBridgeAugmentation.class)).thenReturn(mock(OvsdbBridgeAugmentation.class));
Optional<Node> optNode = Optional.of(node);
when(state.getBridgeNode(any(InstanceIdentifier.class))).thenReturn(optNode);
when((InstanceIdentifier<Node>)ovsdbNodeRef.getValue()).thenReturn(iid);
OvsdbBridgeName ovsdbBridgeName = new OvsdbBridgeName(bridgeName);
- when(bridgeNode.getAugmentation(OvsdbBridgeAugmentation.class)).thenReturn(ovsdbBridgeAugmentation);
+ when(bridgeNode.augmentation(OvsdbBridgeAugmentation.class)).thenReturn(ovsdbBridgeAugmentation);
when(ovsdbBridgeAugmentation.getBridgeName()).thenReturn(ovsdbBridgeName);
ProtocolEntry protocolEntry = mock(ProtocolEntry.class);
ProtocolEntryKey protocolEntryKey = mock(ProtocolEntryKey.class);
Mockito.when(protocolEntry.getProtocol()).thenAnswer(
(Answer<Class<? extends OvsdbBridgeProtocolBase>>) invocation -> OvsdbBridgeProtocolOpenflow10.class);
- when(protocolEntry.getKey()).thenReturn(protocolEntryKey);
+ when(protocolEntry.key()).thenReturn(protocolEntryKey);
when(ovsdbBridgeAugmentation.getProtocolEntry()).thenReturn(Collections.singletonList(protocolEntry));
ControllerEntry controllerEntry = mock(ControllerEntry.class);
ControllerEntryKey controllerEntryKey = mock(ControllerEntryKey.class);
- when(controllerEntry.getKey()).thenReturn(controllerEntryKey);
+ when(controllerEntry.key()).thenReturn(controllerEntryKey);
when(ovsdbBridgeAugmentation.getControllerEntry()).thenReturn(Collections.singletonList(controllerEntry));
when(ovsdbBridgeAugmentation.getManagedBy()).thenReturn(ovsdbNodeRef);
}
private Map<InstanceIdentifier<?>, DataObject> createExpectedConfigurationChanges(final Node bridgeNode) {
- OvsdbBridgeAugmentation ovsdbBridge = bridgeNode.getAugmentation(OvsdbBridgeAugmentation.class);
+ OvsdbBridgeAugmentation ovsdbBridge = bridgeNode.augmentation(OvsdbBridgeAugmentation.class);
Map<InstanceIdentifier<?>, DataObject> changes = new HashMap<>();
final InstanceIdentifier<Node> bridgeNodeIid =
changes.put(ovsdbBridgeIid, ovsdbBridge);
for (ProtocolEntry protocolEntry : ovsdbBridge.getProtocolEntry()) {
KeyedInstanceIdentifier<ProtocolEntry, ProtocolEntryKey> protocolIid =
- ovsdbBridgeIid.child(ProtocolEntry.class, protocolEntry.getKey());
+ ovsdbBridgeIid.child(ProtocolEntry.class, protocolEntry.key());
changes.put(protocolIid, protocolEntry);
}
for (ControllerEntry controller : ovsdbBridge.getControllerEntry()) {
KeyedInstanceIdentifier<ControllerEntry, ControllerEntryKey> controllerIid =
- ovsdbBridgeIid.child(ControllerEntry.class, controller.getKey());
+ ovsdbBridgeIid.child(ControllerEntry.class, controller.key());
changes.put(controllerIid, controller);
}
return changes;
when(SouthboundMapper.createInstanceIdentifier(nodeId)).thenReturn(nodeIid);
OvsdbNodeAugmentation ovsdbNodeAugmentation = mock(OvsdbNodeAugmentation.class);
- when(node.getAugmentation(OvsdbNodeAugmentation.class)).thenReturn(ovsdbNodeAugmentation);
+ when(node.augmentation(OvsdbNodeAugmentation.class)).thenReturn(ovsdbNodeAugmentation);
List<Autoattach> autoAttachList = new ArrayList<>();
Autoattach aaEntry = mock(Autoattach.class);
autoAttachList.add(aaEntry);
when(aaEntry.getAutoattachUuid()).thenReturn(new Uuid(AUTOATTACH_UUID.toString()));
when(ovsdbNodeAugmentation.getAutoattach()).thenReturn(autoAttachList);
- when(aaEntry.getKey()).thenReturn(aaKey);
+ when(aaEntry.key()).thenReturn(aaKey);
doNothing().when(transaction).delete(any(LogicalDatastoreType.class), any(InstanceIdentifier.class));
}
Optional<Node> ovsdbNode = Optional.of(node);
when(SouthboundUtil.readNode(transaction, connectionIId)).thenReturn(ovsdbNode);
OvsdbNodeAugmentation ovsdbNodeAugmentation = mock(OvsdbNodeAugmentation.class);
- when(node.getAugmentation(OvsdbNodeAugmentation.class)).thenReturn(ovsdbNodeAugmentation);
+ when(node.augmentation(OvsdbNodeAugmentation.class)).thenReturn(ovsdbNodeAugmentation);
List<ManagedNodeEntry> managedNodeEntries = new ArrayList<>();
ManagedNodeEntry managedNodeEntry = mock(ManagedNodeEntry.class);
PowerMockito.whenNew(NodeKey.class).withAnyArguments().thenReturn(nodeKey);
PowerMockito.whenNew(TopologyKey.class).withAnyArguments().thenReturn(mock(TopologyKey.class));
//PowerMockito.suppress(MemberMatcher.methodsDeclaredIn(InstanceIdentifier.class));
- when(controllerEntry.getKey()).thenReturn(mock(ControllerEntryKey.class));
+ when(controllerEntry.key()).thenReturn(mock(ControllerEntryKey.class));
assertEquals(KeyedInstanceIdentifier.class, (Whitebox
.invokeMethod(ovsdbControllerUpdateCommand, "getControllerEntryIid", controllerEntry, BRIDGE_NAME)
.getClass()));
PowerMockito.whenNew(NodeId.class).withAnyArguments().thenReturn(nodeId);
NodeKey nodeKey = mock(NodeKey.class);
PowerMockito.whenNew(NodeKey.class).withAnyArguments().thenReturn(nodeKey);
- when(managerEntry.getKey()).thenReturn(mock(ManagerEntryKey.class));
+ when(managerEntry.key()).thenReturn(mock(ManagerEntryKey.class));
assertEquals(KeyedInstanceIdentifier.class,
Whitebox.invokeMethod(ovsdbManagersUpdateCommand, "getManagerEntryIid", managerEntry).getClass());
}
Optional<Node> ovsdbNodeOptional = Optional.of(ovsdbNode);
when(ovsdbNodeFuture.get()).thenReturn(ovsdbNodeOptional);
OvsdbNodeAugmentation ovsdbNodeAugmentation = mock(OvsdbNodeAugmentation.class);
- when(ovsdbNode.getAugmentation(OvsdbNodeAugmentation.class)).thenReturn(ovsdbNodeAugmentation);
+ when(ovsdbNode.augmentation(OvsdbNodeAugmentation.class)).thenReturn(ovsdbNodeAugmentation);
PowerMockito.doReturn(true).when(ovsdbNodeRemoveCommand, "checkIfOnlyConnectedManager",
any(OvsdbNodeAugmentation.class));
PowerMockito.whenNew(TerminationPointKey.class).withAnyArguments().thenReturn(tpKey);
TerminationPointBuilder tpBuilder = mock(TerminationPointBuilder.class);
PowerMockito.whenNew(TerminationPointBuilder.class).withNoArguments().thenReturn(tpBuilder);
- when(tpBuilder.setKey(any(TerminationPointKey.class))).thenReturn(tpBuilder);
+ when(tpBuilder.withKey(any(TerminationPointKey.class))).thenReturn(tpBuilder);
when(tpKey.getTpId()).thenReturn(mock(TpId.class));
when(tpBuilder.setTpId(any(TpId.class))).thenReturn(tpBuilder);
InstanceIdentifier<TerminationPoint> tpPath = mock(InstanceIdentifier.class);
public void testGetTerminationPointBridge1() throws Exception {
Node node = mock(Node.class);
OvsdbNodeAugmentation ovsdbNode = mock(OvsdbNodeAugmentation.class);
- when(node.getAugmentation(OvsdbNodeAugmentation.class)).thenReturn(ovsdbNode);
+ when(node.augmentation(OvsdbNodeAugmentation.class)).thenReturn(ovsdbNode);
List<ManagedNodeEntry> managedNodes = new ArrayList<>();
ManagedNodeEntry managedNodeEntry = mock(ManagedNodeEntry.class);
managedNodes.add(managedNodeEntry);
PowerMockito.whenNew(TerminationPointBuilder.class).withNoArguments().thenReturn(tpBuilder);
PowerMockito.whenNew(TpId.class).withAnyArguments().thenReturn(mock(TpId.class));
PowerMockito.whenNew(TerminationPointKey.class).withAnyArguments().thenReturn(mock(TerminationPointKey.class));
- when(tpBuilder.setKey(any(TerminationPointKey.class))).thenReturn(tpBuilder);
+ when(tpBuilder.withKey(any(TerminationPointKey.class))).thenReturn(tpBuilder);
List<TerminationPoint> terminationPointList = new ArrayList<>();
TerminationPoint terminationPoint = mock(TerminationPoint.class);
when(tpBuilder.build()).thenReturn(terminationPoint);
when(managedNode.getTerminationPoint()).thenReturn(terminationPointList);
- when(managedNode.getAugmentation(OvsdbBridgeAugmentation.class))
+ when(managedNode.augmentation(OvsdbBridgeAugmentation.class))
.thenReturn(mock(OvsdbBridgeAugmentation.class));
TpId tpId = new TpId(TP_NAME);
when(terminationPoint.getTpId()).thenReturn(tpId);
(InstanceIdentifier)iid), OPERATIONAL_LISTENER);
ovsdbNode = connectOvsdbNode(connectionInfo);
- OvsdbNodeAugmentation ovsdbNodeAugmentation = ovsdbNode.getAugmentation(OvsdbNodeAugmentation.class);
+ OvsdbNodeAugmentation ovsdbNodeAugmentation = ovsdbNode.augmentation(OvsdbNodeAugmentation.class);
assertNotNull("The OvsdbNodeAugmentation cannot be null", ovsdbNodeAugmentation);
schemaVersion = Version.fromString(ovsdbNodeAugmentation.getDbVersion());
LOG.info("schemaVersion = {}", schemaVersion);
@Test
public void testDpdkSwitch() throws InterruptedException {
ConnectionInfo connectionInfo = getConnectionInfo(addressStr, portNumber);
- List<DatapathTypeEntry> datapathTypeEntries = ovsdbNode.getAugmentation(OvsdbNodeAugmentation.class)
+ List<DatapathTypeEntry> datapathTypeEntries = ovsdbNode.augmentation(OvsdbNodeAugmentation.class)
.getDatapathTypeEntry();
if (datapathTypeEntries == null) {
LOG.info("DPDK not supported on this node.");
List<TerminationPoint> terminationPoints = terminationPointNode.getTerminationPoint();
for (TerminationPoint terminationPoint : terminationPoints) {
OvsdbTerminationPointAugmentation ovsdbTerminationPointAugmentation = terminationPoint
- .getAugmentation(OvsdbTerminationPointAugmentation.class);
+ .augmentation(OvsdbTerminationPointAugmentation.class);
if (ovsdbTerminationPointAugmentation.getName().equals(testPortname)) {
Class<? extends InterfaceTypeBase> opPort = ovsdbTerminationPointAugmentation
.getInterfaceType();
@Test
public void testOvsdbNodeOvsVersion() throws InterruptedException {
- OvsdbNodeAugmentation ovsdbNodeAugmentation = ovsdbNode.getAugmentation(OvsdbNodeAugmentation.class);
+ OvsdbNodeAugmentation ovsdbNodeAugmentation = ovsdbNode.augmentation(OvsdbNodeAugmentation.class);
Assert.assertNotNull(ovsdbNodeAugmentation);
assertNotNull(ovsdbNodeAugmentation.getOvsVersion());
}
@Test
public void testOvsdbNodeDbVersion() throws InterruptedException {
- OvsdbNodeAugmentation ovsdbNodeAugmentation = ovsdbNode.getAugmentation(OvsdbNodeAugmentation.class);
+ OvsdbNodeAugmentation ovsdbNodeAugmentation = ovsdbNode.augmentation(OvsdbNodeAugmentation.class);
Assert.assertNotNull(ovsdbNodeAugmentation);
assertNotNull(ovsdbNodeAugmentation.getDbVersion());
}
@Test
public void testOpenVSwitchOtherConfig() throws InterruptedException {
- OvsdbNodeAugmentation ovsdbNodeAugmentation = ovsdbNode.getAugmentation(OvsdbNodeAugmentation.class);
+ OvsdbNodeAugmentation ovsdbNodeAugmentation = ovsdbNode.augmentation(OvsdbNodeAugmentation.class);
Assert.assertNotNull(ovsdbNodeAugmentation);
List<OpenvswitchOtherConfigs> otherConfigsList = ovsdbNodeAugmentation.getOpenvswitchOtherConfigs();
if (otherConfigsList != null) {
NodeId portNodeId = SouthboundMapper.createManagedNodeId(portIid);
portNodeBuilder.setNodeId(portNodeId);
TerminationPointBuilder entry = new TerminationPointBuilder();
- entry.setKey(new TerminationPointKey(new TpId(portName)));
+ entry.withKey(new TerminationPointKey(new TpId(portName)));
entry.addAugmentation(
OvsdbTerminationPointAugmentation.class,
ovsdbTerminationPointAugmentationBuilder.build());
.build();
InstanceIdentifier<Autoattach> iid = SouthboundUtils.createInstanceIdentifier(connectionInfo)
.augmentation(OvsdbNodeAugmentation.class)
- .child(Autoattach.class, aaEntry.getKey());
+ .child(Autoattach.class, aaEntry.key());
final NotifyingDataChangeListener aaOperationalListener =
new NotifyingDataChangeListener(LogicalDatastoreType.OPERATIONAL, iid);
aaOperationalListener.registerDataChangeListener();
.build();
InstanceIdentifier<Autoattach> iid = SouthboundUtils.createInstanceIdentifier(connectionInfo)
.augmentation(OvsdbNodeAugmentation.class)
- .child(Autoattach.class, updatedAa.getKey());
+ .child(Autoattach.class, updatedAa.key());
final NotifyingDataChangeListener aaOperationalListener =
new NotifyingDataChangeListener(LogicalDatastoreType.OPERATIONAL, iid);
aaOperationalListener.registerDataChangeListener();
if (ovsdbNodeAugmentation.getAutoattach() != null
&& !ovsdbNodeAugmentation.getAutoattach().isEmpty()) {
for (Autoattach aa : ovsdbNodeAugmentation.getAutoattach()) {
- if (aa.getKey().getAutoattachId().equals(uri)) {
+ if (aa.key().getAutoattachId().equals(uri)) {
return aa;
}
}
.build();
InstanceIdentifier<QosEntries> qeIid = SouthboundUtils.createInstanceIdentifier(connectionInfo)
.augmentation(OvsdbNodeAugmentation.class)
- .child(QosEntries.class, qosEntry.getKey());
+ .child(QosEntries.class, qosEntry.key());
final NotifyingDataChangeListener qosOperationalListener =
new NotifyingDataChangeListener(LogicalDatastoreType.OPERATIONAL, qeIid);
qosOperationalListener.registerDataChangeListener();
.build();
queueIid = SouthboundUtils.createInstanceIdentifier(connectionInfo)
.augmentation(OvsdbNodeAugmentation.class)
- .child(Queues.class, queue.getKey());
+ .child(Queues.class, queue.key());
final NotifyingDataChangeListener queueOperationalListener =
new NotifyingDataChangeListener(LogicalDatastoreType.OPERATIONAL, queueIid);
queueOperationalListener.registerDataChangeListener();
InstanceIdentifier<Node> nodeIid = SouthboundUtils.createInstanceIdentifier(connectionInfo);
Node node = mdsalUtils.read(store, nodeIid);
Assert.assertNotNull(node);
- OvsdbNodeAugmentation ovsdbNodeAugmentation = node.getAugmentation(OvsdbNodeAugmentation.class);
+ OvsdbNodeAugmentation ovsdbNodeAugmentation = node.augmentation(OvsdbNodeAugmentation.class);
Assert.assertNotNull(ovsdbNodeAugmentation);
return ovsdbNodeAugmentation;
}
LogicalDatastoreType store) {
Node bridgeNode = getBridgeNode(connectionInfo, bridgeName, store);
Assert.assertNotNull(bridgeNode);
- OvsdbBridgeAugmentation ovsdbBridgeAugmentation = bridgeNode.getAugmentation(OvsdbBridgeAugmentation.class);
+ OvsdbBridgeAugmentation ovsdbBridgeAugmentation = bridgeNode.augmentation(OvsdbBridgeAugmentation.class);
Assert.assertNotNull(ovsdbBridgeAugmentation);
return ovsdbBridgeAugmentation;
}
if (tpList == null) {
return null;
}
- return tpList.get(index).getAugmentation(OvsdbTerminationPointAugmentation.class);
+ return tpList.get(index).augmentation(OvsdbTerminationPointAugmentation.class);
}
@Test
List<TerminationPoint> terminationPoints = terminationPointNode.getTerminationPoint();
for (TerminationPoint terminationPoint : terminationPoints) {
OvsdbTerminationPointAugmentation ovsdbTerminationPointAugmentation =
- terminationPoint.getAugmentation(OvsdbTerminationPointAugmentation.class);
+ terminationPoint.augmentation(OvsdbTerminationPointAugmentation.class);
if (ovsdbTerminationPointAugmentation.getName().equals(portName)) {
Long ifIndex = ovsdbTerminationPointAugmentation.getIfindex();
Assert.assertNotNull(ifIndex);
List<TerminationPoint> terminationPoints = terminationPointNode.getTerminationPoint();
for (TerminationPoint terminationPoint : terminationPoints) {
OvsdbTerminationPointAugmentation ovsdbTerminationPointAugmentation =
- terminationPoint.getAugmentation(OvsdbTerminationPointAugmentation.class);
+ terminationPoint.augmentation(OvsdbTerminationPointAugmentation.class);
if (ovsdbTerminationPointAugmentation.getName().equals(portName)) {
Long ofPort = ovsdbTerminationPointAugmentation.getOfport();
// if ephemeral port 45002 is in use, ofPort is set to 1
List<TerminationPoint> terminationPoints = terminationPointNode.getTerminationPoint();
for (TerminationPoint terminationPoint : terminationPoints) {
OvsdbTerminationPointAugmentation ovsdbTerminationPointAugmentation =
- terminationPoint.getAugmentation(OvsdbTerminationPointAugmentation.class);
+ terminationPoint.augmentation(OvsdbTerminationPointAugmentation.class);
if (ovsdbTerminationPointAugmentation.getName().equals(portName)) {
Long ofPort = ovsdbTerminationPointAugmentation.getOfport();
// if ephemeral port 45008 is in use, ofPort is set to 1
NodeId portUpdateNodeId = SouthboundUtils.createManagedNodeId(portIid);
portUpdateNodeBuilder.setNodeId(portUpdateNodeId);
TerminationPointBuilder tpUpdateBuilder = new TerminationPointBuilder();
- tpUpdateBuilder.setKey(new TerminationPointKey(new TpId(testBridgeAndPortName)));
+ tpUpdateBuilder.withKey(new TerminationPointKey(new TpId(testBridgeAndPortName)));
tpUpdateBuilder.addAugmentation(
OvsdbTerminationPointAugmentation.class,
tpUpdateAugmentationBuilder.build());
List<TerminationPoint> terminationPoints = terminationPointNode.getTerminationPoint();
OvsdbTerminationPointAugmentation ovsdbTerminationPointAugmentation;
for (TerminationPoint terminationPoint : terminationPoints) {
- ovsdbTerminationPointAugmentation = terminationPoint.getAugmentation(
+ ovsdbTerminationPointAugmentation = terminationPoint.augmentation(
OvsdbTerminationPointAugmentation.class);
if (ovsdbTerminationPointAugmentation.getName().equals(portName)) {
VlanId actualVlanId = ovsdbTerminationPointAugmentation.getVlanTag();
NodeId portUpdateNodeId = SouthboundUtils.createManagedNodeId(portIid);
portUpdateNodeBuilder.setNodeId(portUpdateNodeId);
TerminationPointBuilder tpUpdateBuilder = new TerminationPointBuilder();
- tpUpdateBuilder.setKey(new TerminationPointKey(new TpId(portName)));
+ tpUpdateBuilder.withKey(new TerminationPointKey(new TpId(portName)));
tpUpdateBuilder.addAugmentation(
OvsdbTerminationPointAugmentation.class,
tpUpdateAugmentationBuilder.build());
terminationPointNode = mdsalUtils.read(LogicalDatastoreType.OPERATIONAL, terminationPointIid);
terminationPoints = terminationPointNode.getTerminationPoint();
for (TerminationPoint terminationPoint : terminationPoints) {
- ovsdbTerminationPointAugmentation = terminationPoint.getAugmentation(
+ ovsdbTerminationPointAugmentation = terminationPoint.augmentation(
OvsdbTerminationPointAugmentation.class);
if (ovsdbTerminationPointAugmentation.getName().equals(portName)) {
VlanId actualVlanId = ovsdbTerminationPointAugmentation.getVlanTag();
List<TerminationPoint> terminationPoints = terminationPointNode.getTerminationPoint();
for (TerminationPoint terminationPoint : terminationPoints) {
OvsdbTerminationPointAugmentation ovsdbTerminationPointAugmentation =
- terminationPoint.getAugmentation(OvsdbTerminationPointAugmentation.class);
+ terminationPoint.augmentation(OvsdbTerminationPointAugmentation.class);
if (ovsdbTerminationPointAugmentation.getName().equals(portName)) {
//test
Assert.assertTrue(ovsdbTerminationPointAugmentation.getVlanMode().equals(vlanMode));
NodeId portUpdateNodeId = SouthboundUtils.createManagedNodeId(portIid);
portUpdateNodeBuilder.setNodeId(portUpdateNodeId);
TerminationPointBuilder tpUpdateBuilder = new TerminationPointBuilder();
- tpUpdateBuilder.setKey(new TerminationPointKey(new TpId(portName)));
+ tpUpdateBuilder.withKey(new TerminationPointKey(new TpId(portName)));
tpUpdateBuilder.addAugmentation(
OvsdbTerminationPointAugmentation.class,
tpUpdateAugmentationBuilder.build());
terminationPoints = terminationPointNode.getTerminationPoint();
for (TerminationPoint terminationPoint : terminationPoints) {
OvsdbTerminationPointAugmentation ovsdbTerminationPointAugmentation =
- terminationPoint.getAugmentation(OvsdbTerminationPointAugmentation.class);
+ terminationPoint.augmentation(OvsdbTerminationPointAugmentation.class);
if (ovsdbTerminationPointAugmentation.getName().equals(portName)) {
//test
Assert.assertEquals(updatedVlanMode, ovsdbTerminationPointAugmentation.getVlanMode());
List<TerminationPoint> terminationPoints = terminationPointNode.getTerminationPoint();
for (TerminationPoint terminationPoint : terminationPoints) {
OvsdbTerminationPointAugmentation ovsdbTerminationPointAugmentation =
- terminationPoint.getAugmentation(OvsdbTerminationPointAugmentation.class);
+ terminationPoint.augmentation(OvsdbTerminationPointAugmentation.class);
if (ovsdbTerminationPointAugmentation.getName().equals(portName)) {
List<Trunks> actualTrunks = ovsdbTerminationPointAugmentation.getTrunks();
for (Trunks trunk : trunks) {
NodeId portUpdateNodeId = SouthboundUtils.createManagedNodeId(portIid);
portUpdateNodeBuilder.setNodeId(portUpdateNodeId);
TerminationPointBuilder tpUpdateBuilder = new TerminationPointBuilder();
- tpUpdateBuilder.setKey(new TerminationPointKey(new TpId(portName)));
+ tpUpdateBuilder.withKey(new TerminationPointKey(new TpId(portName)));
tpUpdateBuilder.addAugmentation(
OvsdbTerminationPointAugmentation.class,
tpUpdateAugmentationBuilder.build());
terminationPoints = terminationPointNode.getTerminationPoint();
for (TerminationPoint terminationPoint : terminationPoints) {
OvsdbTerminationPointAugmentation ovsdbTerminationPointAugmentation =
- terminationPoint.getAugmentation(OvsdbTerminationPointAugmentation.class);
+ terminationPoint.augmentation(OvsdbTerminationPointAugmentation.class);
if (ovsdbTerminationPointAugmentation.getName().equals(portName)) {
//test
Assert.assertEquals(updatedTrunks, ovsdbTerminationPointAugmentation.getTrunks());
new OvsdbTerminationPointAugmentationBuilder();
tpUpdateAugmentationBuilder.setName(portName);
TerminationPointBuilder tpUpdateBuilder = new TerminationPointBuilder();
- tpUpdateBuilder.setKey(new TerminationPointKey(new TpId(portName)));
+ tpUpdateBuilder.withKey(new TerminationPointKey(new TpId(portName)));
tpUpdateBuilder.addAugmentation(
OvsdbTerminationPointAugmentation.class,
tpUpdateAugmentationBuilder.build());
final NodeBuilder bridgeUpdateNodeBuilder = new NodeBuilder();
final Node bridgeNode = getBridgeNode(connectionInfo, testBridgeName);
bridgeUpdateNodeBuilder.setNodeId(bridgeNode.getNodeId());
- bridgeUpdateNodeBuilder.setKey(bridgeNode.getKey());
+ bridgeUpdateNodeBuilder.withKey(bridgeNode.key());
bridgeUpdateNodeBuilder.addAugmentation(OvsdbBridgeAugmentation.class,
bridgeUpdateAugmentationBuilder.build());
Assert.assertTrue(mdsalUtils.merge(LogicalDatastoreType.CONFIGURATION, bridgeIid,
private Queues getQueue(Uri queueId, OvsdbNodeAugmentation node) {
for (Queues queue : node.getQueues()) {
- if (queue.getKey().getQueueId().getValue().equals(queueId.getValue())) {
+ if (queue.key().getQueueId().getValue().equals(queueId.getValue())) {
return queue;
}
}
private QosEntries getQos(Uri qosId, OvsdbNodeAugmentation node) {
for (QosEntries qos : node.getQosEntries()) {
- if (qos.getKey().getQosId().equals(qosId)) {
+ if (qos.key().getQosId().equals(qosId)) {
return qos;
}
}
queuesBuilder.setQueueId(new Uri(testQueueId));
InstanceIdentifier<Queues> queueIid = SouthboundUtils.createInstanceIdentifier(connectionInfo)
.augmentation(OvsdbNodeAugmentation.class)
- .child(Queues.class, queuesBuilder.build().getKey());
+ .child(Queues.class, queuesBuilder.build().key());
final NotifyingDataChangeListener queueConfigurationListener =
new NotifyingDataChangeListener(LogicalDatastoreType.CONFIGURATION, queueIid);
queueConfigurationListener.registerDataChangeListener();
queuesBuilder.setQueueId(new Uri(testQueueId));
InstanceIdentifier<Queues> queueIid = SouthboundUtils.createInstanceIdentifier(connectionInfo)
.augmentation(OvsdbNodeAugmentation.class)
- .child(Queues.class, queuesBuilder.build().getKey());
+ .child(Queues.class, queuesBuilder.build().key());
final NotifyingDataChangeListener queueOperationalListener =
new NotifyingDataChangeListener(LogicalDatastoreType.OPERATIONAL, queueIid);
queueOperationalListener.registerDataChangeListener();
qosBuilder.setQosId(new Uri(testQosId));
InstanceIdentifier<QosEntries> qosIid = SouthboundUtils.createInstanceIdentifier(connectionInfo)
.augmentation(OvsdbNodeAugmentation.class)
- .child(QosEntries.class, qosBuilder.build().getKey());
+ .child(QosEntries.class, qosBuilder.build().key());
final NotifyingDataChangeListener qosConfigurationListener =
new NotifyingDataChangeListener(LogicalDatastoreType.CONFIGURATION, qosIid);
qosConfigurationListener.registerDataChangeListener();
qosBuilder.setQosId(new Uri(testQosId));
InstanceIdentifier<QosEntries> qosIid = SouthboundUtils.createInstanceIdentifier(connectionInfo)
.augmentation(OvsdbNodeAugmentation.class)
- .child(QosEntries.class, qosBuilder.build().getKey());
+ .child(QosEntries.class, qosBuilder.build().key());
final NotifyingDataChangeListener qosOperationalListener =
new NotifyingDataChangeListener(LogicalDatastoreType.OPERATIONAL, qosIid);
qosOperationalListener.registerDataChangeListener();
private static final NodeId NODE_ID = new NodeId("test");
private static final NodeKey NODE_KEY = new NodeKey(NODE_ID);
- private static final Node DATA = new NodeBuilder().setKey(NODE_KEY).setNodeId(NODE_ID).build();
+ private static final Node DATA = new NodeBuilder().withKey(NODE_KEY).setNodeId(NODE_ID).build();
private static final InstanceIdentifier<Node> TEST_IID = InstanceIdentifier
.create(NetworkTopology.class)
@Test
public void testPutWithoutCallback() {
final String operationDesc = "testPut";
- final SupportingNode supportingNodeBuilder1 = new SupportingNodeBuilder().setKey(
+ final SupportingNode supportingNodeBuilder1 = new SupportingNodeBuilder().withKey(
new SupportingNodeKey(new NodeId("id1"), TOPOLOGY_TEST)).build();
- final SupportingNode supportingNodeBuilder2 = new SupportingNodeBuilder().setKey(
+ final SupportingNode supportingNodeBuilder2 = new SupportingNodeBuilder().withKey(
new SupportingNodeKey(new NodeId("id2"), TOPOLOGY_TEST)).build();
final Node data1 = new NodeBuilder(DATA).setSupportingNode(
@Test
public void testMerge() {
final String operationDesc = "testMerge";
- final SupportingNode supportingNodeBuilder1 = new SupportingNodeBuilder().setKey(
+ final SupportingNode supportingNodeBuilder1 = new SupportingNodeBuilder().withKey(
new SupportingNodeKey(new NodeId("id1"), TOPOLOGY_TEST)).build();
- final SupportingNode supportingNodeBuilder2 = new SupportingNodeBuilder().setKey(
+ final SupportingNode supportingNodeBuilder2 = new SupportingNodeBuilder().withKey(
new SupportingNodeKey(new NodeId("id2"), TOPOLOGY_TEST)).build();
final Node data1 = new NodeBuilder(DATA).setSupportingNode(
InstanceIdentifier<TerminationPoint> terminationPointPath = InstanceIdentifier
.create(NetworkTopology.class)
.child(Topology.class, new TopologyKey(OVSDB_TOPOLOGY_ID))
- .child(Node.class,node.getKey())
+ .child(Node.class,node.key())
.child(TerminationPoint.class, new TerminationPointKey(new TpId(portName)));
LOG.debug("Termination point InstanceIdentifier generated : {}",terminationPointPath);
}
public OvsdbNodeAugmentation extractOvsdbNode(Node node) {
- return node.getAugmentation(OvsdbNodeAugmentation.class);
+ return node.augmentation(OvsdbNodeAugmentation.class);
}
public static IpAddress createIpAddress(InetAddress address) {
OvsdbBridgeAugmentation ovsdbBridgeAugmentation = null;
Node bridgeNode = getBridgeNode(connectionInfo, bridgeName, store);
if (bridgeNode != null) {
- ovsdbBridgeAugmentation = bridgeNode.getAugmentation(OvsdbBridgeAugmentation.class);
+ ovsdbBridgeAugmentation = bridgeNode.augmentation(OvsdbBridgeAugmentation.class);
}
return ovsdbBridgeAugmentation;
}
ConnectionInfo connectionInfo = getConnectionInfo(ovsdbNode);
if (connectionInfo != null) {
InstanceIdentifier<Node> bridgeIid =
- createInstanceIdentifier(node.getKey(), name);
+ createInstanceIdentifier(node.key(), name);
bridgeNode = mdsalUtils.read(LogicalDatastoreType.OPERATIONAL, bridgeIid);
}
return bridgeNode;
}
public OvsdbNodeAugmentation extractNodeAugmentation(Node node) {
- return node.getAugmentation(OvsdbNodeAugmentation.class);
+ return node.augmentation(OvsdbNodeAugmentation.class);
}
public OvsdbBridgeAugmentation extractBridgeAugmentation(Node node) {
if (node == null) {
return null;
}
- return node.getAugmentation(OvsdbBridgeAugmentation.class);
+ return node.augmentation(OvsdbBridgeAugmentation.class);
}
public Node readOvsdbNode(Node bridgeNode) {
ConnectionInfo connectionInfo = getConnectionInfo(ovsdbNode);
if (connectionInfo != null) {
NodeBuilder bridgeNodeBuilder = new NodeBuilder();
- InstanceIdentifier<Node> bridgeIid = createInstanceIdentifier(ovsdbNode.getKey(), bridgeName);
+ InstanceIdentifier<Node> bridgeIid = createInstanceIdentifier(ovsdbNode.key(), bridgeName);
NodeId bridgeNodeId = createManagedNodeId(bridgeIid);
bridgeNodeBuilder.setNodeId(bridgeNodeId);
OvsdbBridgeAugmentationBuilder ovsdbBridgeAugmentationBuilder = new OvsdbBridgeAugmentationBuilder();
bridgeOtherConfigsBuilder.setBridgeOtherConfigValue("true");
otherConfigs.add(bridgeOtherConfigsBuilder.build());
ovsdbBridgeAugmentationBuilder.setBridgeOtherConfigs(otherConfigs);
- setManagedByForBridge(ovsdbBridgeAugmentationBuilder, ovsdbNode.getKey());
+ setManagedByForBridge(ovsdbBridgeAugmentationBuilder, ovsdbNode.key());
if (dpType != null) {
ovsdbBridgeAugmentationBuilder.setDatapathType(dpType);
}
LOG.debug("setBridgeController: ovsdbNode: {}, bridgeNode: {}, controller(s): {}",
ovsdbNode, bridgeName, controllers);
- InstanceIdentifier<Node> bridgeNodeIid = createInstanceIdentifier(ovsdbNode.getKey(), bridgeName);
+ InstanceIdentifier<Node> bridgeNodeIid = createInstanceIdentifier(ovsdbNode.key(), bridgeName);
Node bridgeNode = mdsalUtils.read(LogicalDatastoreType.CONFIGURATION, bridgeNodeIid);
if (bridgeNode == null) {
LOG.info("setBridgeController could not find bridge in configuration {}", bridgeNodeIid);
augBuilder.setControllerEntry(newControllerEntries);
nodeBuilder.addAugmentation(OvsdbBridgeAugmentation.class, augBuilder.build());
- InstanceIdentifier<Node> bridgeIid = createInstanceIdentifier(ovsdbNode.getKey(), bridgeName);
+ InstanceIdentifier<Node> bridgeIid = createInstanceIdentifier(ovsdbNode.key(), bridgeName);
return mdsalUtils.merge(LogicalDatastoreType.CONFIGURATION, bridgeIid, nodeBuilder.build());
}
List<Options> optionsList = new ArrayList<>();
for (Map.Entry<String, String> entry : options.entrySet()) {
OptionsBuilder optionsBuilder = new OptionsBuilder();
- optionsBuilder.setKey(new OptionsKey(entry.getKey()));
+ optionsBuilder.withKey(new OptionsKey(entry.getKey()));
optionsBuilder.setOption(entry.getKey());
optionsBuilder.setValue(entry.getValue());
optionsList.add(optionsBuilder.build());
List<InterfaceExternalIds> externalIdsList = new ArrayList<>();
for (Map.Entry<String, String> entry : externalIds.entrySet()) {
InterfaceExternalIdsBuilder interfaceExternalIdsBuilder = new InterfaceExternalIdsBuilder();
- interfaceExternalIdsBuilder.setKey(new InterfaceExternalIdsKey(entry.getKey()));
+ interfaceExternalIdsBuilder.withKey(new InterfaceExternalIdsKey(entry.getKey()));
interfaceExternalIdsBuilder.setExternalIdKey(entry.getKey());
interfaceExternalIdsBuilder.setExternalIdValue(entry.getValue());
externalIdsList.add(interfaceExternalIdsBuilder.build());
TerminationPointBuilder tpBuilder = new TerminationPointBuilder();
InstanceIdentifier<TerminationPoint> tpIid = createTerminationPointInstanceIdentifier(bridgeNode, portName);
- tpBuilder.setKey(InstanceIdentifier.keyOf(tpIid));
+ tpBuilder.withKey(InstanceIdentifier.keyOf(tpIid));
tpBuilder.addAugmentation(OvsdbTerminationPointAugmentation.class, tpAugmentationBuilder.build());
/* TODO SB_MIGRATION should this be merge or mdsalUtils.put */
return mdsalUtils.put(LogicalDatastoreType.CONFIGURATION, tpIid, tpBuilder.build());
List<Options> optionsList = new ArrayList<>();
for (Map.Entry<String, String> entry : options.entrySet()) {
OptionsBuilder optionsBuilder = new OptionsBuilder();
- optionsBuilder.setKey(new OptionsKey(entry.getKey()));
+ optionsBuilder.withKey(new OptionsKey(entry.getKey()));
optionsBuilder.setOption(entry.getKey());
optionsBuilder.setValue(entry.getValue());
optionsList.add(optionsBuilder.build());
TerminationPointBuilder tpBuilder = new TerminationPointBuilder();
InstanceIdentifier<TerminationPoint> tpIid = createTerminationPointInstanceIdentifier(bridgeNode, portName);
- tpBuilder.setKey(InstanceIdentifier.keyOf(tpIid));
+ tpBuilder.withKey(InstanceIdentifier.keyOf(tpIid));
tpBuilder.addAugmentation(OvsdbTerminationPointAugmentation.class, tpAugmentationBuilder.build());
/* TODO SB_MIGRATION should this be merge or mdsalUtils.put */
return mdsalUtils.put(LogicalDatastoreType.CONFIGURATION, tpIid, tpBuilder.build());
tpAugmentationBuilder.setInterfaceType(OVSDB_INTERFACE_TYPE_MAP.get(type));
}
TerminationPointBuilder tpBuilder = new TerminationPointBuilder();
- tpBuilder.setKey(InstanceIdentifier.keyOf(tpIid));
+ tpBuilder.withKey(InstanceIdentifier.keyOf(tpIid));
tpBuilder.addAugmentation(OvsdbTerminationPointAugmentation.class, tpAugmentationBuilder.build());
return mdsalUtils.put(LogicalDatastoreType.CONFIGURATION, tpIid, tpBuilder.build());
}
}
public String getDatapathId(Node node) {
- OvsdbBridgeAugmentation ovsdbBridgeAugmentation = node.getAugmentation(OvsdbBridgeAugmentation.class);
+ OvsdbBridgeAugmentation ovsdbBridgeAugmentation = node.augmentation(OvsdbBridgeAugmentation.class);
return getDatapathId(ovsdbBridgeAugmentation);
}
}
public String extractBridgeName(Node node) {
- return node.getAugmentation(OvsdbBridgeAugmentation.class).getBridgeName().getValue();
+ return node.augmentation(OvsdbBridgeAugmentation.class).getBridgeName().getValue();
}
public boolean isBridgeOnOvsdbNode(Node ovsdbNode, String bridgeName) {
public OvsdbBridgeAugmentation getBridgeFromConfig(Node node, String bridge) {
OvsdbBridgeAugmentation ovsdbBridgeAugmentation = null;
InstanceIdentifier<Node> bridgeIid =
- createInstanceIdentifier(node.getKey(), bridge);
+ createInstanceIdentifier(node.key(), bridge);
Node bridgeNode = mdsalUtils.read(LogicalDatastoreType.CONFIGURATION, bridgeIid);
if (bridgeNode != null) {
- ovsdbBridgeAugmentation = bridgeNode.getAugmentation(OvsdbBridgeAugmentation.class);
+ ovsdbBridgeAugmentation = bridgeNode.augmentation(OvsdbBridgeAugmentation.class);
}
return ovsdbBridgeAugmentation;
}
}
public OvsdbTerminationPointAugmentation extractTerminationPointAugmentation(Node bridgeNode, String portName) {
- if (bridgeNode.getAugmentation(OvsdbBridgeAugmentation.class) != null) {
+ if (bridgeNode.augmentation(OvsdbBridgeAugmentation.class) != null) {
List<OvsdbTerminationPointAugmentation> tpAugmentations = extractTerminationPointAugmentations(bridgeNode);
for (OvsdbTerminationPointAugmentation ovsdbTerminationPointAugmentation : tpAugmentations) {
if (ovsdbTerminationPointAugmentation.getName().equals(portName)) {
if (terminationPoints != null && !terminationPoints.isEmpty()) {
for (TerminationPoint tp : terminationPoints) {
OvsdbTerminationPointAugmentation ovsdbTerminationPointAugmentation =
- tp.getAugmentation(OvsdbTerminationPointAugmentation.class);
+ tp.augmentation(OvsdbTerminationPointAugmentation.class);
if (ovsdbTerminationPointAugmentation != null) {
tpAugmentations.add(ovsdbTerminationPointAugmentation);
}
* @return the value for key or null if key not found
*/
public String getOpenvswitchOtherConfig(Node node, String key) {
- OvsdbNodeAugmentation ovsdbNode = node.getAugmentation(OvsdbNodeAugmentation.class);
+ OvsdbNodeAugmentation ovsdbNode = node.augmentation(OvsdbNodeAugmentation.class);
if (ovsdbNode == null) {
Node nodeFromReadOvsdbNode = readOvsdbNode(node);
if (nodeFromReadOvsdbNode != null) {
- ovsdbNode = nodeFromReadOvsdbNode.getAugmentation(OvsdbNodeAugmentation.class);
+ ovsdbNode = nodeFromReadOvsdbNode.augmentation(OvsdbNodeAugmentation.class);
}
}
public static TerminationPoint getTerminationPointByExternalId(final Node bridgeNode, final String interfaceName) {
if (bridgeNode.getTerminationPoint() != null) {
for (TerminationPoint tp : bridgeNode.getTerminationPoint()) {
- OvsdbTerminationPointAugmentation ovsdbTp = tp.getAugmentation(OvsdbTerminationPointAugmentation.class);
+ OvsdbTerminationPointAugmentation ovsdbTp = tp.augmentation(OvsdbTerminationPointAugmentation.class);
String externalIdValue = getExternalInterfaceIdValue(ovsdbTp);
if (externalIdValue != null && externalIdValue.equals(interfaceName)) {
LOG.debug("Found matching termination point with iface-id {} on bridgeNode {}, returning tp {}",