Initial commit for ServiceHandler
[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 /* Class to check coherency between hard & sof constraints.
17  * @author Martial Coulibaly ( martial.coulibaly@gfi.com ) on behalf of Orange
18  *
19  */
20 public class CheckCoherencyHardSoft {
21     /* Logging. */
22     private static final Logger LOG = LoggerFactory.getLogger(CheckCoherencyHardSoft.class);
23     /* Hard Constraints. */
24     private HardConstraints hard;
25     /* Soft Constraints. */
26     private SoftConstraints soft;
27
28     public CheckCoherencyHardSoft(HardConstraints hard, SoftConstraints soft) {
29         this.hard = hard;
30         this.soft = soft;
31     }
32
33     /*function to check coherency between hard & soft constraints.
34      * @return  <code> true </code>  if coherent
35      *          <code> false </code> else
36      */
37     public boolean check() {
38         boolean result = false;
39         if (hard != null && soft != null) {
40             /*
41              * Check coherency with hard/soft constraints
42              * hard/soft include/exclude coherency
43              *
44              */
45         } else {
46             LOG.info("HardConstraints or/and  SoftConstraints is null !");
47             result = true;
48         }
49         return result;
50     }
51
52 }