package org.opendaylight.transportpce.pce.graph;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
public static final Long CONST_OSNR = 1L;
public static final double SYS_MARGIN = 0;
+ @SuppressFBWarnings(
+ value = "SF_SWITCH_FALLTHROUGH",
+ justification = "intentional fallthrough")
public PceResult checkPath(GraphPath<String, PceGraphEdge> path, Map<NodeId, PceNode> allPceNodes,
PceResult pceResult, PceConstraints pceHardConstraints, String serviceType) {
return tribSlotMap;
}
- private List<List<Uint16>> chooseTribSlot3(GraphPath<String, PceGraphEdge> path,
- Map<NodeId, PceNode> allPceNodes) {
- List<List<Uint16>> tribSlot = new ArrayList<>();
- boolean statusOK = true;
- boolean check = false;
- Object nodeClass = allPceNodes.getClass();
- if (nodeClass.getClass().isInstance(PceNode.class)) {
- LOG.debug("In choosetribSlot: AllPceNodes contains PceNode instance, no trib port search");
- return tribSlot;
- } else if (nodeClass.getClass().isInstance(PceNode.class)) {
- LOG.debug("In choosetribPort: {} {}", path.getLength(), path);
- }
- for (PceGraphEdge edge : path.getEdgeList()) {
- LOG.debug("In chooseTribSlot: source {} ", edge.link().getSourceId());
- PceNode pceNode = allPceNodes.get(edge.link().getSourceId());
- Object tps = allPceNodes.get(edge.link().getSourceTP());
- Object tpd = allPceNodes.get(edge.link().getDestTP());
- if ((pceNode.getAvailableTribSlots().containsKey(tps.toString()))
- && (pceNode.getAvailableTribSlots().containsKey(tpd.toString()))) {
- List<Uint16> tribSlotEdgeSourceN = pceNode.getAvailableTribSlots().get(tps.toString());
- List<Uint16> tribSlotEdgeDestN = pceNode.getAvailableTribSlots().get(tps.toString());
- check = false;
- for (int i = 0; i <= 79; i++) {
- if (tribSlotEdgeSourceN.get(i) == null) {
- break;
- }
- // TODO This will need to be modified as soon as the trib-slots allocation per
- // trib-port
- // policy applied by the different manufacturer is known
- if (tribSlotEdgeSourceN.get(i).equals(tribSlotEdgeDestN.get(i))) {
- check = true;
- } else {
- check = false;
- LOG.debug("In chooseTribSlot: Misalignement of trib slots between source {} and dest {}",
- edge.link().getSourceId(), edge.link().getDestId());
- break;
- }
- }
- if (check) {
- tribSlot.add(tribSlotEdgeSourceN);
- }
- } else {
- LOG.debug("In chooseTribSlot: source {} does not have provisonned hosting HO interface ",
- edge.link().getSourceId());
- statusOK = false;
- }
- }
- if (statusOK && check) {
- return tribSlot;
- } else {
- tribSlot.clear();
- return tribSlot;
- }
- }
-
// Check the path OSNR
private boolean checkOSNR(GraphPath<String, PceGraphEdge> path) {
double linkOsnrDb;
return false;
}
- private Boolean findClientCompliantInterface(List<SupportedInterfaceCapability> sic) {
- boolean compliant = false;
- for (SupportedInterfaceCapability sit : sic) {
- String interfacetype = sit.getIfCapType().getName();
- switch (interfacetype) {
- case "If1GEODU0":
- case "If1GE":
- if ("1GE".equals(this.otnServiceType)) {
- compliant = true;
- }
- break;
- case "If10GEODU2e":
- case "If10GE":
- if ("10GE".equals(this.otnServiceType)) {
- compliant = true;
- }
- break;
- case "If100GEODU4":
- case "If100GE":
- if ("100GE".equals(this.otnServiceType)) {
- compliant = true;
- }
- break;
- case "IfOTU4ODU4":
- case "IfOCHOTU4ODU4":
- if ("OTU4".equals(this.otnServiceType) || "ODU4".equals(this.otnServiceType)) {
- compliant = true;
- }
- break;
- default:
- compliant = false;
- break;
- }
- }
- return compliant;
- }
-
- private Boolean findNetworkCompliantInterface(List<SupportedInterfaceCapability> sic) {
- boolean compliant = false;
- for (SupportedInterfaceCapability sit : sic) {
- String interfacetype = sit.getIfCapType().toString();
- switch (interfacetype) {
- case "IfOTU4ODU4":
- case "IfOCHOTU4ODU4":
- compliant = true;
- break;
- case "IfOTU2ODU2":
- case "IfOCHOTU2ODU2":
- if (("1GE".equals(this.otnServiceType)) || ("10GE".equals(this.otnServiceType))) {
- compliant = true;
- }
- break;
- // add all use case with higher rate interfaces when it shows up
- default:
- compliant = false;
- break;
- }
- }
- return compliant;
- }
-
public void validateXponder(String anodeId, String znodeId) {
if (!isValid()) {
return;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.ListeningExecutorService;
import com.google.common.util.concurrent.MoreExecutors;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Callable;
LOG.info("close.");
}
+ @SuppressFBWarnings(
+ value = "UPM_UNCALLED_PRIVATE_METHOD",
+ justification = "false positive, this method is used by public method cancelResourceReserve")
private void sendNotifications(ServicePathNotificationTypes servicePathNotificationTypes, String serviceName,
RpcStatusEx rpcStatusEx, String message, PathDescription pathDescription) {
ServicePathRpcResultBuilder servicePathRpcResultBuilder =