import org.opendaylight.transportpce.pce.constraints.PceConstraints.ResourcePair;
import org.opendaylight.transportpce.pce.networkanalyzer.PceNode;
import org.opendaylight.transportpce.pce.networkanalyzer.PceResult;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev210701.SpectrumAssignment;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev210701.SpectrumAssignmentBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev220118.SpectrumAssignment;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev220118.SpectrumAssignmentBuilder;
import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev200529.OpenroadmLinkType;
import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.common.types.rev181130.OpucnTribSlotDef;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.NodeId;
public static final Long CONST_OSNR = 1L;
public static final double SYS_MARGIN = 0;
+ @SuppressWarnings("fallthrough")
@SuppressFBWarnings(
value = "SF_SWITCH_FALLTHROUGH",
justification = "intentional fallthrough")
SpectrumAssignment spectrumAssignment = null;
//variable to deal with 1GE (Nb=1) and 10GE (Nb=10) cases
switch (serviceType) {
+ case StringConstants.SERVICE_TYPE_OTUC2:
+ case StringConstants.SERVICE_TYPE_OTUC3:
case StringConstants.SERVICE_TYPE_OTUC4:
case StringConstants.SERVICE_TYPE_400GE:
spectralWidthSlotNumber = GridConstant.SPECTRAL_WIDTH_SLOT_NUMBER_MAP
}
break;
case StringConstants.SERVICE_TYPE_ODU4:
+ case StringConstants.SERVICE_TYPE_ODUC2:
+ case StringConstants.SERVICE_TYPE_ODUC3:
case StringConstants.SERVICE_TYPE_ODUC4:
+ case StringConstants.SERVICE_TYPE_100GE_S:
pceResult.setRC(ResponseCodes.RESPONSE_OK);
- LOG.info("In PostAlgoPathValidator: ODU4/ODUC4 path found {}", path);
+ pceResult.setServiceType(serviceType);
+ LOG.info("In PostAlgoPathValidator: ODU4/ODUCn path found {}", path);
break;
default:
pceResult.setRC(ResponseCodes.RESPONSE_FAILED);
double latency = 0;
for (PceGraphEdge edge : path.getEdgeList()) {
- try {
- latency += edge.link().getLatency();
- LOG.debug("- In checkLatency: latency of {} = {} units", edge.link().getLinkId().getValue(), latency);
- } catch (NullPointerException e) {
+ if (edge.link() == null || edge.link().getLatency() == null) {
LOG.warn("- In checkLatency: the link {} does not contain latency field",
edge.link().getLinkId().getValue());
+ return false;
}
+ latency += edge.link().getLatency();
+ LOG.debug("- In checkLatency: latency of {} = {} units", edge.link().getLinkId().getValue(), latency);
}
return (latency < maxLatency);
}