2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
20 package org.openecomp.mso.adapters.vfc.constant;
23 * Constant Class.<br/>
25 * Define constant for http operation.
29 * @version ONAP Amsterdam 2016/8/4
31 public class HttpCode {
36 public static final int BAD_REQUEST = 400;
41 public static final int INTERNAL_SERVER_ERROR = 500;
46 public static final int NOT_ACCEPTABLE = 406;
51 public static final int NOT_FOUND = 404;
56 public static final int RESPOND_ACCEPTED = 202;
59 * Http response is ok.
61 public static final int RESPOND_OK = 200;
63 public static final int CREATED_OK = 201;
68 public static final int RESPOND_CONFLICT = 409;
75 * @since ONAP Amsterdam Release 2017-9-6
82 * Whether request is successful.<br/>
84 * @param httpCode response code
85 * @return true or false
86 * @since ONAP Amsterdam Release 2017-9-6
88 public static boolean isSucess(int httpCode) {
89 return httpCode / 100 == 2;