TAPI topology creation for 100GE Transponder
[transportpce.git] / tapi / src / main / java / org / opendaylight / transportpce / tapi / validation / checks / EndPointCheck.java
1 /*
2  * Copyright © 2018 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 package org.opendaylight.transportpce.tapi.validation.checks;
9
10 import java.util.List;
11
12 import org.opendaylight.transportpce.servicehandler.validation.checks.ComplianceCheckResult;
13 import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.connectivity.rev181210.create.connectivity.service.input.EndPoint;
14 import org.slf4j.Logger;
15 import org.slf4j.LoggerFactory;
16
17 public final class EndPointCheck {
18
19     private static final Logger LOG = LoggerFactory.getLogger(EndPointCheck.class);
20
21     private EndPointCheck() {
22     }
23
24     public static boolean checkString(String value) {
25         return ((value != null) && (value.compareTo("") != 0));
26     }
27
28     public static ComplianceCheckResult check(List<EndPoint> epl) {
29         boolean result = true;
30         String message = "";
31
32         if (epl.isEmpty()) {
33             result = false;
34             message = "Service End-Point must be set";
35         } else {
36             for (EndPoint ep : epl) {
37                 //to do
38                 LOG.info("ep = {}", ep.toString());
39             }
40         }
41
42         return new ComplianceCheckResult(result, message);
43     }
44 }