Remove unused files with company keywords
[portal.git] / ecomp-portal-BE-common / src / main / java / org / openecomp / portalapp / portal / logging / format / EPAppMessagesEnum.java
1 /*-
2  * ================================================================================
3  * ECOMP Portal
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property
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  * ================================================================================
19  */
20 package org.openecomp.portalapp.portal.logging.format;
21
22 import org.openecomp.portalsdk.core.logging.format.AlarmSeverityEnum;
23 import org.openecomp.portalsdk.core.logging.format.ErrorSeverityEnum;
24 import org.openecomp.portalsdk.core.logging.format.ErrorTypeEnum;
25
26 /**
27  * 
28  * Add ECOMP Portal Specific Error Code Enums here, for generic
29  * ones (ones you think are useful not only Portal but also SDK), add it
30  * to the enum class AppMessagesEnum defined in SDK.
31  */
32 public enum EPAppMessagesEnum {
33         /*
34         100-199 Security/Permission Related 
35                                                                                 - Authentication problems (from external client, to external server)
36                                                                                 - Certification errors
37                                                                                 - 
38                                                                                         
39         200-299 Availability/Timeout Related
40                                                                                 - connectivity error
41                                                                                 - connection timeout
42                                                                                 
43         300-399 Data Access/Integrity Related
44                                                                                 - Data in graph in invalid(E.g. no creator is found for service) 
45                                                                                 - Artifact is missing in ES, but exists in graph.
46                                                                                  
47         400-499 Schema Interface Type/Validation
48                                                                                 - received Pay-load checksum is invalid
49                                                                                 - received JSON is not valid
50                                                           
51         500-599 Business/Flow Processing Related  
52                                                                                 -  check out to service is not allowed
53                                                                                 -  Roll-back is done
54                                                                                 -  failed to generate heat file
55                                                                                   
56
57         600-899 Reserved - do not use
58
59         900-999 Unknown Errors 
60                                                                                 - Unexpected exception
61                                                                                 */
62         
63         BeUebAuthenticationError(EPErrorCodesEnum.BEUEBAUTHENTICATIONERROR_ONE_ARGUMENT, ErrorTypeEnum.AUTHENTICATION_PROBLEM, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
64                                                                 "ERR100E", "An Authentication failure occurred during access to UEB server", "Details: {0}.", "Please check UEB server list and keys configured under Portal.Properties file."),
65         
66         BeRestApiAuthenticationError(EPErrorCodesEnum.BERESTAPIAUTHENTICATIONERROR, ErrorTypeEnum.AUTHENTICATION_PROBLEM, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
67                                                                 "ERR101E", "Rejected an incoming REST API request due to invalid credentials", "", "Please check application credentials defined in Database or properties files."),
68         
69         InternalAuthenticationInfo(EPErrorCodesEnum.INTERNALAUTHENTICATIONINFO_ONE_ARGUMENT, ErrorTypeEnum.AUTHENTICATION_PROBLEM, AlarmSeverityEnum.INFORMATIONAL, ErrorSeverityEnum.INFO,
70                                                                 "ERR199I", "Internal authentication problem", "Details: {0}.", "Please check the logs for more information."),
71         
72         InternalAuthenticationWarning(EPErrorCodesEnum.INTERNALAUTHENTICATIONWARNING_ONE_ARGUMENT, ErrorTypeEnum.AUTHENTICATION_PROBLEM, AlarmSeverityEnum.MINOR, ErrorSeverityEnum.WARN,
73                                                                 "ERR199W", "Internal authentication problem", "Details: {0}.", "Please check the logs for more information."),
74         
75         InternalAuthenticationError(EPErrorCodesEnum.INTERNALAUTHENTICATIONERROR_ONE_ARGUMENT, ErrorTypeEnum.AUTHENTICATION_PROBLEM, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
76                                                                 "ERR199E", "Internal authentication problem", "Details: {0}.", "Please check the logs for more information."),
77         
78         InternalAuthenticationFatal(EPErrorCodesEnum.INTERNALAUTHENTICATIONFATAL_ONE_ARGUMENT, ErrorTypeEnum.AUTHENTICATION_PROBLEM, AlarmSeverityEnum.CRITICAL, ErrorSeverityEnum.FATAL,
79                                                                 "ERR199F", "Internal authentication problem", "Details: {0}.", "Please check the logs for more information."),
80         
81         BeHealthCheckError(EPErrorCodesEnum.BeHEALTHCHECKERROR, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.CRITICAL, ErrorSeverityEnum.ERROR,
82                                                                 "ERR200E", "ECOMP-PORTAL Back-end probably lost connectivity to either one of the following components: MySQL DB, UEB Cluster", "", "Please check the logs for more information."),
83
84         BeHealthCheckMySqlError(EPErrorCodesEnum.BEHEALTHCHECKMYSQLERROR, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.CRITICAL, ErrorSeverityEnum.ERROR,
85                                                                 "ERR201E", "ECOMP-PORTAL Back-end probably lost connectivity to MySQL DB", "", "Check connectivity to MYSQL is configured correctly under system.properties file."),
86
87         BeHealthCheckUebClusterError(EPErrorCodesEnum.BEHEALTHCHECKUEBCLUSTERERROR, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.CRITICAL, ErrorSeverityEnum.ERROR,
88                                                                 "ERR203E", "ECOMP-PORTAL Back-end probably lost connectivity to UEB Cluster", "", "Check connectivity to UEB cluster which is configured under portal.properties file."),
89         
90         FeHealthCheckError(EPErrorCodesEnum.FEHEALTHCHECKERROR, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.CRITICAL, ErrorSeverityEnum.ERROR,
91                                                                 "ERR204E", "Unable to connect to a valid ECOMP-PORTAL Back-end Server.", "", "Please check connectivity from this FE instance towards BE or BE Load Balancer."),
92         
93         BeHealthCheckRecovery(EPErrorCodesEnum.BEHEALTHCHECKRECOVERY, ErrorTypeEnum.RECOVERY, AlarmSeverityEnum.INFORMATIONAL, ErrorSeverityEnum.INFO,
94                                                                 "ERR205I", "ECOMP-PORTAL Back-end Recovery to either one of the following components: MySQL DB, UEB Cluster", "", "Please check logs for more specific information about the problem."),
95         
96         BeHealthCheckMySqlRecovery(EPErrorCodesEnum.BEHEALTHCHECKMYSQLRECOVERY, ErrorTypeEnum.RECOVERY, AlarmSeverityEnum.INFORMATIONAL, ErrorSeverityEnum.INFO,
97                                                                 "ERR206I", "ECOMP-PORTAL Back-end connection recovery to MySQL DB", "", "Please check logs for more specific information about the problem."),
98         
99         BeHealthCheckUebClusterRecovery(EPErrorCodesEnum.BEHEALTHCHECKUEBCLUSTERRECOVERY, ErrorTypeEnum.RECOVERY, AlarmSeverityEnum.INFORMATIONAL, ErrorSeverityEnum.INFO,
100                                                                 "ERR208I", "ECOMP-PORTAL Back-end connection recovery to UEB Cluster", "", "Please check logs for more specific information about the problem."),
101         
102         FeHealthCheckRecovery(EPErrorCodesEnum.FEHEALTHCHECKRECOVERY, ErrorTypeEnum.RECOVERY, AlarmSeverityEnum.INFORMATIONAL, ErrorSeverityEnum.INFO,
103                                                                 "ERR209I", "Connectivity to ECOMP-PORTAL Front-end Server is recovered", "", "Please check logs for more specific information about the problem."),
104     
105         BeUebConnectionError(EPErrorCodesEnum.BEUEBCONNECTIONERROR_ONE_ARGUMENT, ErrorTypeEnum.CONNECTION_PROBLEM, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
106                                                         "ERR210E", "ECOMP-PORTAL Back-end probably lost connectivity to UEB Cluster", "Details: {0}.", "Please check UEB server list and keys configured under Portal.Properties file."),
107     
108     BeUebUnkownHostError(EPErrorCodesEnum.BEUEBUNKOWNHOSTERROR_ONE_ARGUMENT, ErrorTypeEnum.CONNECTION_PROBLEM, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
109                                                         "ERR211E", "ECOMP-PORTAL Back-end probably lost connectivity to UEB Cluster", "Cannot reach host: {0}.", "Please check UEB server list and keys configured under Portal.Properties file."),
110         
111     BeUebRegisterOnboardingAppError(EPErrorCodesEnum.BEUEBREGISTERONBOARDINGAPPERROR, ErrorTypeEnum.CONNECTION_PROBLEM, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
112                                                         "ERR212E", "Failed to register the On-boarding application with UEB Communication server", "Details: {0}.", "Please check UEB server list and keys configured under Portal.Properties file."),
113     
114     BeHttpConnectionError(EPErrorCodesEnum.BEHTTPCONNECTIONERROR_ONE_ARGUMENT, ErrorTypeEnum.CONNECTION_PROBLEM, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
115                                                                 "ERR213E", "It could be that communication to an external application might resulted an exception or failed to reach the external application", 
116                                                                 "Details: {0}.", "Please check logs for more information."),
117     
118     InternalConnectionInfo(EPErrorCodesEnum.INTERNALCONNECTIONINFO_ONE_ARGUMENT, ErrorTypeEnum.CONNECTION_PROBLEM, AlarmSeverityEnum.INFORMATIONAL, ErrorSeverityEnum.INFO,
119                                                                 "ERR299I", "Internal Connection problem", "Details: {0}.", "Please check logs for more information."),
120     
121         InternalConnectionWarning(EPErrorCodesEnum.INTERNALCONNECTIONWARNING_ONE_ARGUMENT, ErrorTypeEnum.CONNECTION_PROBLEM, AlarmSeverityEnum.MINOR, ErrorSeverityEnum.WARN,
122                                                                 "ERR299W", "Internal Connection problem", "Details: {0}.", "Please check logs for more information."),
123     
124     InternalConnectionError(EPErrorCodesEnum.INTERNALCONNECTIONERROR_ONE_ARGUMENT, ErrorTypeEnum.CONNECTION_PROBLEM, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
125                                                         "ERR299E", "Internal Connection problem", "Details: {0}.", "Please check logs for more information."),
126     
127     InternalConnectionFatal(EPErrorCodesEnum.INTERNALCONNECTIONFATAL_ONE_ARGUMENT, ErrorTypeEnum.CONNECTION_PROBLEM, AlarmSeverityEnum.CRITICAL, ErrorSeverityEnum.FATAL,
128                                                         "ERR299F", "Internal Connection problem", "Details: {0}.", "Please check logs for more information."),
129     
130     BeUebObjectNotFoundError(EPErrorCodesEnum.BEUEBOBJECTNOTFOUNDERROR_ONE_ARGUMENT, ErrorTypeEnum.DATA_ERROR, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
131                                                         "ERR303E", "Error occurred during access to U-EB Server.", "Data not found: {0}.", "An error occurred during access to UEB Server, {1} failed to either register or unregister to/from UEB topic."),
132     
133     BeUserMissingError(EPErrorCodesEnum.BEUSERMISSINGERROR_ONE_ARGUMENT, ErrorTypeEnum.DATA_ERROR, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
134                                                         "ERR310E", "User is not found", "", "User {0} must be added to the corresponding application with proper user roles."),
135     
136     BeUserInactiveWarning(EPErrorCodesEnum.BEUSERINACTIVEWARNING_ONE_ARGUMENT, ErrorTypeEnum.DATA_ERROR, AlarmSeverityEnum.MINOR, ErrorSeverityEnum.WARN,
137                                                         "ERR313W", "User is found but in-active", "", "User {0} must be added to the corresponding application with proper user roles."),
138     
139     BeUserAdminPrivilegesInfo(EPErrorCodesEnum.BEUSERADMINPRIVILEGESINFO_ONE_ARGUMENT, ErrorTypeEnum.DATA_ERROR, AlarmSeverityEnum.MINOR, ErrorSeverityEnum.WARN,
140                                                         "ERR314W", "User is found but don't have administrative privileges", "", "User {0} should be given administrator role for the corresponding application to perform the necessary actions."),
141     
142     BeInvalidJsonInput(EPErrorCodesEnum.BEINVALIDJSONINPUT, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
143                                                         "ERR405E", "Failed to convert JSON input to object", "", "Please check logs for more information."),
144     
145     BeIncorrectHttpStatusError(EPErrorCodesEnum.BEINCORRECTHTTPSTATUSERROR, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
146                                                         "ERR407E", "Communication to an external application is resulted in with Incorrect Http response code", "", "Please check logs for more information."),
147     
148     BeInitializationError(EPErrorCodesEnum.BEINITIALIZATIONERROR, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.CRITICAL, ErrorSeverityEnum.ERROR,
149                                                         "ERR500E", "ECOMP-PORTAL Back-end was not initialized properly", "", "Please check logs for more information."),
150     
151     BeUebSystemError(EPErrorCodesEnum.BEUEBSYSTEMERROR, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
152                                                         "ERR502E", "Error occurred during access to U-EB Server", "Details: {0}.", "An error occurred in {1} distribution mechanism. Please check the logs for more information."),
153     
154     BeDaoSystemError(EPErrorCodesEnum.BEDAOSYSTEMERROR, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.CRITICAL, ErrorSeverityEnum.ERROR,
155                                                         "ERR505E", "Performing DDL or DML operations on database might have failed", "", "Please check MySQL DB health or look at the logs for more details."),
156     
157     BeSystemError(EPErrorCodesEnum.BESYSTEMERROR, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.CRITICAL, ErrorSeverityEnum.ERROR,
158                                                         "ERR506E", "Unexpected error during operation", "", "Please check logs for more information."),
159     
160     BeExecuteRollbackError(EPErrorCodesEnum.BEEXECUTEROLLBACKERROR, ErrorTypeEnum.DATA_ERROR, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
161                                                         "ERR507E", "Roll-back operation towards database has failed", "", "Please check MYSQL DB health or look at the logs for more details."),
162     
163     FeHttpLoggingError(EPErrorCodesEnum.FEHTTPLOGGINGERROR, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.MINOR, ErrorSeverityEnum.ERROR,
164                                                         "ERR517E", "Error when logging FE HTTP request/response", "", "Please check MYSQL DB health or look at the logs for more details."),
165     
166         FePortalServletError(EPErrorCodesEnum.FEPORTALSERVLETERROR, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
167                                                                 "ERR518E", "Error when trying to access FE Portal page.", "", "Please check logs for more information."),
168         
169     BeDaoCloseSessionError(EPErrorCodesEnum.BEDAOCLOSESESSIONERROR, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
170                                                         "ERR519E", "Close local session operation with database failed", "", "Please check MYSQL DB health or look at the logs form more details."),
171     
172     BeRestApiGeneralError(EPErrorCodesEnum.BERESTAPIGENERALERROR, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.CRITICAL, ErrorSeverityEnum.ERROR,
173                                                         "ERR900E", "Unexpected error during ECOMP-PORTAL Back-end REST API execution", "", "Please check error log for more information."),
174     
175     FeHealthCheckGeneralError(EPErrorCodesEnum.FEHEALTHCHECKGENERALERROR, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.CRITICAL, ErrorSeverityEnum.ERROR,
176                                                         "ERR901E", "General error during FE Health Check", "", "Please check error log for more information."),
177     
178     InternalUnexpectedInfo(EPErrorCodesEnum.INTERNALUNEXPECTEDINFO_ONE_ARGUMENT, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.INFORMATIONAL, ErrorSeverityEnum.INFO,
179                                                         "ERR999I", "Unexpected error", "Details: {0}.", "Please check logs for more information."),
180     
181     InternalUnexpectedWarning(EPErrorCodesEnum.INTERNALUNEXPECTEDWARNING_ONE_ARGUMENT, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.MINOR, ErrorSeverityEnum.WARN,
182                                                         "ERR999W", "Unexpected error", "Details: {0}.", "Please check logs for more information."),
183     
184     InternalUnexpectedError(EPErrorCodesEnum.INTERNALUNEXPECTEDERROR_ONE_ARGUMENT, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
185                                                         "ERR999E", "Unexpected error", "Details: {0}.", "Please check logs for more information."),
186     
187     InternalUnexpectedFatal(EPErrorCodesEnum.INTERNALUNEXPECTEDFATAL_ONE_ARGUMENT, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.CRITICAL, ErrorSeverityEnum.FATAL,
188                                                         "ERR999F", "Unexpected error", "Details: {0}.", "Please check logs for more information."),
189     
190     ExternalAuthAccessConnectionError(EPErrorCodesEnum.EXTERNALAUTHACCESS_CONNECTIONERROR, ErrorTypeEnum.CONNECTION_PROBLEM, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
191                         "ERR220E", "AAF Connection problem", "Details: {0}.", "Please check logs for more information."),
192
193     ExternalAuthAccessAuthenticationError(EPErrorCodesEnum.EXTERNALAUTHACCESS_AUTHENTICATIONERROR, ErrorTypeEnum.AUTHENTICATION_PROBLEM, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
194                         "ERR120E", "AAF authentication problem", "Details: {0}.", "Please check logs for more information."),
195     
196     ExternalAuthAccessGeneralError(EPErrorCodesEnum.EXTERNALAUTHACCESS_GENERALERROR, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
197                         "ERR520E", "Unexpected error", "Details: {0}.", "Please check logs for more information."),
198
199         ;
200         
201         ErrorTypeEnum eType;
202         AlarmSeverityEnum alarmSeverity;
203         EPErrorCodesEnum messageCode;
204         ErrorSeverityEnum errorSeverity;
205         String errorCode;
206         String errorDescription;
207         String details;
208         String resolution;
209         
210         EPAppMessagesEnum(EPErrorCodesEnum messageCode, ErrorTypeEnum eType, AlarmSeverityEnum alarmSeverity, ErrorSeverityEnum errorSeverity, String errorCode, String errorDescription, 
211                                                 String details, String resolution) {
212                 this.messageCode = messageCode;
213                 this.eType = eType;
214                 this.alarmSeverity = alarmSeverity;
215                 this.errorSeverity = errorSeverity;
216                 this.errorCode = errorCode;
217                 this.errorDescription = errorDescription;
218                 this.details = details;
219                 this.resolution = resolution;
220         }
221         
222         public String getDetails() {
223                 return this.details;
224         }
225         
226         public String getResolution() {
227                 return this.resolution;
228         }
229         public String getErrorCode() {
230                 return this.errorCode;
231         }
232         
233         public String getErrorDescription() {
234                 return this.errorDescription;
235         }
236         
237         public ErrorSeverityEnum getErrorSeverity() {
238                 return this.errorSeverity;
239         }
240         
241         public void setErrorSeverity(ErrorSeverityEnum errorSeverity) {
242                 this.errorSeverity = errorSeverity;
243         }
244         
245         public EPErrorCodesEnum getMessageCode() {
246                 return messageCode;
247         }
248
249         public void setMessageCode(EPErrorCodesEnum messageCode) {
250                 this.messageCode = messageCode;
251         }
252         
253         public AlarmSeverityEnum getAlarmSeverity() {
254                 return alarmSeverity;
255         }
256
257         public void setAlarmSeverity(AlarmSeverityEnum alarmSeverity) {
258                 this.alarmSeverity = alarmSeverity;
259         }
260         
261         public ErrorTypeEnum getErrorType() {
262                 return eType;
263         }
264
265         public void setErrorType(ErrorTypeEnum eType) {
266                 this.eType = eType;
267         }
268 }