2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. 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=========================================================
21 package org.openecomp.sdc.action.types;
23 import java.util.HashMap;
26 public enum ActionLogResponseCode {
28 MISSING_AUTHORIZATION(100),
30 UPDATE_ON_LOCKED_ENTITY(102),
31 CHECKIN_ON_LOCKED_ENTITY_OTHER_USER(103),
32 CHECKOUT_ON_LOCKED_ENTITY(104),
33 UNDO_CHECKOUT_ON_LOCKED_ENTITY(105),
34 DELETE_ARTIFACT_ON_LOCKED_ENTITY(106),
35 DELETE_ON_LOCKED_ENTITY_OTHER_USER(107),
36 INTERNAL_SERVER_ERROR(201),
37 MISSING_MANDATORY_PARAMS(300),
38 MISSING_INSTANCE_ID_HEADER(301),
39 MISSING_REQUEST_ID_HEADER(302),
40 MISSING_REQUEST_BODY(303),
41 INVALID_SEARCH_FILTER_CRITERIA(304),
42 INVALID_REQUESTED_VERSION(305),
44 ARTIFACT_TOO_BIG(307),
45 ACTION_NOT_FOUND(308),
46 ARTIFACT_NOT_FOUND(309),
47 METHOD_NOT_ALLOWED(310),
48 INVALID_REQUEST_PARAM(311),
49 ARTIFACT_PROTECTION_INVALID(312),
50 ACTION_NAME_UPDATE_NOT_ALLOWED(501),
51 //METHOD_NOT_ALLOWED(502),
52 ACTION_NAME_ALREADY_EXISTS(503),
53 MULTIPLE_FILTER_CRITERIA_NOT_SUPPORTED(504),
54 UPDATE_ON_UNLOCKED_ENTITY(505),
55 UPDATE_NOT_ALLOWED(506),
56 //METHOD_NOT_ALLOWED(507),
57 CHECKIN_ON_UNLOCKED_ENTITY(508),
58 SUBMIT_ON_FINAL_ENTITY(509),
59 SUBMIT_ON_LOCKED_ENTITY_OTHER_USER(510),
60 UNDO_CHECKOUT_ON_UNLOCKED_ENTITY(511),
61 ACTION_NOT_LOCKED(512),
62 ARTIFACT_ALREADY_EXISTS(513),
63 ARTIFACT_UPDATE_READ_ONLY(514),
64 ARTIFACT_DELETE_READ_ONLY(515),
65 ARTIFACT_NAME_INVALID(516),
66 ARTIFACT_CREATE_UPDATE_NOT_ALLOWED(518),
69 private static Map<Integer, ActionLogResponseCode> mapValueToEnum = new HashMap<>();
72 for (ActionLogResponseCode responseCode : ActionLogResponseCode.values()) {
73 mapValueToEnum.put(responseCode.value, responseCode);
79 ActionLogResponseCode(int value) {
83 public static ActionLogResponseCode parseValue(int value) {
84 return mapValueToEnum.get(value);
87 public int getValue() {