package org.opendaylight.unimgr.cli;
import java.util.ArrayList;
-import java.util.Iterator;
import java.util.List;
-import java.util.ListIterator;
+
import org.apache.karaf.shell.commands.Command;
import org.apache.karaf.shell.commands.Option;
import org.apache.karaf.shell.console.OsgiCommandSupport;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.unimgr.rev151012.evc.UniSource;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.unimgr.rev151012.evc.UniSourceBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.unimgr.rev151012.evc.UniSourceKey;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
@Command(name = "evc-add",
-scope = "uni",
-description = "Add evc to the controller.")
-
+ scope = "uni",
+ description = "Add evc to the controller.")
public class EvcAddShellCommand extends OsgiCommandSupport {
- private static final Logger LOG = LoggerFactory.getLogger(EvcAddShellCommand.class);
protected IUnimgrConsoleProvider provider;
@Option(name = "-IPs",
description = "The IP address of the source UNI.\n-IPs / --IP Address source uni",
required = true,
multiValued = false)
- private String IPs = "";
+ private String ipSource = "";
@Option(name = "-IPd",
aliases = { "--IP-Address-destenation-uni" },
description = "The IP address of the destenation UNI.\n-IPs / --IP Address destenation uni",
required = true,
multiValued = false)
- private String IPd = "";
+ private String ipDestination = "";
@Option(name = "-egress",
aliases = { "--egress-speed" },
@Override
protected Object doExecute() throws Exception {
Short order = new Short("0");
- IpAddress ipAddreSource = new IpAddress(IPs.toCharArray());
+ IpAddress ipAddreSource = new IpAddress(ipSource.toCharArray());
UniSource uniSource = new UniSourceBuilder()
.setIpAddress(ipAddreSource)
.setKey(new UniSourceKey(order))
.build();
List<UniSource> uniSourceList = new ArrayList<UniSource>();
uniSourceList.add(uniSource);
- IpAddress ipAddreDest = new IpAddress(IPd.toCharArray());
+ IpAddress ipAddreDest = new IpAddress(ipDestination.toCharArray());
UniDest uniDest = new UniDestBuilder()
.setOrder(order)
.setKey(new UniDestKey(order))
.setUniSource(uniSourceList)
.build();
if (provider.addEvc(evcAug)) {
- return new String("Evc with Source Uni " +IPs+" and destenation Uni " +IPd+" created");
+ return new String("Evc with Source Uni " + ipSource + " and destenation Uni " + ipDestination + " created");
} else {
return new String("Error creating new Evc");
}
package org.opendaylight.unimgr.cli;
import java.math.BigInteger;
+
import org.apache.karaf.shell.commands.Command;
import org.apache.karaf.shell.commands.Option;
import org.apache.karaf.shell.console.OsgiCommandSupport;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.unimgr.rev151012.UniAugmentation;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.unimgr.rev151012.UniAugmentationBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.unimgr.rev151012.uni.SpeedBuilder;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
@Command(name = "uni-add",
scope = "uni",
description = "Adds an uni to the controller.")
public class UniAddShellCommand extends OsgiCommandSupport {
- private static final Logger LOG = LoggerFactory.getLogger(UniAddShellCommand.class);
protected IUnimgrConsoleProvider provider;
@Option(name = "-pm",
.setIpAddress(new IpAddress(ipAddress.toCharArray()))
.build();
if (provider.addUni(uni)) {
- return new String("Uni with ip " +ipAddress+" created");
+ return new String("Uni with ip " + ipAddress + " created");
} else {
return new String("Error creating new Uni");
}
import org.apache.karaf.shell.console.OsgiCommandSupport;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.unimgr.api.IUnimgrConsoleProvider;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.unimgr.rev151012.Uni;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.unimgr.rev151012.UniAugmentation;
@Command(name = "uni-list", scope = "uni", description = "Lists all uni in the controller.")
@Override
protected Object doExecute() throws Exception {
- LogicalDatastoreType storeType = isConfigurationData ? LogicalDatastoreType.CONFIGURATION : LogicalDatastoreType.OPERATIONAL;
+ LogicalDatastoreType storeType =
+ isConfigurationData ? LogicalDatastoreType.CONFIGURATION : LogicalDatastoreType.OPERATIONAL;
List<UniAugmentation> listUnis = provider.listUnis(storeType);
if (listUnis.size() > 0) {
Integer counter = 1;
for (UniAugmentation uni : listUnis) {
// TODO
- sb.append(String.format("#%d - IpAddress: %s\n", counter, uni.getIpAddress().getIpv4Address().getValue()));
+ sb.append(String.format("#%d - IpAddress: %s\n", counter,
+ uni.getIpAddress().getIpv4Address().getValue()));
counter++;
}
return sb.toString();
package org.opendaylight.unimgr.cli;
import java.math.BigInteger;
+
import org.apache.karaf.shell.commands.Command;
import org.apache.karaf.shell.commands.Option;
import org.apache.karaf.shell.console.OsgiCommandSupport;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.unimgr.rev151012.uni.SpeedBuilder;
@Command(name = "uni-update",
-scope = "uni",
-description = "Updates an uni to the controller.")
-public class UniUpdateShellCommand extends OsgiCommandSupport{
+ scope = "uni",
+ description = "Updates an uni to the controller.")
+public class UniUpdateShellCommand extends OsgiCommandSupport {
@Option(name = "-ip",
aliases = { "--ipAddress" },
description = "IpAddress of the Uni",
.setIpAddress(new IpAddress(ipAddress.toCharArray()))
.build();
if (provider.updateUni(uniAug)) {
- return new String("Uni with ip " +ipAddress+" updated");
+ return new String("Uni with ip " + ipAddress + " updated");
} else {
return new String("Error updating new Uni");
}
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.unimgr.rev151012.service.speed.speed.Speed10GBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.unimgr.rev151012.service.speed.speed.Speed10MBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.unimgr.rev151012.service.speed.speed.Speed1GBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.unimgr.rev151012.uni.SpeedBuilder;
public final class Utils {
}
+ /**
+ * Convert string to Speed.
+ * @param speed string representation of speed
+ * @return schema defined speed object
+ */
public static final Speed getSpeed(final String speed) {
Speed speedObject = null;
if (speed.equals("10M")) {
speedObject = new Speed10MBuilder().setSpeed10M(true)
.build();
- }
- else if (speed.equals("100M")) {
+ } else if (speed.equals("100M")) {
speedObject = new Speed100MBuilder().setSpeed100M(true)
.build();
- }
- else if (speed.equals("1G")) {
+ } else if (speed.equals("1G")) {
speedObject = new Speed1GBuilder().setSpeed1G(true)
.build();
- }
- else if (speed.equals("10G")) {
+ } else if (speed.equals("10G")) {
speedObject = new Speed10GBuilder().setSpeed10G(true)
.build();
}
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-import static org.powermock.api.support.membermodification.MemberMatcher.method;
import java.util.ArrayList;
import java.util.List;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.unimgr.rev151012.EvcAugmentation;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.unimgr.rev151012.EvcAugmentationBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.unimgr.rev151012.evc.EgressBw;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.unimgr.rev151012.evc.EgressBwBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.unimgr.rev151012.evc.IngressBw;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.unimgr.rev151012.evc.IngressBwBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.unimgr.rev151012.evc.UniDest;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.unimgr.rev151012.evc.UniDestBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.unimgr.rev151012.evc.UniSource;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.unimgr.rev151012.evc.UniSourceBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.unimgr.rev151012.evc.UniSourceKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.unimgr.rev151012.service.speed.speed.Speed100M;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.unimgr.rev151012.service.speed.speed.Speed100MBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.unimgr.rev151012.service.speed.speed.Speed10G;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.unimgr.rev151012.service.speed.speed.Speed10GBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.unimgr.rev151012.service.speed.speed.Speed10M;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.unimgr.rev151012.service.speed.speed.Speed10MBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.unimgr.rev151012.service.speed.speed.Speed1G;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.unimgr.rev151012.service.speed.speed.Speed1GBuilder;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.api.support.membermodification.MemberModifier;
import org.powermock.core.classloader.annotations.PrepareForTest;
@Test
public void testDoExecute() throws Exception {
final EvcAddShellCommand spyEvc = PowerMockito.spy(new EvcAddShellCommand(provider));
- Whitebox.setInternalState(spyEvc, "IPs", IPs);
- Whitebox.setInternalState(spyEvc, "IPd", IPd);
+ Whitebox.setInternalState(spyEvc, "ipSource", IPs);
+ Whitebox.setInternalState(spyEvc, "ipDestination", IPd);
Whitebox.setInternalState(spyEvc, "egress", egress);
Whitebox.setInternalState(spyEvc, "ingress", ingress);
final Short order = new Short("0");
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
import java.math.BigInteger;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.unimgr.rev151012.UniAugmentation;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.unimgr.rev151012.UniAugmentationBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.unimgr.rev151012.service.speed.Speed;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.unimgr.rev151012.service.speed.speed.Speed100M;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.unimgr.rev151012.service.speed.speed.Speed100MBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.unimgr.rev151012.service.speed.speed.Speed10G;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.unimgr.rev151012.service.speed.speed.Speed10GBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.unimgr.rev151012.service.speed.speed.Speed10M;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.unimgr.rev151012.service.speed.speed.Speed10MBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.unimgr.rev151012.service.speed.speed.Speed1G;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.unimgr.rev151012.service.speed.speed.Speed1GBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.unimgr.rev151012.uni.SpeedBuilder;
-import org.powermock.api.mockito.PowerMockito;
import org.powermock.api.support.membermodification.MemberModifier;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;
-import java.util.List;
-
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.Mockito;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.unimgr.api.IUnimgrConsoleProvider;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.unimgr.rev151012.Evc;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.unimgr.rev151012.EvcAugmentation;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.unimgr.rev151012.UniAugmentation;
import org.powermock.api.support.membermodification.MemberModifier;
import org.powermock.reflect.Whitebox;
/**
* Abstract command basic constructor.
- * @param dataBroker
- * @param dataObject
+ * @param dataBroker the data broker
+ * @param dataObject the object change to process
*/
public AbstractCommand(final DataBroker dataBroker, final DataTreeModification<D> dataObject) {
this.dataBroker = dataBroker;
sourceBr = optionalSourceBr.get();
destinationBr = optionalDestinationBr.get();
OvsdbUtils.createTerminationPointNode(dataBroker,
- uniSource.getAugmentation(UniAugmentation.class),
- sourceBr,
- UnimgrConstants.DEFAULT_BRIDGE_NAME,
- UnimgrConstants.DEFAULT_TUNNEL_IFACE);
+ uniSource.getAugmentation(UniAugmentation.class),
+ sourceBr,
+ UnimgrConstants.DEFAULT_BRIDGE_NAME,
+ UnimgrConstants.DEFAULT_TUNNEL_IFACE);
OvsdbUtils.createGreTunnel(dataBroker,
- uniSource.getAugmentation(UniAugmentation.class),
- uniDestination.getAugmentation(UniAugmentation.class),
- sourceBr,
- UnimgrConstants.DEFAULT_BRIDGE_NAME,
- UnimgrConstants.DEFAULT_GRE_TUNNEL_NAME);
+ uniSource.getAugmentation(UniAugmentation.class),
+ uniDestination.getAugmentation(UniAugmentation.class),
+ sourceBr,
+ UnimgrConstants.DEFAULT_BRIDGE_NAME,
+ UnimgrConstants.DEFAULT_GRE_TUNNEL_NAME);
OvsdbUtils.createTerminationPointNode(dataBroker,
- uniDestination.getAugmentation(UniAugmentation.class),
- destinationBr,
- UnimgrConstants.DEFAULT_BRIDGE_NAME,
- UnimgrConstants.DEFAULT_TUNNEL_IFACE);
+ uniDestination.getAugmentation(UniAugmentation.class),
+ destinationBr,
+ UnimgrConstants.DEFAULT_BRIDGE_NAME,
+ UnimgrConstants.DEFAULT_TUNNEL_IFACE);
OvsdbUtils.createGreTunnel(dataBroker,
- uniDestination.getAugmentation(UniAugmentation.class),
- uniSource.getAugmentation(UniAugmentation.class), destinationBr,
- UnimgrConstants.DEFAULT_BRIDGE_NAME,
- UnimgrConstants.DEFAULT_GRE_TUNNEL_NAME);
+ uniDestination.getAugmentation(UniAugmentation.class),
+ uniSource.getAugmentation(UniAugmentation.class), destinationBr,
+ UnimgrConstants.DEFAULT_BRIDGE_NAME,
+ UnimgrConstants.DEFAULT_GRE_TUNNEL_NAME);
EvcUtils.updateEvcNode(LogicalDatastoreType.CONFIGURATION,
evcKey,
evc,
destinationUniIid,
dataBroker);
EvcUtils.updateEvcNode(LogicalDatastoreType.OPERATIONAL,
- evcKey,
- evc,
- sourceUniIid,
- destinationUniIid,
- dataBroker);
+ evcKey,
+ evc,
+ sourceUniIid,
+ destinationUniIid,
+ dataBroker);
} else {
LOG.info("Unable to retrieve the source and/or destination bridge.");
}
}
}
}
- }
- else {
+ } else {
LOG.info("EvcAugmentation is null");
}
MdsalUtils.deleteNode(dataBroker, removedEvcIid, LogicalDatastoreType.OPERATIONAL);
LOG.trace("New EVC created, source IP: {} destination IP {}.", laterUni1Ip, laterUni2Ip);
final ReadTransaction readTransac = dataBroker.newReadOnlyTransaction();
- final CheckedFuture<Optional<Link>, ReadFailedException> retFormerEvc = readTransac.read(LogicalDatastoreType.OPERATIONAL, evcKey);
+ final CheckedFuture<Optional<Link>, ReadFailedException> retFormerEvc =
+ readTransac.read(LogicalDatastoreType.OPERATIONAL, evcKey);
EvcAugmentation formerEvc;
try {
Optional<Link> optLinks = retFormerEvc.get();
- if(optLinks != null && optLinks.isPresent()) {
- formerEvc = optLinks.get().getAugmentation(EvcAugmentation.class);
- final Ipv4Address formerUni1ip = formerEvc.getUniSource().iterator().next().getIpAddress().getIpv4Address();
- final Ipv4Address formerUni2ip = formerEvc.getUniDest().iterator().next().getIpAddress().getIpv4Address();
-
- if (formerUni1ip.equals(laterUni1Ip)) {
- // do nothing
- } else if (formerUni1ip.equals(laterUni2Ip)) {
- // do nothing
- } else {
- LOG.info("{} is not part of the EVC, removing configuration", formerUni1ip);
- final InstanceIdentifier<?> formerUniIID = UnimgrMapper.getUniIid(dataBroker, new IpAddress(formerUni1ip), LogicalDatastoreType.OPERATIONAL);
- final Optional<Node> formerUni = MdsalUtils.readNode(dataBroker, LogicalDatastoreType.OPERATIONAL, formerUniIID);
- EvcUtils.deleteEvcData(dataBroker, formerUni);
- }
- if (formerUni2ip.equals(laterUni1Ip)) {
- // do nothing
- } else if (formerUni2ip.equals(laterUni2Ip)) {
- // do nothing
- } else {
- LOG.info("{} is not part of the EVC, removing configuration", formerUni2ip);
- final InstanceIdentifier<?> formerUniIID = UnimgrMapper.getUniIid(dataBroker, new IpAddress(formerUni2ip), LogicalDatastoreType.OPERATIONAL);
- final Optional<Node> formerUni = MdsalUtils.readNode(dataBroker, LogicalDatastoreType.OPERATIONAL, formerUniIID);
- EvcUtils.deleteEvcData(dataBroker, formerUni);
- }
+ if (optLinks != null && optLinks.isPresent()) {
+ formerEvc = optLinks.get().getAugmentation(EvcAugmentation.class);
+ final Ipv4Address formerUni1ip =
+ formerEvc.getUniSource().iterator().next().getIpAddress().getIpv4Address();
+ final Ipv4Address formerUni2ip =
+ formerEvc.getUniDest().iterator().next().getIpAddress().getIpv4Address();
+
+ if (formerUni1ip.equals(laterUni1Ip)) {
+ // do nothing
+ } else if (formerUni1ip.equals(laterUni2Ip)) {
+ // do nothing
+ } else {
+ LOG.info("{} is not part of the EVC, removing configuration", formerUni1ip);
+ final InstanceIdentifier<?> formerUniIID =
+ UnimgrMapper.getUniIid(dataBroker, new IpAddress(formerUni1ip),
+ LogicalDatastoreType.OPERATIONAL);
+ final Optional<Node> formerUni =
+ MdsalUtils.readNode(dataBroker, LogicalDatastoreType.OPERATIONAL, formerUniIID);
+ EvcUtils.deleteEvcData(dataBroker, formerUni);
+ }
+ if (formerUni2ip.equals(laterUni1Ip)) {
+ // do nothing
+ } else if (formerUni2ip.equals(laterUni2Ip)) {
+ // do nothing
+ } else {
+ LOG.info("{} is not part of the EVC, removing configuration", formerUni2ip);
+ final InstanceIdentifier<?> formerUniIID =
+ UnimgrMapper.getUniIid(dataBroker, new IpAddress(formerUni2ip),
+ LogicalDatastoreType.OPERATIONAL);
+ final Optional<Node> formerUni =
+ MdsalUtils.readNode(dataBroker, LogicalDatastoreType.OPERATIONAL, formerUniIID);
+ EvcUtils.deleteEvcData(dataBroker, formerUni);
+ }
}
} catch (final InterruptedException | ExecutionException e) {
LOG.error("Failed to retrieve former EVC {}", evcKey, e);
import com.google.common.base.Optional;
-public class UniAddCommand extends AbstractCommand<Node>{
+public class UniAddCommand extends AbstractCommand<Node> {
private static final Logger LOG = LoggerFactory.getLogger(UniAddCommand.class);
public void execute() {
final InstanceIdentifier<?> uniKey = dataObject.getRootPath().getRootIdentifier();
final Optional<Node> optNode = MdsalUtils.readNode(dataBroker, LogicalDatastoreType.OPERATIONAL, uniKey);
- if(!optNode.isPresent()) {
+ if (!optNode.isPresent()) {
final Node uniNode = dataObject.getRootNode().getDataAfter();
final UniAugmentation uni = uniNode.getAugmentation(UniAugmentation.class);
if (uni != null) {
}
}
}
-
}
@Override
public void execute() {
- final UniAugmentation updatedUni = dataObject.getRootNode().getDataAfter().getAugmentation(UniAugmentation.class);
- final UniAugmentation formerUni = dataObject.getRootNode().getDataBefore().getAugmentation(UniAugmentation.class);
+ final UniAugmentation updatedUni =
+ dataObject.getRootNode().getDataAfter().getAugmentation(UniAugmentation.class);
+ final UniAugmentation formerUni =
+ dataObject.getRootNode().getDataBefore().getAugmentation(UniAugmentation.class);
if (formerUni != null) {
final String formerUniIp = formerUni.getIpAddress().getIpv4Address().getValue();
final String updatedUniIp = updatedUni.getIpAddress().getIpv4Address().getValue();
if (updatedUni.getOvsdbNodeRef() != null) {
LOG.info("OVSDB NODE ref retreive for updated UNI {}", updatedUni.getOvsdbNodeRef());
final OvsdbNodeRef ovsdbNodeRef = updatedUni.getOvsdbNodeRef();
- final Optional<Node> optOvsdbNode = MdsalUtils.readNode(dataBroker,LogicalDatastoreType.OPERATIONAL, ovsdbNodeRef.getValue());
- if(optOvsdbNode.isPresent()) {
- ovsdbNode= optOvsdbNode.get();
+ final Optional<Node> optOvsdbNode =
+ MdsalUtils.readNode(dataBroker,LogicalDatastoreType.OPERATIONAL, ovsdbNodeRef.getValue());
+ if (optOvsdbNode.isPresent()) {
+ ovsdbNode = optOvsdbNode.get();
LOG.info("Retrieved the OVSDB node {}", ovsdbNode.getNodeId());
// Update QoS entries to ovsdb if speed is configured to UNI node
if (updatedUni.getSpeed() != null) {
} else {
// This should never happen, because on creation,
// the UNI is assigned and OVSDB node
- LOG.error("OVSDB node not found for UNI {}, but got OVSDB ref", uniKey, updatedUni.getOvsdbNodeRef());
+ LOG.error("OVSDB node not found for UNI {}, but got OVSDB ref {}", uniKey,
+ updatedUni.getOvsdbNodeRef());
return;
}
} else {
public EvcDataTreeChangeListener(final DataBroker dataBroker) {
super(dataBroker);
- final DataTreeIdentifier<Link> dataTreeIid = new DataTreeIdentifier<>(LogicalDatastoreType.CONFIGURATION, getEvcTopologyPath());
+ final DataTreeIdentifier<Link> dataTreeIid =
+ new DataTreeIdentifier<>(LogicalDatastoreType.CONFIGURATION, getEvcTopologyPath());
listener = dataBroker.registerDataTreeChangeListener(dataTreeIid, this);
LOG.info("EvcDataTreeChangeListener created and registered");
}
@Override
public void add(final DataTreeModification<Link> newDataObject) {
- if(newDataObject.getRootPath() != null && newDataObject.getRootNode() != null) {
+ if (newDataObject.getRootPath() != null && newDataObject.getRootNode() != null) {
LOG.info("evc link {} created", newDataObject.getRootNode().getIdentifier());
final EvcAddCommand evcAddCmd = new EvcAddCommand(dataBroker, newDataObject);
evcAddCmd.execute();
private InstanceIdentifier<Link> getEvcTopologyPath() {
final InstanceIdentifier<Link> evcPath = InstanceIdentifier
- .create(NetworkTopology.class)
- .child(Topology.class, new TopologyKey(UnimgrConstants.EVC_TOPOLOGY_ID))
- .child(Link.class);
+ .create(NetworkTopology.class)
+ .child(Topology.class, new TopologyKey(UnimgrConstants.EVC_TOPOLOGY_ID))
+ .child(Link.class);
return evcPath;
}
@Override
public void remove(final DataTreeModification<Link> removedDataObject) {
- if(removedDataObject.getRootPath() != null && removedDataObject.getRootNode() != null) {
+ if (removedDataObject.getRootPath() != null && removedDataObject.getRootNode() != null) {
LOG.info("evc link {} deleted", removedDataObject.getRootNode().getIdentifier());
final EvcRemoveCommand evcRemovedCmd = new EvcRemoveCommand(dataBroker, removedDataObject);
evcRemovedCmd.execute();
@Override
public void update(final DataTreeModification<Link> modifiedDataObject) {
- if(modifiedDataObject.getRootPath() != null && modifiedDataObject.getRootNode() != null) {
+ if (modifiedDataObject.getRootPath() != null && modifiedDataObject.getRootNode() != null) {
LOG.info("evc link {} updated", modifiedDataObject.getRootNode().getIdentifier());
final EvcUpdateCommand evcUpdateCmd = new EvcUpdateCommand(dataBroker, modifiedDataObject);
evcUpdateCmd.execute();
public OvsNodeDataTreeChangeListener(final DataBroker dataBroker) {
super(dataBroker);
final InstanceIdentifier<Node> nodePath = getOvsNodeTopologyPath();
- final DataTreeIdentifier<Node> dataTreeIid = new DataTreeIdentifier<>(LogicalDatastoreType.OPERATIONAL, nodePath);
+ final DataTreeIdentifier<Node> dataTreeIid =
+ new DataTreeIdentifier<>(LogicalDatastoreType.OPERATIONAL, nodePath);
listener = dataBroker.registerDataTreeChangeListener(dataTreeIid, this);
LOG.info("ovsNodeDataTreeChangeListener created and registered");
}
public UniDataTreeChangeListener(final DataBroker dataBroker) {
super(dataBroker);
final InstanceIdentifier<Node> uniPath = getUniTopologyPath();
- final DataTreeIdentifier<Node> dataTreeIid = new DataTreeIdentifier<>(LogicalDatastoreType.CONFIGURATION, uniPath);
+ final DataTreeIdentifier<Node> dataTreeIid =
+ new DataTreeIdentifier<>(LogicalDatastoreType.CONFIGURATION, uniPath);
listener = dataBroker.registerDataTreeChangeListener(dataTreeIid, this);
LOG.info("UniDataTreeChangeListener created and registered");
}
@Override
public void close() throws Exception {
- listener.close();
+ listener.close();
}
private InstanceIdentifier<Node> getUniTopologyPath() {
* Generates an Instance Identifier for an OvsdbBridgeNode by retrieving the Iid
* via the OvsdbNodeAugmentation's BridgeRef.
* the same as createOvsdbBridgeNodeIid.
- * @param ovsdbNode
+ * @param ovsdbNode the ovsdb node
* @return An Instance Identifier for a bridge associated with an OVSDB node.
*/
public static InstanceIdentifier<Node> getOvsdbBridgeNodeIid(Node ovsdbNode) {
}
/**
- * Generates an Instance Identifier for the OVSDB topology ovsdb:1
+ * Generates an Instance Identifier for the OVSDB topology ovsdb:1.
* @return An Instance Identifier for the OVSDB topology ovsdb:1
*/
public static InstanceIdentifier<Topology> getOvsdbTopologyIid() {
* the Bridge Node and the Port Name.
* @param bridgeNode The bridge where the port resides.
* @param portName The name of the port, example: eth0
- * @return
+ * @return instance identifier
*/
public static InstanceIdentifier<TerminationPoint> getTerminationPointIid(
Node bridgeNode,
/**
* Generates an Instance Identifier for a UNI by querying the datastore.
* Query will ask the Operational store by default.
- * @param dataBroker
+ * @param dataBroker the data broker
* @param ip The IP of the UNI
* @return An Instance Identifier of a UNI by using its IP address.
*/
/**
* Generates an Instance Identifier for a UNI by querying the datastore
* with the IP address of the UNI.
- * @param dataBroker
+ * @param dataBroker the data broker
* @param ip The IP of the UNI
* @param store The store where the query should be sent
* @return An Instance Identifier of a UNI by using its IP address.
}
/**
- * Generates an Instance Identifier for the UNI topology: unimgr:uni
+ * Generates an Instance Identifier for the UNI topology: unimgr:uni.
* @return An Instance Identifier for the UNI topology
*/
public static InstanceIdentifier<Topology> getUniTopologyIid() {
* @return An Instance Identifier for a specific UNI node.
*/
public static InstanceIdentifier<Node> getUniNodeIid(NodeId nodeId) {
- InstanceIdentifier<Node> nodePath = InstanceIdentifier
+ InstanceIdentifier<Node> nodePath = InstanceIdentifier
.create(NetworkTopology.class)
.child(Topology.class,
new TopologyKey(UnimgrConstants.UNI_TOPOLOGY_ID))
.child(Node.class,
new NodeKey(nodeId));
- return nodePath;
-}
+ return nodePath;
+ }
- public static InstanceIdentifier<QueueList> getOvsdbQueueListIid (NodeId ovsdbNodeId,
+ /**
+ * Generates an Instance Identifier for an OVSDB QoS queue list entry.
+ * @param ovsdbNodeId the desired node id
+ * @param qosEntryKey the key of the desired QoS entry
+ * @param queueNumber the key of the desired queue entry
+ * @return instance identifier
+ */
+ public static InstanceIdentifier<QueueList> getOvsdbQueueListIid(NodeId ovsdbNodeId,
QosEntriesKey qosEntryKey,
Long queueNumber) {
InstanceIdentifier<QueueList> queueIid = InstanceIdentifier
return queueIid;
}
- public static InstanceIdentifier<QosOtherConfig> getQosOtherConfigIid (NodeId ovsdbNodeId,
+ /**
+ * Generates an Instance Identifier for an OVSDB QoS other config entry.
+ * @param ovsdbNodeId the desired node id
+ * @param qosEntryKey the key of the desired QoS entry
+ * @return instance identifier
+ */
+ public static InstanceIdentifier<QosOtherConfig> getQosOtherConfigIid(NodeId ovsdbNodeId,
QosEntriesKey qosEntryKey) {
InstanceIdentifier<QosOtherConfig> qosOtherConfigIid = InstanceIdentifier
.create(NetworkTopology.class)
return qosOtherConfigIid;
}
- public static InstanceIdentifier<QueuesOtherConfig> getQueuesOtherConfigIid (NodeId ovsdbNodeId,
+ /**
+ * Generates an Instance Identifier for an OVSDB queue other config entry.
+ * @param ovsdbNodeId the desired node id
+ * @param queuesKey the key of the desired queue entry
+ * @return instance identifier
+ */
+ public static InstanceIdentifier<QueuesOtherConfig> getQueuesOtherConfigIid(NodeId ovsdbNodeId,
QueuesKey queuesKey) {
InstanceIdentifier<QueuesOtherConfig> queuesOtherConfig = InstanceIdentifier
.create(NetworkTopology.class)
return queuesOtherConfig;
}
+ /**
+ * Generates an Instance Identifier for an OVSDB QoS entries list.
+ * @param ovsdbNode the desired node
+ * @param qosEntryKey the key of the desired QoS entry
+ * @return instance identifier
+ */
public static InstanceIdentifier<QosEntries> getOvsdbQoSEntriesIid(Node ovsdbNode, QosEntriesKey qosEntryKey) {
InstanceIdentifier<QosEntries> qosEntriesIid = InstanceIdentifier
.create(NetworkTopology.class)
return qosEntriesIid;
}
+ /**
+ * Generates an Instance Identifier for an OVSDB QoS queue list entry.
+ * @param ovsdbNode the desired node
+ * @param queuesKey the key of the desired queue list
+ * @return instance identifier
+ */
public static InstanceIdentifier<Queues> getOvsdbQueuesIid(Node ovsdbNode, QueuesKey queuesKey) {
InstanceIdentifier<Queues> queuesIid = InstanceIdentifier
.create(NetworkTopology.class)
private static final Logger LOG = LoggerFactory.getLogger(EvcUtils.class);
/**
- * Delete EVC data from configuration datastore
+ * Delete EVC data from configuration datastore.
* @param dataBroker The dataBroker instance to create transactions
* @param optionalUni Optional Uni Node
*/
ovsdbNodeIid);
if (optionalOvsdNode.isPresent()) {
final Node ovsdbNode = optionalOvsdNode.get();
- final OvsdbNodeAugmentation ovsdbNodeAugmentation = ovsdbNode.getAugmentation(OvsdbNodeAugmentation.class);
+ final OvsdbNodeAugmentation ovsdbNodeAugmentation =
+ ovsdbNode.getAugmentation(OvsdbNodeAugmentation.class);
for (final ManagedNodeEntry managedNodeEntry: ovsdbNodeAugmentation.getManagedNodeEntry()) {
final InstanceIdentifier<Node> bridgeIid = managedNodeEntry
.getBridgeRef()
final Optional<Node> optBridgeNode = MdsalUtils.readNode(dataBroker, bridgeIid);
if (optBridgeNode.isPresent()) {
final Node bridgeNode = optBridgeNode.get();
- final InstanceIdentifier<TerminationPoint> iidGreTermPoint = UnimgrMapper.getTerminationPointIid(bridgeNode,
- UnimgrConstants.DEFAULT_GRE_TUNNEL_NAME);
- final InstanceIdentifier<TerminationPoint> iidEthTermPoint = UnimgrMapper.getTerminationPointIid(bridgeNode,
- UnimgrConstants.DEFAULT_TUNNEL_IFACE);
+ final InstanceIdentifier<TerminationPoint> iidGreTermPoint =
+ UnimgrMapper.getTerminationPointIid(bridgeNode,
+ UnimgrConstants.DEFAULT_GRE_TUNNEL_NAME);
+ final InstanceIdentifier<TerminationPoint> iidEthTermPoint =
+ UnimgrMapper.getTerminationPointIid(bridgeNode,
+ UnimgrConstants.DEFAULT_TUNNEL_IFACE);
MdsalUtils.deleteNode(dataBroker, iidGreTermPoint, LogicalDatastoreType.CONFIGURATION);
MdsalUtils.deleteNode(dataBroker, iidEthTermPoint, LogicalDatastoreType.CONFIGURATION);
}
}
/**
- * Retrieve the list of links in the Operational DataStore
+ * Retrieve the list of links in the Operational DataStore.
* @param dataBroker The dataBroker instance to create transactions
* @return A list of Links retrieved from the Operational DataStore
*/
}
/**
- * Updates a specific EVC into a specific DataStore type
+ * Updates a specific EVC into a specific DataStore type.
* @param dataStore The datastore type
* @param evcKey The EVC key
* @param evcAugmentation The EVC's data
return Optional.absent();
}
+ /**
+ * Read a specific node from a specific data store type.
+ * @param dataBroker The dataBroker instance to create transactions
+ * @param store The data store type
+ * @param genericNode The Instance Identifier of a specific Node
+ * @return An Optional Node instance
+ */
+ public static final Optional<Node> readNode(DataBroker dataBroker,
+ LogicalDatastoreType store,
+ InstanceIdentifier<?> genericNode) {
+ final ReadTransaction read = dataBroker.newReadOnlyTransaction();
+ final InstanceIdentifier<Node> nodeIid = genericNode.firstIdentifierOf(Node.class);
+ final CheckedFuture<Optional<Node>, ReadFailedException> nodeFuture = read
+ .read(store, nodeIid);
+ try {
+ return nodeFuture.checkedGet();
+ } catch (final ReadFailedException e) {
+ LOG.info("Unable to read node with Iid {}", nodeIid, e);
+ }
+ return Optional.absent();
+ }
+
/**
* Generic function to delete a node on a specific dataStore
* @param dataBroker The instance of the data broker to create transactions.
}
return Optional.absent();
}
-
- /**
- * Read a specific node from a specific data store type.
- * @param dataBroker The dataBroker instance to create transactions
- * @param store The data store type
- * @param genericNode The Instance Identifier of a specific Node
- * @return An Optional Node instance
- */
- public static final Optional<Node> readNode(DataBroker dataBroker,
- LogicalDatastoreType store,
- InstanceIdentifier<?> genericNode) {
- final ReadTransaction read = dataBroker.newReadOnlyTransaction();
- final InstanceIdentifier<Node> nodeIid = genericNode.firstIdentifierOf(Node.class);
- final CheckedFuture<Optional<Node>, ReadFailedException> nodeFuture = read
- .read(store, nodeIid);
- try {
- return nodeFuture.checkedGet();
- } catch (final ReadFailedException e) {
- LOG.info("Unable to read node with Iid {}", nodeIid, e);
- }
- return Optional.absent();
- }
}
+ UnimgrConstants.DEFAULT_BRIDGE_NODE_ID_SUFFIX
+ bridgeName);
bridgeNodeBuilder.setNodeId(bridgeNodeId);
- final OvsdbBridgeAugmentationBuilder ovsdbBridgeAugmentationBuilder = new OvsdbBridgeAugmentationBuilder();
+ final OvsdbBridgeAugmentationBuilder ovsdbBridgeAugmentationBuilder =
+ new OvsdbBridgeAugmentationBuilder();
ovsdbBridgeAugmentationBuilder.setBridgeName(new OvsdbBridgeName(bridgeName));
ovsdbBridgeAugmentationBuilder.setProtocolEntry(OvsdbUtils.createMdsalProtocols());
final OvsdbNodeRef ovsdbNodeRef = new OvsdbNodeRef(ovsdbNodeIid);
final List<ProtocolEntry> protocolList = new ArrayList<ProtocolEntry>();
final ImmutableBiMap<String, Class<? extends OvsdbBridgeProtocolBase>> mapper =
SouthboundConstants.OVSDB_PROTOCOL_MAP.inverse();
- protocolList.add(new ProtocolEntryBuilder().
- setProtocol((Class<? extends OvsdbBridgeProtocolBase>) mapper.get("OpenFlow13")).build());
+ protocolList.add(new ProtocolEntryBuilder().setProtocol(
+ (Class<? extends OvsdbBridgeProtocolBase>) mapper.get("OpenFlow13")).build());
return protocolList;
}
}
/**
- * Creates and submit an OvsdbNode by using the Data contained in the UniAugmentation
+ * Creates and submit an OvsdbNode by using the Data contained in the UniAugmentation.
* @param dataBroker The instance of the DataBroker to create transactions
* @param uni The UNI's data
* @return The instance of the Node
return ovsdbNode;
}
+ /**
+ * Create and build an OvsdbNodeAugmentation.
+ * @param uni the UNI data
+ * @param remotePort port number
+ * @return OvsdbNodeAugmentation
+ */
public static OvsdbNodeAugmentation createOvsdbNodeAugmentation(UniAugmentation uni,
PortNumber remotePort) {
final ConnectionInfo connectionInfos = new ConnectionInfoBuilder()
return ovsdbNode;
}
- public static Node createQoSForOvsdbNode (DataBroker dataBroker, UniAugmentation uni) {
+ /**
+ * Create and write QoS forn an OVSDB node, copying from UNI entry.
+ * @param dataBroker the data broker
+ * @param uni the UNI to copy data from
+ * @return null
+ */
+ public static Node createQoSForOvsdbNode(DataBroker dataBroker, UniAugmentation uni) {
final Optional<Node> optionalNode = findOvsdbNode(dataBroker, uni);
if (optionalNode.isPresent()) {
final NodeId ovsdbNodeId = optionalNode.get().getNodeId();
}
try {
future.checkedGet();
- LOG.trace("Update qos and queues to ovsdb for node {} {}", ovsdbNodeId, ovsdbNodeAugmentationIid);
+ LOG.trace("Update qos and queues to ovsdb for node {} {}", ovsdbNodeId, ovsdbNodeAugmentationIid);
} catch (final TransactionCommitFailedException e) {
LOG.warn("Failed to put {} ", ovsdbNodeAugmentationIid, e);
}
private static List<QosEntries> createQosEntries(Uni uni) {
// Configure queue for best-effort dscp and max rate
final List<QosOtherConfig> otherConfig = new ArrayList<>();
- QosOtherConfig qOtherConfig = new QosOtherConfigBuilder()
+ QosOtherConfig qosOtherConfig = new QosOtherConfigBuilder()
.setKey(new QosOtherConfigKey(UnimgrConstants.QOS_DSCP_ATTRIBUTE))
.setOtherConfigKey(UnimgrConstants.QOS_DSCP_ATTRIBUTE)
.setOtherConfigValue(UnimgrConstants.QOS_DSCP_ATTRIBUTE_VALUE)
.build();
- otherConfig.add(qOtherConfig);
+ otherConfig.add(qosOtherConfig);
- qOtherConfig = new QosOtherConfigBuilder()
+ qosOtherConfig = new QosOtherConfigBuilder()
.setKey(new QosOtherConfigKey(UnimgrConstants.QOS_MAX_RATE))
.setOtherConfigKey(UnimgrConstants.QOS_MAX_RATE)
.setOtherConfigValue(UniUtils.getSpeed(uni.getSpeed().getSpeed()))
.build();
- otherConfig.add(qOtherConfig);
+ otherConfig.add(qosOtherConfig);
final Uuid qosUuid = new Uuid(UUID.randomUUID().toString());
final QosEntries qosEntry = new QosEntriesBuilder()
final CheckedFuture<Void, TransactionCommitFailedException> future = transaction.submit();
try {
future.checkedGet();
- LOG.info("Update qos-entries to ovsdb for node {} {}", ovsdbNodeId, queueIid);
+ LOG.info("Update qos-entries to ovsdb for node {} {}", ovsdbNodeId, queueIid);
} catch (final TransactionCommitFailedException e) {
LOG.warn("Failed to put {} ", queueIid, e);
}
}
}
- public static void updateMaxRate (DataBroker dataBroker,
+ /**
+ * Write a new max rate into an EVC's objects.
+ * @param dataBroker the data broker
+ * @param sourceUniAugmentation source UNI
+ * @param destinationUniAugmentation destination UNI
+ * @param evc EVC link
+ */
+ public static void updateMaxRate(DataBroker dataBroker,
UniAugmentation sourceUniAugmentation,
UniAugmentation destinationUniAugmentation,
EvcAugmentation evc) {
final CheckedFuture<Void, TransactionCommitFailedException> future = transaction.submit();
try {
future.checkedGet();
- LOG.info("Update qos-entries max-rate to ovsdb for node {} {}", ovsdbNodeId, qosOtherConfigIid);;
+ LOG.info("Update qos-entries max-rate to ovsdb for node {} {}", ovsdbNodeId, qosOtherConfigIid);
} catch (final TransactionCommitFailedException e) {
LOG.warn("Failed to put {}", qosOtherConfigIid, e);
}
final CheckedFuture<Void, TransactionCommitFailedException> future = transaction.submit();
try {
future.checkedGet();
- LOG.info("Update queues max-rate to ovsdb for node {} {}", ovsdbNodeId, queuesOtherConfigIid);;
+ LOG.info("Update queues max-rate to ovsdb for node {} {}", ovsdbNodeId, queuesOtherConfigIid);
} catch (final TransactionCommitFailedException e) {
LOG.warn("Failed to put {} ", queuesOtherConfigIid, e);
}
}
/**
- * Creates a built OvsdbTerminationAugmentation with data
+ * Creates a built OvsdbTerminationAugmentation with data.
* @param uni The UNI's data
* @return A Built OvsdbTerminationPointAugmentation with data
*/
* @param bridgeName The Bridge name (example: br0)
* @param portName The Port name (example: eth0)
* @param type The type of termination (example: gre) Refer to OVSDB_INTERFACE_TYPE_MAP
- * to review the list of available Interface Types.
+ * to review the list of available Interface Types.
*/
public static void createTerminationPointNode(DataBroker dataBroker,
Uni uni,
}
/**
- * Deletes a generic node
+ * Deletes a generic node.
* @param dataBroker The instance of the data broker to create transactions
* @param store The DataStore where the delete
* @param path The path to delete
for (final Entry<InstanceIdentifier<?>, DataObject> created : changes.entrySet()) {
if (klazz.isInstance(created.getValue())) {
@SuppressWarnings("unchecked")
- final
- T value = (T) created.getValue();
+ final T value = (T) created.getValue();
final Class<?> type = created.getKey().getTargetType();
if (type.equals(klazz)) {
@SuppressWarnings("unchecked") // Actually checked above
- final
- InstanceIdentifier<T> iid = (InstanceIdentifier<T>) created.getKey();
+ final InstanceIdentifier<T> iid = (InstanceIdentifier<T>) created.getKey();
result.put(iid, value);
}
}
}
/**
- * Extracts the removed nodes
+ * Extracts the removed nodes.
* @param changes he dataChange object
* @param klazz The class type
* @return A set to removed nodes as DataObject casted as the class type
for (final InstanceIdentifier<?> iid : changes.getRemovedPaths()) {
if (iid.getTargetType().equals(klazz)) {
@SuppressWarnings("unchecked") // Actually checked above
- final
- InstanceIdentifier<T> iidn = (InstanceIdentifier<T>)iid;
+ final InstanceIdentifier<T> iidn = (InstanceIdentifier<T>)iid;
result.add(iidn);
}
}
/**
* Retrieves the connection information from an Ovsdb Connection by
- * using the Ovsdb Node Id
+ * using the Ovsdb Node Id.
* @param dataBroker The dataBroker instance to create transactions
* @param ovsdbNodeId The NodeId of the OVSDB node
* @return The ConnectionInfo object
}
/**
- * Retrieve the Local IP of the controller
+ * Retrieve the Local IP of the controller.
* @return The LocalIp object of the Controller
*/
public static IpAddress getLocalIp() {
}
/**
- * Retrieve a list of Ovsdb Nodes from the Operational DataStore
+ * Retrieve a list of Ovsdb Nodes from the Operational DataStore.
* @param dataBroker The dataBroker instance to create transactions
* @return The Ovsdb Node retrieved from the Operational DataStore
*/
topology = MdsalUtils.read(dataBroker, LogicalDatastoreType.CONFIGURATION, ovsdbTopoIdentifier);
if ((topology != null) && (topology.getNode() != null)) {
for (final Node node : topology.getNode()) {
- final OvsdbNodeAugmentation ovsdbNodeAugmentation = node.getAugmentation(OvsdbNodeAugmentation.class);
+ final OvsdbNodeAugmentation ovsdbNodeAugmentation =
+ node.getAugmentation(OvsdbNodeAugmentation.class);
if (ovsdbNodeAugmentation != null) {
ovsdbNodes.add(node);
}