f265eae34fc7a116d8e23e41e8fd972b32afaad6
[music.git] / src / main / java / org / onap / music / eelf / logging / format / AppMessages.java
1 /*
2  * ============LICENSE_START==========================================
3  * org.onap.music
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  * ============LICENSE_END=============================================
20  * ====================================================================
21  */
22
23 package org.onap.music.eelf.logging.format;
24
25 /**
26  * @author inam
27  *
28  */
29 public enum AppMessages {
30         
31         
32         
33         /*
34          * 100-199 Security/Permission Related - Authentication problems
35          * [ERR100E] Missing Information 
36          * [ERR101E] Authentication error occured
37          * 
38          * 200-299 Availability/Timeout Related/IO - connectivity error - connection timeout
39          *  [ERR200E] Connectivity
40          *  [ERR201E] Host not available 
41          *      [ERR202E] Error while connecting to Cassandra cluster
42          *  [ERR203E] IO Error has occured
43          *  [ERR204E] Execution Interrupted
44          *      [ERR205E] Session Expired
45          *  [ERR206E] Cache not authenticated
46          * 
47          * 
48          * 300-399 Data Access/Integrity Related  
49          * 
50          * 400-499 - Cassandra Query Related
51          * [ERR400E] Error while processing prepared query object
52          * [ERR401E] Executing Session Failure for Request
53          * [ERR402E] Ill formed queryObject for the request
54          * [ERR403E] Error processing Prepared Query Object  
55          * 
56          * 500-599 - Zookeepr/Locking Related
57          * [ERR500E] Invalid lock
58          * [ERR501E] Locking Error has occured
59          * [ERR502E] Zookeeper error has occured
60          * [ERR503E] Failed to aquire lock store handle  
61          * [ERR504E] Failed to create Lock Reference
62          * [ERR505E] Lock does not exist
63          * [ERR506E] Failed to aquire lock
64          * [ERR507E] Lock not aquired 
65          * [ERR508E] Lock state not set 
66          * [ERR509E] Lock not destroyed 
67          * [ERR510E] Lock not released 
68          * [ERR511E] Lock not deleted 
69          * [ERR512E] Failed to get ZK Lock Handle
70          * 
71          * 
72          * 600 - 699 - Music Service Errors
73          * [ERR600E] Error initializing the cache 
74          * 
75          * 700-799 Schema Interface Type/Validation - received Pay-load checksum is
76          * invalid - received JSON is not valid
77          * 
78          * 800-899 Business/Flow Processing Related - check out to service is not
79          * allowed - Roll-back is done - failed to generate heat file
80          * 
81          * 
82          * 900-999 Unknown Errors - Unexpected exception
83          * [ERR900E] Unexpected error occured
84          * [ERR901E] Number format exception  
85          * 
86          * 
87          * 1000-1099 Reserved - do not use
88          * 
89          */
90         
91         
92         
93         
94         MISSINGINFO("[ERR100E]", "Missing Information ","Details: NA", "Please check application credentials and headers"),
95         AUTHENTICATIONERROR("[ERR101E]", "Authentication error occured ","Details: NA", "Please verify application credentials"),
96         CONNCECTIVITYERROR("[ERR200E]"," Connectivity error","Details: NA ","Please check connectivity to external resources"),
97         HOSTUNAVAILABLE("[ERR201E]","Host not available","Details: NA","Please verify the host details"),
98         CASSANDRACONNECTIVITY("[ERR202E]","Error while connecting to Cassandra cluster",""," Please check cassandra cluster details"),
99         IOERROR("[ERR203E]","IO Error has occured","","Please check IO"),
100         EXECUTIONINTERRUPTED("[ERR204E]"," Execution Interrupted","",""),
101         SESSIONEXPIRED("[ERR205E]"," Session Expired","","Session has expired."),
102         CACHEAUTHENTICATION("[ERR206E]","Cache not authenticated",""," Cache not authenticated"),
103         
104         QUERYERROR("[ERR400E]","Error while processing prepared query object",""," Please verify the query"),
105         SESSIONFAILED("[ERR401E]","Executing Session Failure for Request","","Please verify the session and request"),
106         
107         INVALIDLOCK("[ERR500E]"," Invalid lock or acquire failed",""," Lock is not valid to aquire"),
108         LOCKINGERROR("[ERR501E]"," Locking Error has occured",""," Locking Error has occured"),
109         KEEPERERROR("[ERR502E]"," Zookeeper error has occured","","Please check zookeeper details"),
110         LOCKHANDLE("[ERR503E]","Failed to aquire lock store handle",""," Failed to aquire lock store handle"),
111         CREATELOCK("[ERR504E]","Failed to aquire lock store handle  ","","Failed to aquire lock store handle  "),
112         LOCKSTATE("[ERR508E]"," Lock state not set",""," Lock state not set"),
113         DESTROYLOCK("[ERR509E]"," Lock not destroyed",""," Lock not destroyed"),
114         RELEASELOCK("[ERR510E]"," Lock not released",""," Lock not released"),
115         DELTELOCK("[ERR511E]",""," Lock not deleted "," Lock not deleted "),
116         CACHEERROR("[ERR600E]"," Error initializing the cache",""," Error initializing the cache"),
117         
118         UNKNOWNERROR("[ERR900E]"," Unexpected error occured",""," Please check logs for details");
119         
120         
121                 
122         ErrorTypes eType;
123         ErrorSeverity alarmSeverity;
124         ErrorSeverity errorSeverity;
125         String errorCode;
126         String errorDescription;
127         String details;
128         String resolution;
129
130
131         AppMessages(String errorCode, String errorDescription, String details,String resolution) {
132         
133                 this.errorCode = errorCode;
134                 this.errorDescription = errorDescription;
135                 this.details = details;
136                 this.resolution = resolution;
137         }
138
139         
140         
141         
142         AppMessages(ErrorTypes eType, ErrorSeverity alarmSeverity,
143                         ErrorSeverity errorSeverity, String errorCode, String errorDescription, String details,
144                         String resolution) {
145         
146                 this.eType = eType;
147                 this.alarmSeverity = alarmSeverity;
148                 this.errorSeverity = errorSeverity;
149                 this.errorCode = errorCode;
150                 this.errorDescription = errorDescription;
151                 this.details = details;
152                 this.resolution = resolution;
153         }
154
155         public String getDetails() {
156                 return this.details;
157         }
158
159         public String getResolution() {
160                 return this.resolution;
161         }
162
163         public String getErrorCode() {
164                 return this.errorCode;
165         }
166
167         public String getErrorDescription() {
168                 return this.errorDescription;
169         }
170
171         
172
173         
174         
175         
176
177 }