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.transportpce.b.c._interface.servicepath.rev170426.PathComputationRequestInput;
13 import org.slf4j.Logger;
14 import org.slf4j.LoggerFactory;
18 * Class to check RPCs Compliancy.
20 * @author Martial Coulibaly ( martial.coulibaly@gfi.com ) on behalf of Orange
23 public class CompliancyCheck {
25 private static final Logger LOG = LoggerFactory.getLogger(CompliancyCheck.class);
26 /** Response message from procedure. */
27 private String message;
29 private PathComputationRequestInput input;
31 public CompliancyCheck(PathComputationRequestInput prcInput) {
36 * Check if a String is not
37 * null and not equal to ''.
39 * @param value String value
40 * @return true if String ok
43 public Boolean checkString(String value) {
44 Boolean result = false;
45 if ((value != null) && (value.compareTo("") != 0)) {
53 * check if service name
54 * or ServiceHandlerHeader
55 * is set in RPC request.
57 * @return true if settings is ok,
60 public Boolean check() {
61 Boolean result = true;
63 if (!checkString(input.getServiceName())) {
65 message = "Service Name is not set";
68 if (!checkString(input.getServiceHandlerHeader().getRequestId())) {
70 message = "ServiceHandlerHeader Request-ID is not set";
80 public String getMessage() {
85 public void setMessage(String message) {
86 this.message = message;