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 ENCODEING = "utf-8";
 
  52     public static final String COOKIE = "Cookie";
 
  54     public static final String ACCESSSESSION = "accessSession";
 
  56     public static final String CONTENT_TYPE = "Content-Type";
 
  58     public static final String APPLICATION = "application/json";
 
  60     public static final String HEADER_SUBJECT_TOKEN = "X-Subject-Token";
 
  62     public static final String HEADER_AUTH_TOKEN = "accessSession";
 
  64     public static final String DOWNLOADCSAR_SUCCESS = "Success";
 
  66     public static final int UNZIP_SUCCESS = 0;
 
  68     public static final int UNZIP_FAIL = -1;
 
  70     public static final String DOWNLOADCSAR_FAIL = "FAIL";
 
  72     public static final int HTTP_OK = 200;
 
  74     public static final int HTTP_CREATED = 201;
 
  76     public static final int HTTP_ACCEPTED = 202;
 
  78     public static final int HTTP_NOCONTENT = 204;
 
  80     public static final int HTTP_BAD_REQUEST = 400;
 
  82     public static final int HTTP_UNAUTHORIZED = 401;
 
  84     public static final int HTTP_NOTFOUND = 404;
 
  86     public static final int HTTP_NOT_ACCEPTABLE = 406;
 
  88     public static final int HTTP_CONFLICT = 409;
 
  90     public static final int HTTP_INVALID_PARAMETERS = 415;
 
  92     public static final int HTTP_INNERERROR = 500;
 
  94     public static final List<String> AUTHLIST =
 
  95             Collections.unmodifiableList(Arrays.asList(Constant.ANONYMOUS, Constant.CERTIFICATE));
 
  97     public static final int INTERNAL_EXCEPTION = 600;
 
  99     public static final int REPEAT_REG_TIME = 60 * 1000;
 
 101     public static final int MIN_PWD_LENGTH = 6;
 
 103     public static final int MAX_PWD_LENGTH = 160;
 
 105     public static final int MIN_URL_LENGTH = 7;
 
 107     public static final int MAX_VNFM_NAME_LENGTH = 64;
 
 109     public static final int MIN_VNFM_NAME_LENGTH = 1;
 
 111     public static final int MAX_URL_LENGTH = 256;
 
 113     public static final int REST_SUCCESS = 1;
 
 115     public static final int DEFAULT_COLLECTION_SIZE = 10;
 
 117     public static final int REST_FAIL = -1;
 
 119     public static final String ROARAND = "?roarand=%s";
 
 121     public static final String ANONYMOUS = "Anonymous";
 
 123     public static final String CERTIFICATE = "Certificate";
 
 125     public static final String RETCODE = "retCode";
 
 127     public static final String REASON = "reason";
 
 129     public static final String STATUS = "status";
 
 131     public static final String VNFPKGINFO = "vnfpkginfo.json";
 
 133     public static final int ERROR_STATUS_CODE = -1;
 
 135     public static final String COLON = ":";
 
 137     public static final String ERRORMSG = "errorMsg";
 
 139     public static final String VIMID = "vimId";
 
 141     public static final String VNFMID = "vnfmId";
 
 143     public static final String ACTION = "action";
 
 145     public static final String VNFDID = "vnfdId";
 
 147     public static final String JOBID = "jobId";
 
 149     public static final String FILE_SEPARATOR = "file.separator";
 
 152         // private constructor