Define a constant instead of duplicating literal
[vfc/nfvo/driver/vnfm/svnfm.git] / huawei / vnfmadapter / VnfmadapterService / service / src / main / java / org / onap / vfc / nfvo / vnfm / svnfm / vnfmadapter / service / constant / Constant.java
1 /*
2  * Copyright 2016-2017 Huawei Technologies Co., Ltd.
3  *
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
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 package org.onap.vfc.nfvo.vnfm.svnfm.vnfmadapter.service.constant;
18
19 import java.util.Arrays;
20 import java.util.Collections;
21 import java.util.List;
22
23 /**
24  * Provide constant value
25  * <br/>
26  * <p>
27  * </p>
28  *
29  * @author
30  * @version VFC 1.0 Sep 3, 2016
31  */
32 public class Constant {
33
34     public static final String POST = "post";
35
36     public static final String PUT = "put";
37
38     public static final String DELETE = "delete";
39
40     public static final String GET = "get";
41
42     public static final String ASYNCPOST = "asyncPost";
43
44     public static final String ASYNCGET = "asyncGet";
45
46     public static final String ASYNCPUT = "asyncPut";
47
48     public static final String ASYNCDELETE = "asyncDelete";
49
50     public static final String ENCODEING = "utf-8";
51
52     public static final String COOKIE = "Cookie";
53
54     public static final String ACCESSSESSION = "accessSession";
55
56     public static final String CONTENT_TYPE = "Content-Type";
57
58     public static final String APPLICATION = "application/json";
59
60     public static final String HEADER_SUBJECT_TOKEN = "X-Subject-Token";
61
62     public static final String HEADER_AUTH_TOKEN = "accessSession";
63
64     public static final String DOWNLOADCSAR_SUCCESS = "Success";
65
66     public static final int UNZIP_SUCCESS = 0;
67
68     public static final int UNZIP_FAIL = -1;
69
70     public static final String DOWNLOADCSAR_FAIL = "FAIL";
71
72     public static final int HTTP_OK = 200;
73
74     public static final int HTTP_CREATED = 201;
75
76     public static final int HTTP_ACCEPTED = 202;
77
78     public static final int HTTP_NOCONTENT = 204;
79
80     public static final int HTTP_BAD_REQUEST = 400;
81
82     public static final int HTTP_UNAUTHORIZED = 401;
83
84     public static final int HTTP_NOTFOUND = 404;
85
86     public static final int HTTP_NOT_ACCEPTABLE = 406;
87
88     public static final int HTTP_CONFLICT = 409;
89
90     public static final int HTTP_INVALID_PARAMETERS = 415;
91
92     public static final int HTTP_INNERERROR = 500;
93
94     public static final List<String> AUTHLIST =
95             Collections.unmodifiableList(Arrays.asList(Constant.ANONYMOUS, Constant.CERTIFICATE));
96
97     public static final int INTERNAL_EXCEPTION = 600;
98
99     public static final int REPEAT_REG_TIME = 60 * 1000;
100
101     public static final int MIN_PWD_LENGTH = 6;
102
103     public static final int MAX_PWD_LENGTH = 160;
104
105     public static final int MIN_URL_LENGTH = 7;
106
107     public static final int MAX_VNFM_NAME_LENGTH = 64;
108
109     public static final int MIN_VNFM_NAME_LENGTH = 1;
110
111     public static final int MAX_URL_LENGTH = 256;
112
113     public static final int REST_SUCCESS = 1;
114
115     public static final int DEFAULT_COLLECTION_SIZE = 10;
116
117     public static final int REST_FAIL = -1;
118
119     public static final String ROARAND = "?roarand=%s";
120
121     public static final String ANONYMOUS = "Anonymous";
122
123     public static final String CERTIFICATE = "Certificate";
124
125     public static final String RETCODE = "retCode";
126
127     public static final String REASON = "reason";
128
129     public static final String STATUS = "status";
130
131     public static final String VNFPKGINFO = "vnfpkginfo.json";
132
133     public static final int ERROR_STATUS_CODE = -1;
134
135     public static final String COLON = ":";
136
137     public static final String ERRORMSG = "errorMsg";
138
139     public static final String VIMID = "vimId";
140
141     public static final String VNFMID = "vnfmId";
142
143     public static final String ACTION = "action";
144
145     public static final String VNFDID = "vnfdId";
146
147     public static final String JOBID = "jobId";
148
149     private Constant() {
150         // private constructor
151     }
152 }