Fix port-mapping bug for 7.1 device-models
[transportpce.git] / pce / src / main / java / org / opendaylight / transportpce / pce / PceComplianceCheck.java
index 022aa32667c8bf64fc00077a858decf105d380ab..92585ecba08a0d190b277656020aff5502b353a5 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.transportpce.pce;
 
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev220615.PathComputationRequestInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev220808.PathComputationRequestInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev220808.PathComputationRerouteRequestInput;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -56,4 +57,18 @@ public final class PceComplianceCheck {
         return new PceComplianceCheckResult(result, message);
     }
 
+    public static PceComplianceCheckResult check(PathComputationRerouteRequestInput input) {
+        if (input == null) {
+            return new PceComplianceCheckResult(false, "");
+        }
+        if (input.getEndpoints() == null
+                || input.getEndpoints().getAEndTp() == null
+                || input.getEndpoints().getZEndTp() == null) {
+            String message = "At least one of the termination points is missing";
+            LOG.debug(message);
+            return new PceComplianceCheckResult(false, message);
+        }
+        return new PceComplianceCheckResult(true, "");
+    }
+
 }