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.
17 package org.onap.vfc.nfvo.vnfm.svnfm.vnfmadapter.service.constant;
19 import java.util.Arrays;
20 import java.util.Collections;
21 import java.util.List;
24 * Provide constant value
30 * @version VFC 1.0 Sep 3, 2016
32 public class Constant {
34 public static final String POST = "post";
36 public static final String PUT = "put";
38 public static final String DELETE = "delete";
40 public static final String GET = "get";
42 public static final String ASYNCPOST = "asyncPost";
44 public static final String ASYNCGET = "asyncGet";
46 public static final String ASYNCPUT = "asyncPut";
48 public static final String ASYNCDELETE = "asyncDelete";
50 public static final String HTTPS = "https";
52 public static final String ENCODEING = "utf-8";
54 public static final String COOKIE = "Cookie";
56 public static final String ACCESSSESSION = "accessSession";
58 public static final String CONTENT_TYPE = "Content-Type";
60 public static final String APPLICATION = "application/json";
62 public static final String HEADER_SUBJECT_TOKEN = "X-Subject-Token";
64 public static final String HEADER_AUTH_TOKEN = "accessSession";
66 public static final String DOWNLOADCSAR_SUCCESS = "Success";
68 public static final int UNZIP_SUCCESS = 0;
70 public static final int UNZIP_FAIL = -1;
72 public static final String DOWNLOADCSAR_FAIL = "FAIL";
74 public static final int HTTP_OK = 200;
76 public static final int HTTP_CREATED = 201;
78 public static final int HTTP_ACCEPTED = 202;
80 public static final int HTTP_NOCONTENT = 204;
82 public static final int HTTP_BAD_REQUEST = 400;
84 public static final int HTTP_UNAUTHORIZED = 401;
86 public static final int HTTP_NOTFOUND = 404;
88 public static final int HTTP_NOT_ACCEPTABLE = 406;
90 public static final int HTTP_CONFLICT = 409;
92 public static final int HTTP_INVALID_PARAMETERS = 415;
94 public static final int HTTP_INNERERROR = 500;
96 public static final List<String> AUTHLIST =
97 Collections.unmodifiableList(Arrays.asList(Constant.ANONYMOUS, Constant.CERTIFICATE));
99 public static final int INTERNAL_EXCEPTION = 600;
101 public static final int REPEAT_REG_TIME = 60 * 1000;
103 public static final int MIN_PWD_LENGTH = 6;
105 public static final int MAX_PWD_LENGTH = 160;
107 public static final int MIN_URL_LENGTH = 7;
109 public static final int MAX_VNFM_NAME_LENGTH = 64;
111 public static final int MIN_VNFM_NAME_LENGTH = 1;
113 public static final int MAX_URL_LENGTH = 256;
115 public static final int REST_SUCCESS = 1;
117 public static final int DEFAULT_COLLECTION_SIZE = 10;
119 public static final int REST_FAIL = -1;
121 public static final String ROARAND = "?roarand=%s";
123 public static final String ANONYMOUS = "Anonymous";
125 public static final String CERTIFICATE = "Certificate";
127 public static final String RETCODE = "retCode";
129 public static final String REASON = "reason";
131 public static final String STATUS = "status";
133 public static final String VNFPKGINFO = "vnfpkginfo.json";
135 public static final int ERROR_STATUS_CODE = -1;
137 public static final String COLON = ":";
139 public static final String ERRORMSG = "errorMsg";
141 public static final String VIMID = "vimId";
143 public static final String VNFMID = "vnfmId";
145 public static final String ACTION = "action";
147 public static final String VNFDID = "vnfdId";
149 public static final String JOBID = "jobId";
151 public static final String FILE_SEPARATOR = "file.separator";
153 public static final String PASSWORD = "password";
155 public static final String USERNAME = "userName";
158 // private constructor