1 /*******************************************************************************
2 * Copyright 2017 ZTE, Inc. and others.
4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 * in compliance with the License. You may obtain a copy of the License at
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software distributed under the License
10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11 * or implied. See the License for the specific language governing permissions and limitations under
13 ******************************************************************************/
14 package org.onap.msb.sdk.discovery.common;
16 public class RouteConst {
17 public static final int SC_OK = 200;
18 public static final int SC_POST_OK = 201;
19 public static final int SC_DEL_OK = 204;
20 public static final int SC_NOTFOND = 404;
21 public static final String MSB_ROUTE_URL = "/api/microservices/v1/services";
22 public static final String REQUEST_SUCCESS = "SUCCESS";
23 public static final String REQUEST_FAIL = "FAIL";
25 public static final String LB_POLICY_LIST = "round-robin,ip_hash,least_conn";
26 public static final String LB_PARAMS_LIST = "weight,max_fails,fail_timeout";
27 public static final String SERVER_TYPE_LIST = "api,iui,custom,p2p";
28 public static final String CHECK_TYPE_LIST = "HTTP,TCP,TTL";
29 public static final String APIGATEWAY_NAME = "apigateway";
30 public static final String VISUAL_RANGE_IN = "1";
34 public enum Protocol {
35 REST, HTTP, MQ, FTP, SNMP, TCP, UDP, UI
38 public static boolean checkExistProtocol(String value) {
39 for (Protocol protocol : Protocol.values()) {
40 if (protocol.name().equals(value)) {
48 public static boolean checkExist(String list, String value) {
49 String[] listArray = list.split(",");
50 for (int i = 0; i < listArray.length; i++) {
51 if (value.equals(listArray[i]))
57 public static String listProtocol() {
59 for (Protocol protocol : Protocol.values()) {
60 list += protocol.name() + " | ";