2 * Copyright © 2017 Orange, Inc. and others. All rights reserved.
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
10 package org.opendaylight.transportpce.stubpce;
12 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.stubpce.rev170426.PathComputationRequestInput;
13 import org.slf4j.Logger;
14 import org.slf4j.LoggerFactory;
18 * Class to check RPCs Compliancy.
19 * @author Martial Coulibaly ( martial.coulibaly@gfi.com ) on behalf of Orange
22 public class CompliancyCheck {
24 private static final Logger LOG = LoggerFactory.getLogger(CompliancyCheck.class);
25 /* Response message from procedure. */
26 private String message;
28 private PathComputationRequestInput input;
30 public CompliancyCheck(PathComputationRequestInput prcInput) {
35 * Check if a String is not
36 * null and not equal to ''.
38 * @param value String value
39 * @return true if String ok
42 public Boolean checkString(String value) {
43 Boolean result = false;
44 if ((value != null) && (value.compareTo("") != 0)) {
51 public Boolean check() {
52 Boolean result = true;
54 if (!checkString(input.getServiceName())) {
56 message = "Service Name is not set";
59 if (!checkString(input.getServiceHandlerHeader().getRequestId())) {
61 message = "ServiceHandlerHeader Request-ID is not set";
71 public String getMessage() {
76 public void setMessage(String message) {
77 this.message = message;