public boolean getDeviceInfo(String nodeId, DeviceTransactionManager deviceTransactionManager) {
switch (this.openRoadmVersion) {
case StringConstants.OPENROADM_DEVICE_VERSION_1_2_1:
- return getDeviceInfo1_2_1(nodeId, deviceTransactionManager);
+ return getDeviceInfo121(nodeId, deviceTransactionManager);
case StringConstants.OPENROADM_DEVICE_VERSION_2_2_1:
- return getDeviceInfo2_2_1(nodeId, deviceTransactionManager);
+ return getDeviceInfo221(nodeId, deviceTransactionManager);
default:
LOG.info("Device version {} not supported",this.openRoadmVersion);
return false;
}
- private boolean getDeviceInfo1_2_1(String nodeId, DeviceTransactionManager deviceTransactionManager) {
+ private boolean getDeviceInfo121(String nodeId, DeviceTransactionManager deviceTransactionManager) {
//Read clli from the device
InstanceIdentifier<Info> infoIID = InstanceIdentifier.create(OrgOpenroadmDevice.class).child(Info.class);
}
- private boolean getDeviceInfo2_2_1(String nodeId, DeviceTransactionManager deviceTransactionManager) {
+ private boolean getDeviceInfo221(String nodeId, DeviceTransactionManager deviceTransactionManager) {
//TODO : change back to operational when testing on real device
//Read clli from the device
for (CircuitPacks cp : deviceObject.get().getCircuitPacks()) {
if (cp.getPorts() != null) {
for (Ports port : cp.getPorts()) {
- if (port.getPortQual() != null) {
- if (port.getPortQual().getIntValue() == 4) {
- client++;
- }
+ if ((port.getPortQual() != null) && (port.getPortQual().getIntValue() == 4)) {
+ client++;
}
}
}
for (CircuitPacks cp : deviceObject.get().getCircuitPacks()) {
if (cp.getPorts() != null) {
for (Ports port : cp.getPorts()) {
- if (port.getPortQual() != null) {
- if (port.getPortQual().getIntValue() == 4) {
- client++;
- }
+ if ((port.getPortQual() != null) && (port.getPortQual().getIntValue() == 4)) {
+ client++;
}
}
}
}
Diversity diversity = tmpGeneral.getDiversity();
- if (diversity != null) {
- if (diversity.getExistingServiceApplicability().isNode()) {
- LOG.info("in readGeneralContrains {}", diversity.toString());
- readDiversityNodes(diversity.getExistingService(), constraints);
- }
+ if ((diversity != null) && (diversity.getExistingServiceApplicability().isNode())) {
+ LOG.info("in readGeneralContrains {}", diversity.toString());
+ readDiversityNodes(diversity.getExistingService(), constraints);
}
}
Long latencyConstraint = this.pceHardConstraints.getMaxLatency();
- if (latencyConstraint > 0) {
- if (this.tmpAtozLatency > latencyConstraint) {
- this.foundButTooHighLatency = true;
- this.pceResult.setLocalCause(LocalCause.TOO_HIGH_LATENCY);
- LOG.info("In validateLatency: AtoZ path has too high LATENCY {} > {}", this.tmpAtozLatency,
- latencyConstraint);
- return false;
- }
+ if ((latencyConstraint > 0) && (this.tmpAtozLatency > latencyConstraint)) {
+ this.foundButTooHighLatency = true;
+ this.pceResult.setLocalCause(LocalCause.TOO_HIGH_LATENCY);
+ LOG.info("In validateLatency: AtoZ path has too high LATENCY {} > {}", this.tmpAtozLatency,
+ latencyConstraint);
+ return false;
}
LOG.info("In validateLatency: AtoZ path is {}", this.pathAtoZ.toString());
return true;
}
public boolean checkTP(String tp) {
- if (this.usedXpndrNWTps.contains(tp)) {
- return false;
- }
- return true;
+ return !(this.usedXpndrNWTps.contains(tp));
}
public boolean checkWL(long index) {
- if (this.availableWLindex.contains(index)) {
- return true;
- }
- return false;
+ return (this.availableWLindex.contains(index));
}
public boolean isValid() {
public String toString() {
return "PceNode type=" + this.nodeType + " ID=" + this.nodeId.getValue();
}
-}
\ No newline at end of file
+}
PathDescriptionBuilder path = null;
path = sendingPCE.getPathDescription();
LOG.info("PCE response: {} {}", message, responseCode);
- if ((sendingPCE.getSuccess() == false) || (path == null)) {
+ if (!(sendingPCE.getSuccess()) || (path == null)) {
configurationResponseCommon.setAckFinalIndicator("Yes")
.setRequestId(input.getServiceHandlerHeader().getRequestId()).setResponseCode(responseCode)
.setResponseMessage(message);
return result.build();
}
- private static Exclude updateExclude(Exclude hard, Exclude soft) throws NullPointerException {
+ private static Exclude updateExclude(Exclude hard, Exclude soft) {
ExcludeBuilder result = new ExcludeBuilder(soft);
if (hard != null) {
result.getFiberBundle().addAll(hard.getFiberBundle());
return result.build();
}
- private static Diversity updateDiveristy(Diversity hard, Diversity soft) throws NullPointerException {
+ private static Diversity updateDiveristy(Diversity hard, Diversity soft) {
DiversityBuilder result = new DiversityBuilder(soft);
if (hard != null) {
result.getExistingService().addAll(hard.getExistingService());
.or.general.co.routing.CoRouting updateCoCoRouting(org.opendaylight.yang.gen.v1.http.org.openroadm.routing
.constrains.rev161014.constraints.co.routing.or.general.co.routing.CoRouting hard, org.opendaylight
.yang.gen.v1.http.org.openroadm.routing.constrains.rev161014.constraints.co.routing.or.general.co
- .routing.CoRouting soft) throws NullPointerException {
+ .routing.CoRouting soft) {
org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev161014.constraints.co.routing.or.general
.co.routing.CoRoutingBuilder result = new org.opendaylight.yang.gen.v1.http.org.openroadm.routing
.constrains.rev161014.constraints.co.routing.or.general.co.routing.CoRoutingBuilder(soft);