TAPI topology creation for 100GE Transponder
[transportpce.git] / tapi / src / main / java / org / opendaylight / transportpce / tapi / validation / checks / EndPointCheck.java
diff --git a/tapi/src/main/java/org/opendaylight/transportpce/tapi/validation/checks/EndPointCheck.java b/tapi/src/main/java/org/opendaylight/transportpce/tapi/validation/checks/EndPointCheck.java
new file mode 100644 (file)
index 0000000..ca09f0e
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * Copyright © 2018 Orange, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.transportpce.tapi.validation.checks;
+
+import java.util.List;
+
+import org.opendaylight.transportpce.servicehandler.validation.checks.ComplianceCheckResult;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.connectivity.rev181210.create.connectivity.service.input.EndPoint;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public final class EndPointCheck {
+
+    private static final Logger LOG = LoggerFactory.getLogger(EndPointCheck.class);
+
+    private EndPointCheck() {
+    }
+
+    public static boolean checkString(String value) {
+        return ((value != null) && (value.compareTo("") != 0));
+    }
+
+    public static ComplianceCheckResult check(List<EndPoint> epl) {
+        boolean result = true;
+        String message = "";
+
+        if (epl.isEmpty()) {
+            result = false;
+            message = "Service End-Point must be set";
+        } else {
+            for (EndPoint ep : epl) {
+                //to do
+                LOG.info("ep = {}", ep.toString());
+            }
+        }
+
+        return new ComplianceCheckResult(result, message);
+    }
+}