2 * Copyright 2016-2017 Huawei Technologies Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package org.openo.nfvo.vnfmadapter.service.constant;
18 import java.util.Arrays;
19 import java.util.Collections;
20 import java.util.List;
23 * Provide constant value
29 * @version NFVO 0.5 Sep 3, 2016
31 public class Constant {
33 public static final String POST = "post";
35 public static final String PUT = "put";
37 public static final String DELETE = "delete";
39 public static final String GET = "get";
41 public static final String ASYNCPOST = "asyncPost";
43 public static final String ASYNCGET = "asyncGet";
45 public static final String ASYNCPUT = "asyncPut";
47 public static final String ASYNCDELETE = "asyncDelete";
49 public static final String ENCODEING = "utf-8";
51 public static final String COOKIE = "Cookie";
53 public static final String ACCESSSESSION = "accessSession";
55 public static final String CONTENT_TYPE = "Content-Type";
57 public static final String APPLICATION = "application/json";
59 public static final String HEADER_SUBJECT_TOKEN = "X-Subject-Token";
61 public static final String HEADER_AUTH_TOKEN = "accessSession";
63 public static final String DOWNLOADCSAR_SUCCESS = "Success";
65 public static final int UNZIP_SUCCESS = 0;
67 public static final int UNZIP_FAIL = -1;
69 public static final String DOWNLOADCSAR_FAIL = "FAIL";
71 public static final int HTTP_OK = 200;
73 public static final int HTTP_CREATED = 201;
75 public static final int HTTP_ACCEPTED = 202;
77 public static final int HTTP_NOCONTENT = 204;
79 public static final int HTTP_BAD_REQUEST = 400;
81 public static final int HTTP_UNAUTHORIZED = 401;
83 public static final int HTTP_NOTFOUND = 404;
85 public static final int HTTP_NOT_ACCEPTABLE = 406;
87 public static final int HTTP_CONFLICT = 409;
89 public static final int HTTP_INVALID_PARAMETERS = 415;
91 public static final int HTTP_INNERERROR = 500;
93 public static final List<String> AUTHLIST = Collections.unmodifiableList(Arrays.asList(Constant.ANONYMOUS, Constant.CERTIFICATE));
95 public static final int INTERNAL_EXCEPTION = 600;
97 public static final int REPEAT_REG_TIME = 60 * 1000;
99 public static final int MIN_PWD_LENGTH = 6;
101 public static final int MAX_PWD_LENGTH = 160;
103 public static final int MIN_URL_LENGTH = 7;
105 public static final int MAX_VNFM_NAME_LENGTH = 64;
107 public static final int MIN_VNFM_NAME_LENGTH = 1;
109 public static final int MAX_URL_LENGTH = 256;
111 public static final int REST_SUCCESS = 1;
113 public static final int DEFAULT_COLLECTION_SIZE = 10;
115 public static final int REST_FAIL = -1;
117 public static final String ROARAND = "?roarand=%s";
119 public static final String ANONYMOUS = "Anonymous";
121 public static final String CERTIFICATE = "Certificate";
123 public static final String RETCODE = "retCode";
125 public static final String STATUS = "status";
127 public static final String VNFPKGINFO="vnfpkginfo.json";
129 public static final int ERROR_STATUS_CODE = -1;
131 public static final String COLON=":";
134 //private constructor