Stubpce Update
[transportpce.git] / tests / stubpce / src / main / java / org / opendaylight / transportpce / stubpce / CheckCoherencyHardSoft.java
diff --git a/tests/stubpce/src/main/java/org/opendaylight/transportpce/stubpce/CheckCoherencyHardSoft.java b/tests/stubpce/src/main/java/org/opendaylight/transportpce/stubpce/CheckCoherencyHardSoft.java
new file mode 100644 (file)
index 0000000..bae514f
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * Copyright © 2017 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.stubpce;
+
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev170426.routing.constraints.sp.HardConstraints;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev170426.routing.constraints.sp.SoftConstraints;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ *  Class to check coherency between hard and soft constraints.
+ *  @author <a href="mailto:martial.coulibaly@gfi.com">Martial Coulibaly</a> on
+ *         behalf of Orange
+ *
+ */
+public class CheckCoherencyHardSoft {
+    /** Logging. */
+    private static final Logger LOG = LoggerFactory.getLogger(CheckCoherencyHardSoft.class);
+    /** Hard Constraints. */
+    private HardConstraints hard;
+    /** Soft Constraints. */
+    private SoftConstraints soft;
+
+    public CheckCoherencyHardSoft(HardConstraints hard, SoftConstraints soft) {
+        this.hard = hard;
+        this.soft = soft;
+    }
+
+    /**
+     * function to check coherency between hard and soft constraints.
+     * @return  <code> true </code>  if coherent
+     *          <code> false </code> else
+     */
+    public boolean check() {
+        boolean result = false;
+        if (hard != null && soft != null) {
+            /**
+             * Check coherency with hard/soft constraints
+             * hard/soft include/exclude coherency
+             *
+             */
+        } else {
+            LOG.info("HardConstraints or/and  SoftConstraints is null !");
+            result = true;
+        }
+        return result;
+    }
+
+}