9eff8a705086370e645302b141be8c3ae8010269
[sdc.git] /
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
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
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
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=========================================================
19  */
20
21 package org.openecomp.sdc.action.errors;
22
23 /**
24  * Action Library Error Constants for Error codes and user-friendly detailed error messages.
25  */
26 public class ActionErrorConstants {
27
28   //Error Codes
29   public static final String ACTION_REQUEST_INVALID_GENERIC_CODE = "ACT0001";
30   public static final String ACTION_AUTHENTICATION_ERR_CODE = "ACT1000";
31   public static final String ACTION_AUTHORIZATION_ERR_CODE = "ACT1001";
32   public static final String ACTION_INVALID_INSTANCE_ID_CODE = "ACT1002";
33   public static final String ACTION_INVALID_REQUEST_ID_CODE = "ACT1003";
34   public static final String ACTION_INVALID_PARAM_CODE = "ACT1004";
35   //Operation <status> is not supported
36   public static final String ACTION_INVALID_REQUEST_BODY_CODE = "ACT1005";
37   //ACTION_REQUEST_BODY_EMPTY
38   public static final String ACTION_UPDATE_NOT_ALLOWED_CODE_NAME = "ACT1007";
39   public static final String ACTION_CHECKOUT_ON_LOCKED_ENTITY = "ACT1008";
40   public static final String ACTION_ENTITY_UNIQUE_VALUE_ERROR = "ACT1009";
41
42   public static final String ACTION_INVALID_SEARCH_CRITERIA = "ACT1011";
43   public static final String ACTION_MULT_SEARCH_CRITERIA = "ACT1012";
44   public static final String ACTION_UPDATE_ON_UNLOCKED_ENTITY = "ACT1013";
45   public static final String ACTION_UPDATE_INVALID_VERSION = "ACT1014";
46   public static final String ACTION_UPDATE_NOT_ALLOWED_CODE = "ACT1015";
47
48   public static final String ACTION_CHECKIN_ON_UNLOCKED_ENTITY = "ACT1017";
49   public static final String ACTION_SUBMIT_FINALIZED_ENTITY_NOT_ALLOWED = "ACT1018";
50   public static final String ACTION_SUBMIT_LOCKED_ENTITY_NOT_ALLOWED = "ACT1019";
51   public static final String ACTION_UNDO_CHECKOUT_ON_UNLOCKED_ENTITY = "ACT1020";
52   public static final String ACTION_NOT_LOCKED_CODE = "ACT1021";
53   public static final String ACTION_ARTIFACT_CHECKSUM_ERROR_CODE = "ACT1022";
54   public static final String ACTION_ARTIFACT_TOO_BIG_ERROR_CODE = "ACT1023";
55   public static final String ACTION_ARTIFACT_ALREADY_EXISTS_CODE = "ACT1025";
56   public static final String ACTION_ARTIFACT_UPDATE_READ_ONLY = "ACT1026";
57   public static final String ACTION_ARTIFACT_DELETE_READ_ONLY = "ACT1027";
58   public static final String ACTION_ARTIFACT_INVALID_PROTECTION_CODE = "ACT1028";
59   public static final String ACTION_ARTIFACT_INVALID_NAME_CODE = "ACT1029";
60
61   public static final String ACTION_EDIT_ON_ENTITY_LOCKED_BY_OTHER_USER = "ACT1041";
62   public static final String ACTION_CHECKIN_ON_ENTITY_LOCKED_BY_OTHER_USER = "ACT1042";
63   public static final String ACTION_CHECKOUT_ON_LOCKED_ENTITY_OTHER_USER = "ACT1043";
64   public static final String ACTION_UNDO_CHECKOUT_ON_ENTITY_LOCKED_BY_OTHER_USER = "ACT1044";
65   public static final String ACTION_ENTITY_NOT_EXIST_CODE = "ACT1045";
66   public static final String ACTION_ARTIFACT_ENTITY_NOT_EXIST_CODE = "ACT1046";
67   public static final String ACTION_ARTIFACT_DEL_LOCKED_OTHER_USER_CODE = "ACT1047";
68   public static final String ACTION_DELETE_ON_LOCKED_ENTITY_CODE = "ACT1048";
69
70   public static final String ACTION_INTERNAL_SERVER_ERR_CODE = "ACT1060";
71   //Logging Query failure Response code
72   public static final String ACTION_QUERY_FAILURE_CODE = "QUERY_FAILURE";
73   public static final String ACTION_QUERY_FAILURE_MSG = "Query Failure";
74
75
76   //Error Messages
77   public static final String ACTION_REQUEST_BODY_EMPTY = "Request Body is missing";
78   //"The API failed due to missing body";
79   public static final String ACTION_REQUEST_MISSING_MANDATORY_PARAM =
80       "Missing mandatory parameter(s) : ";
81   public static final String ACTION_REQUEST_OPEN_ECOMP_INSTANCE_ID_INVALID =
82       "X-OPEN-ECOMP-InstanceID HTTP header missing or empty";
83   public static final String ACTION_REQUEST_OPEN_ECOMP_REQUEST_ID_INVALID =
84       "X-OPEN-ECOMP-RequestID HTTP header missing or empty";
85   public static final String ACTION_REQUEST_CONTENT_TYPE_INVALID =
86       "Content-Type HTTP header missing or empty";
87   public static final String ACTION_REQUEST_AUTHORIZATION_HEADER_INVALID =
88       "Authentication is required to use the API";
89   public static final String ACTION_REQUEST_INVALID_NAME =
90       "Invalid syntax for action name. No whitespaces allowed.";
91   public static final String ACTION_REQUEST_FILTER_PARAM_INVALID =
92       "Invalid Search filter criteria provided";
93   public static final String ACTION_FILTER_MULTIPLE_QUERY_PARAM_NOT_SUPPORTED =
94       "Multiple filter criteria are not supported";
95   //"Operation supports filter by one property at a time";
96   public static final String ACTION_ARTIFACT_ENTITY_NOT_EXIST = "Specified artifact is not found";
97   public static final String ACTION_REQUEST_ARTIFACT_CHECKSUM_ERROR = "Checksum error";
98   public static final String ACTION_REQUEST_ARTIFACT_INVALID_PROTECTION_VALUE =
99       "Invalid artifact protection value";
100
101   public static final String ACTION_ARTIFACT_INVALID_NAME =
102       "Artifact name cannot contain any of the following characters : #<>$+%!`&*'|{}?=/:@ including"
103           + " whitespaces, double quotes and back-slash";
104   public static final String ACTION_ARTIFACT_READ_FILE_ERROR = "Error Occurred while reading file";
105   public static final String ACTION_REQUEST_ARTIFACT_OPERATION_ALLOWED =
106       "Artifacts cannot be created/updated using this operation";
107   public static final String ACTION_ARTIFACT_TOO_BIG_ERROR =
108       "Operation is not allowed. Artifact size exceeds the maximum file size limit (20MB).";
109
110   //Business Validation Error messages
111   public static final String ACTION_UPDATE_NOT_ALLOWED_FOR_NAME =
112       "Action Name update is not allowed";
113   public static final String ACTION_UPDATE_PARAM_INVALID =
114       "Update not allowed for the parameter(s) : %s";
115   public static final String ACTION_ENTITY_NOT_EXIST = "Specified Action is not found";
116   public static final String ACTION_REQUESTED_VERSION_INVALID = "Invalid requested version : %s";
117   public static final String ACTION_UNSUPPORTED_OPERATION = "Operation %s not supported";
118   public static final String ACTION_ENTITY_UNIQUE_VALUE_MSG =
119       "%s with the value '%s' already exists.";
120   public static final String ACTION_ARTIFACT_ALREADY_EXISTS =
121       "Artifact name already exists for Action with id %s. Please use another name.";
122   public static final String ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG =
123       "The request failed due to an internal ASDC problem. Open ECOMP Component should continue the "
124           + "attempts, with corrected data if required, to create the resource.";
125   public static final String ACTION_ARTIFACT_DELETE_READ_ONLY_MSG =
126       "Cannot delete read only artifact.";
127   public static final String ACTION_ARTIFACT_UPDATE_READ_ONLY_MSG =
128       "Cannot update read only artifact.";
129   public static final String ACTION_NOT_LOCKED_MSG =
130       "Operation is not allowed. Action status should be Locked.";
131   public static final String ACTION_ARTIFACT_UPDATE_NAME_INVALID =
132       "Artifact name cannot be updated.";
133   public static final String ACTION_ARTIFACT_DEL_LOCKED_OTHER_USER =
134       "Cannot delete artifact since it is locked by other user %s.";
135   public static final String UNDO_CHECKOUT_ON_UNLOCKED_ENTITY_MSG =
136       "Can not undo checkout on versionable entity %s with id %s since it is not checked out.";
137   public static final String UNDO_CHECKOUT_ON_ENTITY_LOCKED_BY_OTHER_USER_MSG =
138       "Can not undo checkout on versionable entity %s with id %s since it is checked out by other "
139           + "user: %s.";
140 }