int client = 1;
if (!deviceObject.isPresent() || deviceObject.get().getCircuitPacks() == null) {
LOG.warn("Circuit Packs are not present for {}", nodeId);
- return false; // TODO return false or continue?
+ return false;
+ // TODO return false or continue?
}
Map<String, String> lcpMap = new HashMap<>();
Map<String, Mapping> mappingMap = new HashMap<>();
return cpPerSrg;
}
- @SuppressWarnings("checkstyle:linelength") //last LOG info message in this method is too long
+ //last LOG info message in this method is too long
+ @SuppressWarnings("checkstyle:linelength")
private boolean createPpPortMapping(String nodeId, Info deviceInfo, List<Mapping> portMapList) {
// Creating mapping data for SRG's PP
HashMap<Integer, List<org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.srg.CircuitPacks>> srgCps
return mpBldr.build();
}
- @SuppressWarnings("checkstyle:linelength") // some LOG messages are too long
+ // some LOG messages are too long
+ @SuppressWarnings("checkstyle:linelength")
private boolean createTtpPortMapping(String nodeId, Info deviceInfo, List<Mapping> portMapList) {
// Creating mapping data for degree TTP's
List<Degree> degrees = getDegrees(nodeId, deviceInfo);
int client = 1;
if (!deviceObject.isPresent() || deviceObject.get().getCircuitPacks() == null) {
LOG.warn("Circuit Packs are not present for {}", nodeId);
- return false; // TODO return false or continue?
+ return false;
+ // TODO return false or continue?
}
Map<String, String> lcpMap = new HashMap<>();
Map<String, Mapping> mappingMap = new HashMap<>();
return cpPerSrg;
}
- @SuppressWarnings("checkstyle:linelength") //last LOG info message in this method is too long
+ //last LOG info message in this method is too long
+ @SuppressWarnings("checkstyle:linelength")
private boolean createPpPortMapping(String nodeId, Info deviceInfo, List<Mapping> portMapList) {
// Creating mapping data for SRG's PP
HashMap<Integer, List<org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev181019.srg.CircuitPacks>> srgCps
return mpBldr.build();
}
- @SuppressWarnings("checkstyle:linelength") //some LOG messages are too long
+ //some LOG messages are too long
+ @SuppressWarnings("checkstyle:linelength")
private boolean createTtpPortMapping(String nodeId, Info deviceInfo, List<Mapping> portMapList) {
// Creating mapping data for degree TTP's
List<Degree> degrees = getDegrees(nodeId, deviceInfo);
import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
import org.opendaylight.controller.md.sal.binding.api.MountPoint;
import org.opendaylight.controller.md.sal.binding.api.NotificationService;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.controller.sal.binding.api.RpcConsumerRegistry;
import org.opendaylight.transportpce.common.StringConstants;
-import org.opendaylight.transportpce.common.Timeouts;
import org.opendaylight.transportpce.common.device.DeviceTransactionManager;
import org.opendaylight.transportpce.networkmodel.dto.NodeRegistration;
import org.opendaylight.transportpce.networkmodel.dto.NodeRegistration22;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.notification._1._0.rev080714.CreateSubscriptionInputBuilder;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.notification._1._0.rev080714.NotificationsService;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.notification._1._0.rev080714.StreamNameType;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netmod.notification.rev080714.Netconf;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netmod.notification.rev080714.netconf.Streams;
import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNode;
import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNodeConnectionStatus;
import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.netconf.node.connection.status.available.capabilities.AvailableCapability;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
private static final Logger LOG = LoggerFactory.getLogger(NetConfTopologyListener.class);
private final NetworkModelService networkModelService;
- //private final R2RLinkDiscovery linkDiscovery;
private final DataBroker dataBroker;
private final DeviceTransactionManager deviceTransactionManager;
private final Map<String, NodeRegistration> registrations;
public NetConfTopologyListener(final NetworkModelService networkModelService, final DataBroker dataBroker,
DeviceTransactionManager deviceTransactionManager) {
this.networkModelService = networkModelService;
- //this.linkDiscovery = linkDiscovery;
this.dataBroker = dataBroker;
this.deviceTransactionManager = deviceTransactionManager;
this.registrations = new ConcurrentHashMap<>();
final ListenerRegistration<OrgOpenroadmDeviceListener> accessDeviceNotificationListenerRegistration =
notificationService.get().registerNotificationListener(deviceListener);
-// final OrgOpenroadmLldpListener lldpListener = new LldpListener(this.linkDiscovery, nodeId);
-// LOG.info("Registering notification listener on OrgOpenroadmLldpListener for node: {}", nodeId);
-// final ListenerRegistration<OrgOpenroadmLldpListener> accessLldpNotificationListenerRegistration =
-// notificationService.get().registerNotificationListener(lldpListener);
-
TcaListener tcaListener = new TcaListener();
LOG.info("Registering notification listener on OrgOpenroadmTcaListener for node: {}", nodeId);
final ListenerRegistration<OrgOpenroadmTcaListener> accessTcaNotificationListenerRegistration =
notificationService.get().registerNotificationListener(tcaListener);
- String streamName = "NETCONF"; //getSupportedStream(nodeId);
+ String streamName = "NETCONF";
if (streamName == null) {
streamName = "OPENROADM";
.OrgOpenroadmDeviceListener> accessDeviceNotificationListenerRegistration =
notificationService.get().registerNotificationListener(deviceListener);
-// final org.opendaylight.yang.gen.v1.http.org.openroadm.lldp.rev181019.OrgOpenroadmLldpListener
-// lldpListener = new LldpListener221(linkDiscovery, nodeId);
-// LOG.info("Registering notification listener on OrgOpenroadmLldpListener for node: {}", nodeId);
-// final ListenerRegistration<org.opendaylight.yang.gen.v1.http.org.openroadm
-// .lldp.rev181019.OrgOpenroadmLldpListener> accessLldpNotificationListenerRegistration =
-// notificationService.get().registerNotificationListener(lldpListener);
-
final org.opendaylight.yang.gen.v1.http.org.openroadm.tca.rev181019.OrgOpenroadmTcaListener
tcaListener = new TcaListener221();
LOG.info("Registering notification listener on OrgOpenroadmTcaListener for node: {}", nodeId);
String streamName = "NETCONF";
- //getSupportedStream(nodeId);
if (streamName == null) {
streamName = "OPENROADM";
}
nodeRegistration.getAccessAlarmNotificationListenerRegistration().close();
nodeRegistration.getAccessDeOperationasNotificationListenerRegistration().close();
nodeRegistration.getAccessDeviceNotificationListenerRegistration().close();
-// nodeRegistration.getAccessLldpNotificationListenerRegistration().close();
nodeRegistration.getAccessTcaNotificationListenerRegistration().close();
}
}
}
- private String getSupportedStream(String nodeId) {
+ /*private String getSupportedStream(String nodeId) {
InstanceIdentifier<Streams> streamsIID = InstanceIdentifier.create(Netconf.class).child(Streams.class);
try {
Optional<Streams> ordmInfoObject =
LOG.error("NullPointerException thrown while getting Info from a non Open ROADM device {}", nodeId);
return "NETCONF";
}
- }
+ }*/
}
import org.opendaylight.yang.gen.v1.http.org.openroadm.lldp.rev161014.LldpNbrInfoChange;
import org.opendaylight.yang.gen.v1.http.org.openroadm.lldp.rev161014.OrgOpenroadmLldpListener;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.resource.types.rev161014.ResourceNotificationType;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.NodeId;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class LldpListener implements OrgOpenroadmLldpListener {
private static final Logger LOG = LoggerFactory.getLogger(LldpListener.class);
- //private final R2RLinkDiscovery linkDiscovery;
private final NodeId nodeId;
public LldpListener(final String nodeId) {
@Override
public void onLldpNbrInfoChange(LldpNbrInfoChange notification) {
LOG.info("Notification {} received {}", LldpNbrInfoChange.QNAME, notification);
- if (notification.getNotificationType().equals(ResourceNotificationType.ResourceCreation)) {
- /*linkDiscovery.createR2RLink(nodeId,notification.getResource(),
- notification.getNbrInfo().getRemoteSysName(),
- notification.getNbrInfo().getRemotePortId());*/
- } else if (notification.getNotificationType().equals(ResourceNotificationType.ResourceDeletion)) {
- /*linkDiscovery.deleteR2RLink(nodeId,notification.getResource(),
- notification.getNbrInfo().getRemoteSysName(),
- notification.getNbrInfo().getRemotePortId());*/
- }
}
}
private static final boolean CREATE_MISSING_PARENTS = true;
private NetworkTransactionService networkTransactionService;
- //private final R2RLinkDiscoveryFactoryMethod linkDiscovery;
private final R2RLinkDiscovery linkDiscovery;
private final DeviceTransactionManager deviceTransactionManager;
private final OpenRoadmFactory openRoadmFactory;
openRoadmTopologyLink, CREATE_MISSING_PARENTS);
}
networkTransactionService.submit().get();
- //linkDiscovery.readLLDP(nodeId);
LOG.info("all nodes and links created");
} catch (InterruptedException | ExecutionException e) {
LOG.error("ERROR: ", e);
if (link.isPresent()) {
LinkBuilder linkBuilder = new LinkBuilder(link.get());
Link1Builder link1Builder = new Link1Builder(linkBuilder.augmentation(Link1.class));
-// link1Builder.setAdministrativeState(State.OutOfService);
linkBuilder.removeAugmentation(Link1.class);
linkBuilder.addAugmentation(Link1.class,link1Builder.build());
networkTransactionService.merge(LogicalDatastoreType.CONFIGURATION, linkIID.build(),
return true;
}
- /**
+ /*
* This method does an edit-config on roadm connection subtree for a given
* connection number in order to set power level for use by the optical
* power control.
* WaveLength number part of request
* @return true/false based on status of operation.
*/
- private boolean setTransponderPowerTx(Nodes inputNode, String destTpId, String srgId,
+ /*private boolean setTransponderPowerTx(Nodes inputNode, String destTpId, String srgId,
String nextNodeId, Long waveLength) {
Map<String, Double> txPowerRangeMap = null;
Map<String, Double> rxSRGPowerRangeMap = null;
LOG.info("Mapping object not found for nodeId: {}", nodeId);
return false;
}
- }
+ }*/
/**
* This method retrieves transponder OCH interface and
}
}
- /**
+ /*
* This method retrieves transponder OCH interface and
* sets power.
*
* Wavelength Number *
* @return true/false based on status of operation
*/
- private boolean callSetRoadmPowerTx(String nodeId, String interfaceName,
+ /*private boolean callSetRoadmPowerTx(String nodeId, String interfaceName,
OpenroadmVersion openroadmVersion,
Long wavelength, String connectionNumber) {
if (interfaceName == null) {
return false;
}
return false;
- }
+ }*/
}
// Resource
AToZKey srcTPKey = new AToZKey(index.toString());
- // tpName);
Resource tpResource1 = new ResourceBuilder().setResource(stp).build();
AToZ stpResource = new AToZBuilder().setId(tpName).withKey(srcTPKey).setResource(tpResource1).build();
index++;
return rc.getResponseCode();
}
- public GnpyResult getGnpy_AtoZ() {
+ public GnpyResult getGnpyAtoZ() {
return gnpyAtoZ;
}
- public GnpyResult getGnpy_ZtoA() {
+ public GnpyResult getGnpyZtoA() {
return gnpyZtoA;
}
}
result = Optional.of(path);
}
}
-// return pathDescReadTx.read(LogicalDatastoreType.CONFIGURATION, pathDescriptionIID)
-// .get(Timeouts.DATASTORE_READ, TimeUnit.MILLISECONDS);
} catch (InterruptedException | ExecutionException | TimeoutException e) {
LOG.warn(
"PCE diversity constraints: Exception while getting path description from datastore {} for service {}!",
destId = element1.getUid();
destIp = null;
// Create a new link
- if (srcId != destId) {
+ if (!destId.equals(srcId)) {
Connections connection = createNewConnection(srcId, srcIp,
destId, destIp);
topoConnections.add(connection);
// Create a new link
destId = element1.getUid();
destIp = null;
- if (srcId != destId) {
+ if (!destId.equals(srcId)) {
Connections connection = createNewConnection(srcId, srcIp, destId, destIp);
topoConnections.add(connection);
srcId = destId;
// Create a new link
destId = element1.getUid();
destIp = null;
- if (srcId != destId) {
+ if (!destId.equals(srcId)) {
Connections connection = createNewConnection(srcId, srcIp, destId, destIp);
topoConnections.add(connection);
srcId = destId;
IpAddress ipAddress = mapNodeRefIp.get(nodeRef);
for (Elements element : elements) {
if (element.getUid().contains(ipAddress.getIpv4Address().getValue().toString())) {
- if ((ipAddressCurrent == null) || (ipAddressCurrent != ipAddress)) {
+ if ((ipAddressCurrent == null) || (!ipAddress.equals(ipAddressCurrent))) {
ipAddressCurrent = ipAddress;
// Fill in routeObjectIncludeExcludes
RouteObjectIncludeExclude routeObjectIncludeExclude1 = addRouteObjectIncludeExclude(
IpAddress ipAddress = mapNodeRefIp.get(nodeRef);
for (Elements element : elements) {
if (element.getUid().contains(ipAddress.getIpv4Address().getValue().toString())) {
- if ((ipAddressCurrent == null) || (ipAddressCurrent != ipAddress)) {
+ if ((ipAddressCurrent == null) || (!ipAddress.equals(ipAddressCurrent))) {
ipAddressCurrent = ipAddress;
// Fill in routeObjectIncludeExcludes
RouteObjectIncludeExclude routeObjectIncludeExclude1 = addRouteObjectIncludeExclude(
LOG.debug("InAlgoPathValidator: partialPath size: {} prev edge {} new edge {}",
size, edge.link().getlinkType(), partialPath.getEdgeList().get(size - 1).link().getlinkType());
- if (!checkTurn(partialPath.getEdgeList().get(size - 1).link().getlinkType(), edge.link().getlinkType())) {
- return false;
- }
- if (!checkLimits(partialPath, edge, pceHardConstraints)) {
- return false;
- }
- if (!checkInclude(partialPath, edge, zendNode, pceHardConstraints)) {
+ if ((!checkTurn(partialPath.getEdgeList().get(size - 1).link().getlinkType(), edge.link().getlinkType()))
+ || (!checkLimits(partialPath, edge, pceHardConstraints))
+ || (!checkInclude(partialPath, edge, zendNode, pceHardConstraints))) {
return false;
+ } else {
+ return true;
}
-
- return true;
}
private boolean checkTurn(OpenroadmLinkType prevType, OpenroadmLinkType nextType) {
listOfElementsCLLI.addAll(listOfElementsBuild(pathEdges, PceConstraints.ResourceType.CLLI));
List<String> listOfElementsSRLG = new ArrayList<String>();
- listOfElementsSRLG.add("NONE"); // first link is XPONDEROUTPUT, no SRLG for it
+ // first link is XPONDEROUTPUT, no SRLG for it
+ listOfElementsSRLG.add("NONE");
listOfElementsSRLG.addAll(listOfElementsBuild(pathEdges, PceConstraints.ResourceType.SRLG));
// validation: check each type for each element
continue;
}
}
- if (found == false) {
+ if (!found) {
// there is no specific srlg to include. thus add to list just the first one
listOfElements.add("NONE");
}
private static final Logger LOG = LoggerFactory.getLogger(PceGraph.class);
////////////////////////// for Graph ///////////////////////////
- int kpathsToBring = 10; // how many paths to bring
- int mhopsPerPath = 50; // max #hops
+ // how many paths to bring
+ int kpathsToBring = 10;
+ // max #hops
+ int mhopsPerPath = 50;
// input
private Map<NodeId, PceNode> allPceNodes = new HashMap<NodeId, PceNode>();
LOG.info("In GraphCalculator: A and Z = {} / {} ", aendNode.toString(), zendNode.toString());
LOG.debug("In GraphCalculator: allPceNodes size {}, nodes {} ", allPceNodes.size(), allPceNodes.toString());
- // PceCalculation.printNodesInfo(allPceNodes);
-
}
public boolean calcPath() {
private String znodeId = "";
private PceConstraints pceHardConstraints;
-// private PceConstraints pceSoftConstraints;
///////////// Intermediate data/////////////////
private List<PceLink> addLinks = new ArrayList<PceLink>();
this.returnStructure = rc;
this.pceHardConstraints = pceHardConstraints;
-// this.pceSoftConstraints = pceSoftConstraints;
parseInput();
}
}
printNodesInfo(allPceNodes);
- // printLinksInfo(allPceLinks);
returnStructure.setRC(ResponseCodes.RESPONSE_OK);
return;
LOG.debug("validateLink: DROP-LINK saved {}", pcelink.toString());
break;
case XPONDERINPUT :
- azSrgs.add(sourceId); // store separately all SRG links directly
+ // store separately all SRG links directly
+ azSrgs.add(sourceId);
// connected to A/Z
if (!dest.checkTP(pcelink.getDestTP().toString())) {
LOG.debug("validateLink: XPONDER-INPUT is rejected as NW port is busy - {} ", pcelink.toString());
source.addOutgoingLink(pcelink);
LOG.debug("validateLink: XPONDER-INPUT link added to allPceLinks {}", pcelink.toString());
break;
- case XPONDEROUTPUT : // does it mean XPONDER==>>SRG ?
- azSrgs.add(destId); // store separately all SRG links directly
+ // does it mean XPONDER==>>SRG ?
+ case XPONDEROUTPUT :
+ // store separately all SRG links directly
+ azSrgs.add(destId);
// connected to A/Z
if (!source.checkTP(pcelink.getSourceTP().toString())) {
LOG.debug("validateLink: XPONDER-OUTPUT is rejected as NW port is busy - {} ", pcelink.toString());
break;
}
- if (pceNode.getSupNodeIdPceNode().equals(anodeId)) {
- if (endPceNode(nodeType,pceNode.getNodeId(), pceNode)) {
- this.aendPceNode = pceNode;
- }
+ if ((pceNode.getSupNodeIdPceNode().equals(anodeId)) && (endPceNode(nodeType,pceNode.getNodeId(), pceNode))) {
+ this.aendPceNode = pceNode;
}
- if (pceNode.getSupNodeIdPceNode().equals(znodeId)) {
- if (endPceNode(nodeType,pceNode.getNodeId(), pceNode)) {
- this.zendPceNode = pceNode;
- }
+ if ((pceNode.getSupNodeIdPceNode().equals(znodeId)) && (endPceNode(nodeType,pceNode.getNodeId(), pceNode))) {
+ this.zendPceNode = pceNode;
}
allPceNodes.put(pceNode.getNodeId(), pceNode);
}
}
- private static void printLinksInfo(Map<LinkId, PceLink> allpcelinks) {
+ /*private static void printLinksInfo(Map<LinkId, PceLink> allpcelinks) {
Iterator<Map.Entry<LinkId, PceLink>> links = allpcelinks.entrySet().iterator();
while (links.hasNext()) {
LOG.info("In printLinksInfo link {} : ", links.next().getValue().toString());
}
- }
+ }*/
}
import java.util.List;
-import org.eclipse.jdt.annotation.Nullable;
import org.opendaylight.transportpce.pce.constraints.PceConstraints;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev181130.Link1;
import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev181130.networks.network.link.oms.attributes.Span;
LOG.debug("PceLink: created PceLink {}", toString());
}
- private OpenroadmLinkType calcType(Link link) {
+ /*private OpenroadmLinkType calcType(Link link) {
org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev181130.@Nullable Link1 link1 = null;
OpenroadmLinkType tmplinkType = null;
return null;
}
return tmplinkType;
- }
+ }*/
private LinkId calcOpposite(Link link) {
// opposite link
// sum of 1 over the span OSNRs (linear units)
double sum = 0;
// link OSNR, in dB
- double linkOsnrDb;
+ //double linkOsnrDb;
// link OSNR, in dB
double linkOsnrLu;
// span OSNR, in dB
// span OSNR, in linear units
double spanOsnrLu;
// default amplifier noise value, in dB
- double ampNoise = 5.5;
+ //double ampNoise = 5.5;
// fiber span measured loss, in dB
double loss;
// launch power, in dB
spanOsnrLu = Math.pow(10, (spanOsnrDb / 10.0));
sum = PceConstraints.CONST_OSNR / spanOsnrLu;
linkOsnrLu = sum;
- //link_osnr_dB = 10 * Math.log10(1 / sum);
LOG.debug("In retrieveosnr: link osnr is {} dB", linkOsnrLu);
return linkOsnrLu;
}
return;
}
-
-
-/* public PceNode(Node node, OpenroadmNodeType nodeType, NodeId nodeId,
- String supNodeId, String clli) {
- this.node = node;
- this.nodeId = nodeId;
- this.nodeType = nodeType;
- this.supNodeId = supNodeId;
- this.clli = clli;
-
- if ((node == null) || (nodeId == null) || (nodeType == null)
- || (supNodeId == null) || (clli == null)) {
- LOG.error(
- "PceNode: one of parameters is not populated : nodeId, node type, supporting nodeId");
- valid = false;
- }
-
- LOG.debug(" PceNode built :{}", this.toString());
- }
-*/
public void initWLlist() {
this.availableWLindex.clear();
if (!isValid()) {
if (!this.availableSrgPp.isEmpty()) {
Optional<String> client = null;
final OpenroadmTpType openType = srgType;
- client = this.availableSrgPp.entrySet().stream().filter(pp -> pp.getValue().getName() == openType.getName())
+ client = this.availableSrgPp.entrySet()
+ .stream().filter(pp -> pp.getValue().getName().equals(openType.getName()))
.map(Map.Entry::getKey)
.sorted(new SortPortsByName())
.findFirst();
.setResponseParameters(rpb.build());
//add the GNPy result
- GnpyResult gnpyAtoZ = sendingPCE.getGnpy_AtoZ();
- GnpyResult gnpyZtoA = sendingPCE.getGnpy_ZtoA();
+ GnpyResult gnpyAtoZ = sendingPCE.getGnpyAtoZ();
+ GnpyResult gnpyZtoA = sendingPCE.getGnpyZtoA();
List<GnpyResponse> listResponse = new ArrayList<>();
if (gnpyAtoZ != null) {
GnpyResponse respAtoZ = generateGnpyResponse(gnpyAtoZ.getResponse(),"A-to-Z");
return gnpypResp;
}
-}
\ No newline at end of file
+}
// Ethernet interface specific data
EthernetBuilder ethIfBuilder = new EthernetBuilder();
- //ethIfBuilder.setAutoNegotiation(EthAttributes.AutoNegotiation.Enabled);
- //ethIfBuilder.setDuplex(EthAttributes.Duplex.Full);
ethIfBuilder.setFec(EthAttributes.Fec.Off);
ethIfBuilder.setSpeed(100000L);
- //ethIfBuilder.setMtu(9000L);
InterfaceBuilder ethInterfaceBldr = createGenericInterfaceBuilder(portMap, EthernetCsmacd.class,
logicalConnPoint + "-ETHERNET");
success.set(false);
LOG.warn(result);
forkJoinPool.shutdown();
- return; // TODO should deletion end here?
+ return;
+ //TODO should deletion end here?
}
for (String interfaceId : interfacesToDelete) {
try {
GetPmOutput getPmOutput = getPmRpcResult.getResult();
if ((getPmOutput != null) && (getPmOutput.getNodeId() != null)) {
LOG.info("successfully finished calling OLM's get PM");
- return getPmOutput.getMeasurements(); // may return null
+ return getPmOutput.getMeasurements();
+ // may return null
} else {
LOG.warn("OLM's get PM failed for node {} and tp {}", nodeId, tp);
}
servicePathRpcResult = notification;
PathDescription pathDescription = null;
switch (servicePathRpcResult.getNotificationType().getIntValue()) {
- case 1: /** path-computation-request. */
+ /* path-computation-request. */
+ case 1:
LOG.info("PCE '{}' Notification received : {}",servicePathRpcResult.getNotificationType().getName(),
notification);
if (servicePathRpcResult.getStatus() == RpcStatusEx.Successful) {
return;
}
break;
- case 2: /** cancel-resource-reserve. */
+ /* cancel-resource-reserve. */
+ case 2:
if (servicePathRpcResult.getStatus() == RpcStatusEx.Successful) {
LOG.info("PCE cancel resource done OK !");
OperationResult deleteServicePathOperationResult =
if (servicePathRpcResult.getNotificationType() != notification.getNotificationType()) {
result = false;
}
- if (servicePathRpcResult.getServiceName() != notification.getServiceName()) {
+ if (!servicePathRpcResult.getServiceName().equals(notification.getServiceName())) {
result = false;
}
if (servicePathRpcResult.getStatus() != notification.getStatus()) {
result = false;
}
- if (servicePathRpcResult.getStatusMessage() != notification.getStatusMessage()) {
+ if (!servicePathRpcResult.getStatusMessage().equals(notification.getStatusMessage())) {
result = false;
}
}
LOG.info("Renderer '{}' Notification received : {}", serviceRpcResultSp.getNotificationType().getName(),
notification);
switch (notifType) {
- case 3 : /** service-implementation-request. */
+ /* service-implementation-request. */
+ case 3 :
if (serviceRpcResultSp.getStatus() == RpcStatusEx.Successful) {
LOG.info("Service implemented !");
OperationResult operationResult = null;
}
}
break;
-
- case 4 : /** service-delete. */
+ /* service-delete. */
+ case 4 :
if (serviceRpcResultSp.getStatus() == RpcStatusEx.Successful) {
LOG.info("Service '{}' deleted !", serviceName);
if (this.input != null) {
if (serviceRpcResultSp.getNotificationType() != notification.getNotificationType()) {
result = false;
}
- if (serviceRpcResultSp.getServiceName() != notification.getServiceName()) {
+ if (!serviceRpcResultSp.getServiceName().equals(notification.getServiceName())) {
result = false;
}
if (serviceRpcResultSp.getStatus() != notification.getStatus()) {
result = false;
}
- if (serviceRpcResultSp.getStatusMessage() != notification.getStatusMessage()) {
+ if (!serviceRpcResultSp.getStatusMessage().equals(notification.getStatusMessage())) {
result = false;
}
}
result = "Failed to " + action + " service from Service List";
}
} else {
- if (choice == 2) { /* Write Service */
+ /*
+ * Write Service.
+ */
+ if (choice == 2) {
LOG.debug("Writing '{}' Service", serviceName);
InstanceIdentifier<Services> iid = InstanceIdentifier.create(ServiceList.class)
.child(Services.class, new ServicesKey(serviceName));
CancelResourceReserveOutput output = null;
try {
LOG.info("Wait for 5s til beginning the PCE cancel resource request");
- Thread.sleep(5000); // sleep for 1s
+ Thread.sleep(5000);
} catch (InterruptedException e) {
message = "path computation service failed !";
LOG.error("path computation service failed !", e);
PathComputationRequestOutput output = null;
try {
LOG.info("Wait for 5s til beginning the PCE pathComputation request");
- Thread.sleep(5000); // sleep for 1s
+ Thread.sleep(5000);
} catch (InterruptedException e) {
message = "path computation service failed !";
LOG.error("path computation service failed !", e);
ServiceImplementationRequestOutput output = null;
try {
LOG.info("Wait for 5s til beginning the Renderer serviceImplementation request");
- Thread.sleep(5000); // sleep for 1s
+ Thread.sleep(5000);
} catch (InterruptedException e) {
message = "renderer failed !";
rpcStatusEx = RpcStatusEx.Failed;
ServiceDeleteOutput output = null;
try {
LOG.info("Wait for 5s til beginning the Renderer serviceDelete request");
- Thread.sleep(5000); // sleep for 1s
+ Thread.sleep(5000);
} catch (InterruptedException e) {
message = "deleting service failed !";
LOG.error("deleting service failed !", e);