5bc4333fe1d49cf26659b2a2134760aac9e69d2e
[transportpce.git] / servicehandler / src / main / java / org / opendaylight / transportpce / servicehandler / CheckCoherencyHardSoft.java
1 /*
2  * Copyright © 2017 Orange, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.transportpce.servicehandler;
10
11 import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev161014.routing.constraints.HardConstraints;
12 import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev161014.routing.constraints.SoftConstraints;
13 import org.slf4j.Logger;
14 import org.slf4j.LoggerFactory;
15
16 /**
17  * Class to check coherency between hard and soft constraints.
18  * @author Martial Coulibaly ( martial.coulibaly@gfi.com ) on behalf of Orange
19  *
20  */
21 public class CheckCoherencyHardSoft {
22     /* Logging. */
23     private static final Logger LOG = LoggerFactory.getLogger(CheckCoherencyHardSoft.class);
24     /* Hard Constraints. */
25     private HardConstraints hard;
26     /* Soft Constraints. */
27     private SoftConstraints soft;
28
29     public CheckCoherencyHardSoft(HardConstraints hard, SoftConstraints soft) {
30         this.hard = hard;
31         this.soft = soft;
32     }
33
34     /**
35      * function to check coherency between hard and soft constraints.
36      * @return  <code> true </code>  if coherent
37      *          <code> false </code> else
38      */
39     public boolean check() {
40         boolean result = false;
41         if (hard != null && soft != null) {
42             /*
43              * Check coherency with hard/soft constraints
44              * hard/soft include/exclude coherency
45              *
46              */
47         } else {
48             LOG.info("HardConstraints or/and  SoftConstraints is null !");
49             result = true;
50         }
51         return result;
52     }
53
54 }