[SDC] rebase 1710 code
[sdc.git] / common-app-api / src / main / java / org / openecomp / sdc / common / config / EcompErrorCode.java
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.common.config;
22
23 public enum EcompErrorCode {
24
25         E_100("Authentication problem towards U-EB server. Reason: %s",
26                         "An Authentication failure occured during access to UEB server. Please check that UEB keys are configured correctly in ASDC BE distribution configuration."), E_199(
27                                         "Internal authentication problem. Description: %s"),
28
29         E_200("ASDC Backend probably lost connectivity to either one of the following components: Titan DB, Cassandra, Onboarding, UEB Cluster. Please check the logs for more information."), E_201(
30                         "ASDC Backend probably lost connectivity to Titan DB. Please check the logs for more information."), E_202(
31                                         "ASDC Backend probably lost connectivity to ElasticSearch. Please check the logs for more information."), E_203(
32                                                         "ASDC Backend probably lost connectivity to UEB Cluster. Please check the logs for more information.",
33                                                         "Check connectivity to UEB cluster which is configured under parameter uebServers in distribution-configuration.yaml."), E_204(
34                                                                         "Unable to connect to a valid ASDC Backend Server",
35                                                                         "Please check connectivity from this FE instance towards BE or BE Load Balancer. Please check that parameters in FE configuration.yaml: beHost,     beHttpPort and beSslPort point to a valid host and port values."),
36
37         E_205("ASDC Backend Recovery to either one of the following components: Titan DB, Cassandra, Onboarding, UEB Cluster."), E_206(
38                         "ASDC Backend connection recovery to Titan DB."), E_207(
39                                         "ASDC Backend connection recovery to ElasticSearch."), E_208(
40                                                         "ASDC Backend connection recovery to UEB Cluster."), E_209(
41                                                                         "Connectivity to ASDC BE Server is recovered."), E_210(
42                                                                                         "Connection problem towards U-EB server. Reason: %s",
43                                                                                         "Please check that that parameter uebServers in distribution-configuration.yaml points to a valid UEB Cluster."), E_211(
44                                                                                                         "Connection problem towards U-EB server. Cannot reach host %s",
45                                                                                                         "Please check that that parameter uebServers in distribution-configuration.yaml points to a valid UEB Cluster."), E_212(
46                                                                                                                         "Couldn't resolve hostIP. Desciption: %s"), E_213(
47                                                                                                                                         "Site switch over was done. Site is now in %s mode"), E_299(
48                                                                                                                                                         "Internal Connection problem. Description: %s"),
49
50         // [resource/service/product]
51         E_300("Mandatory %s Component %s cannot be found in repository"),
52         // [SERVICE/RESOURCE/PRODUCT] [id] is not valid. Cannot be found in graph.
53         E_301("%s Component %s is not valid. Cannot be found in graph."), E_302(
54                         "Configuration parameter %s is invalid. Value configured is %s."), E_303(
55                                         "Error occured during access to U-EB Server. Data not found: %s",
56                                         "An error occured during access to UEB Server, ASDC failed to either register or unregister to/from UEB topic."), E_304(
57                                                         "The artifact type %s does not appear in the list of valid artifacts %s"), E_305(
58                                                                         "Configuration parameter %s is missing"), E_306(
59                                                                                         "Configuration parameter %s is invalid. At least %s values shall be configured"), E_307(
60                                                                                                         "Invalid configuration in YAML file. %s"), E_308(
61                                                                                                                         "Artifact uploaded has missing information. Missing %s"), E_309(
62                                                                                                                                         "Artifact %s requested is not found"), E_310(
63                                                                                                                                                         "User %s requested is not found"), E_311(
64                                                                                                                                                                         "Ecomp error description params mismatch between code and YAML or wrong format, name: %s"), E_312(
65                                                                                                                                                                                         "Ecomp error element  not found in YAML, name: %s"),
66
67         E_399("Internal Invalid Object. Description: %s"),
68
69         E_400("The type %s of %s is invalid"), E_401("The value %s of %s from type %s is invalid"), E_402(
70                         "Payload of artifact uploaded is invalid (invalid MD5 or encryption)"), E_403(
71                                         "Input for artifact metadata is invalid"), E_404("%s %s required is missing"), E_405(
72                                                         "Failed to convert json input to object"), E_406("Distribution %s required is missing"),
73
74         E_499("Invalid input. Description: %s"),
75
76         E_500("Catalog-BE was not initialized properly"), E_501(
77                         "Failed to add resource instance of resource %s to service %s"), E_502(
78                                         "Error occured during access to U-EB Server. Operation: %s",
79                                         "An error occured in ASDC distribution mechanism. Please check the logs for more information."), E_503(
80                                                         "Error occured in Distribution Engine. Failed operation: %s",
81                                                         "System Error occured in ASDC Distribution Engine. Please check ASDC logs for more details."), E_504(
82                                                                         "Failed adding node of type %s to graph."), E_505(
83                                                                                         "Operation towards database failed.",
84                                                                                         "Please check Titan DB health or look at the logs for more details."), E_506(
85                                                                                                         "Unexpected error during operation"), E_507(
86                                                                                                                         "Going to execute rollback on graph."), E_508(
87                                                                                                                                         "Failed to lock object for update. Type = %s, Id = %s"), E_509(
88                                                                                                                                                         "Failed to create node %s on graph. status is %s"), E_510(
89                                                                                                                                                                         "Failed to update node %s on graph. Status is %s"), E_511(
90                                                                                                                                                                                         "Failed to delete node %s on graph. Status is %s"), E_512(
91                                                                                                                                                                                                         "Failed to retrieve node %s from graph. Status is %s"), E_513(
92                                                                                                                                                                                                                         "Failed to find parent node of %s on graph. Status is %s"), E_514(
93                                                                                                                                                                                                                                         "Failed to fetch all nodes with type %s of parent node %s . Status is %s"), E_515(
94                                                                                                                                                                                                                                                         "Cannot find node with type %s associated with node %s . Status is %s"), E_516(
95                                                                                                                                                                                                                                                                         "Error occured in Component Cleaner Task. Failed operation: %s"), E_517(
96                                                                                                                                                                                                                                                                                         "Error when logging FE HTTP request/response"), E_518(
97                                                                                                                                                                                                                                                                                                         "Error when trying to access FE Portal page"),
98
99         E_599("Internal flow error. Operation: %s"),
100
101         E_900("Unexpected error during BE REST API execution"), E_901("General error during FE Health Check"), E_999(
102                         "Unexpected error. Description: %s");
103
104         /*
105          * 100-199 Security/Permission Related - Authentication problems (from
106          * external client, to external server) - Certification errors -
107          * 
108          * 200-299 Availability/Timeout Related - connectivity error - connection
109          * timeout
110          * 
111          * 300-399 Data Access/Integrity Related - Data in graph in invalid(E.g. no
112          * creator is found for service) - Artifact is missing in ES, but exists in
113          * graph.
114          * 
115          * 400-499 Schema Interface Type/Validation - received payload checksum is
116          * inavlid - received json is not valid
117          * 
118          * 500-599 Business/Flow Processing Related - check out to service is not
119          * allowed - rollback is done - failed to generate heat file
120          * 
121          * 
122          * 600-899 Reserved – do not use
123          * 
124          * 900-999 Unknown Errors - unexpected exception
125          */
126
127         String description;
128         String resolution;
129
130         EcompErrorCode(String description, String resolution) {
131                 this.description = description;
132                 this.resolution = resolution;
133         }
134
135         EcompErrorCode(String description) {
136                 this.description = description;
137         }
138
139         public String getDescription() {
140                 return description;
141         }
142
143         public void setDescription(String description) {
144                 this.description = description;
145         }
146
147         public String getResolution() {
148                 return resolution;
149         }
150
151         public void setResolution(String resolution) {
152                 this.resolution = resolution;
153         }
154
155 }