Push variuos changes
[music.git] / jar / 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      * [ERR300E] Incorrect data  
50      * 
51      * 400-499 - Cassandra Query Related
52      * [ERR400E] Error while processing prepared query object
53      * [ERR401E] Executing Session Failure for Request
54      * [ERR402E] Ill formed queryObject for the request
55      * [ERR403E] Error processing Prepared Query Object  
56      * 
57      * 500-599 - Zookeepr/Locking Related
58      * [ERR500E] Invalid lock
59      * [ERR501E] Locking Error has occured
60      * [ERR502E] Zookeeper error has occured
61      * [ERR503E] Failed to aquire lock store handle  
62      * [ERR504E] Failed to create Lock Reference
63      * [ERR505E] Lock does not exist
64      * [ERR506E] Failed to aquire lock
65      * [ERR507E] Lock not aquired 
66      * [ERR508E] Lock state not set 
67      * [ERR509E] Lock not destroyed 
68      * [ERR510E] Lock not released 
69      * [ERR511E] Lock not deleted 
70      * [ERR512E] Failed to get ZK Lock Handle
71      * 
72      * 
73      * 600 - 699 - Music Service Errors
74      * [ERR600E] Error initializing the cache 
75      * 
76      * 700-799 Schema Interface Type/Validation - received Pay-load checksum is
77      * invalid - received JSON is not valid
78      * 
79      * 800-899 Business/Flow Processing Related - check out to service is not
80      * allowed - Roll-back is done - failed to generate heat file
81      * 
82      * 
83      * 900-999 Unknown Errors - Unexpected exception
84      * [ERR900E] Unexpected error occured
85      * [ERR901E] Number format exception  
86      * 
87      * 
88      * 1000-1099 Reserved - do not use
89      * 
90      */
91     
92     
93     
94     
95     MISSINGINFO("[ERR100E]", "Missing Information ","Details: NA", "Please check application credentials and/or headers"),
96     AUTHENTICATIONERROR("[ERR101E]", "Authentication error occured ","Details: NA", "Please verify application credentials"),
97     CONNCECTIVITYERROR("[ERR200E]"," Connectivity error","Details: NA ","Please check connectivity to external resources"),
98     HOSTUNAVAILABLE("[ERR201E]","Host not available","Details: NA","Please verify the host details"),
99     CASSANDRACONNECTIVITY("[ERR202E]","Error while connecting to Cassandra cluster",""," Please check cassandra cluster details"),
100     IOERROR("[ERR203E]","IO Error has occured","","Please check IO"),
101     EXECUTIONINTERRUPTED("[ERR204E]"," Execution Interrupted","",""),
102     SESSIONEXPIRED("[ERR205E]"," Session Expired","","Session has expired."),
103     CACHEAUTHENTICATION("[ERR206E]","Cache not authenticated",""," Cache not authenticated"),
104     
105     INCORRECTDATA("[ERR300E]"," Incorrect data",""," Please verify the request payload and try again"),
106     MULTIPLERECORDS("[ERR301E]"," Multiple records found",""," Please verify the request payload and try again"),
107     ALREADYEXIST("[ERR302E]"," Record already exist",""," Please verify the request payload and try again"),
108     MISSINGDATA("[ERR300E]"," Incorrect data",""," Please verify the request payload and try again"),
109     
110     QUERYERROR("[ERR400E]","Error while processing prepared query object",""," Please verify the query"),
111     SESSIONFAILED("[ERR401E]","Executing Session Failure for Request","","Please verify the session and request"),
112     
113     INVALIDLOCK("[ERR500E]"," Invalid lock or acquire failed",""," Lock is not valid to aquire"),
114     LOCKINGERROR("[ERR501E]"," Locking Error has occured",""," Locking Error has occured"),
115     KEEPERERROR("[ERR502E]"," Zookeeper error has occured","","Please check zookeeper details"),
116     LOCKHANDLE("[ERR503E]","Failed to aquire lock store handle",""," Failed to aquire lock store handle"),
117     CREATELOCK("[ERR504E]","Failed to aquire lock store handle  ","","Failed to aquire lock store handle  "),
118     LOCKSTATE("[ERR508E]"," Lock state not set",""," Lock state not set"),
119     DESTROYLOCK("[ERR509E]"," Lock not destroyed",""," Lock not destroyed"),
120     RELEASELOCK("[ERR510E]"," Lock not released",""," Lock not released"),
121     DELTELOCK("[ERR511E]",""," Lock not deleted "," Lock not deleted "),
122     CACHEERROR("[ERR600E]"," Error initializing the cache",""," Error initializing the cache"),
123     
124     UNKNOWNERROR("[ERR900E]"," Unexpected error occured",""," Please check logs for details");
125     
126     
127         
128     ErrorTypes eType;
129     ErrorSeverity alarmSeverity;
130     ErrorSeverity errorSeverity;
131     String errorCode;
132     String errorDescription;
133     String details;
134     String resolution;
135
136
137     AppMessages(String errorCode, String errorDescription, String details,String resolution) {
138     
139         this.errorCode = errorCode;
140         this.errorDescription = errorDescription;
141         this.details = details;
142         this.resolution = resolution;
143     }
144
145     
146     
147     
148     AppMessages(ErrorTypes eType, ErrorSeverity alarmSeverity,
149             ErrorSeverity errorSeverity, String errorCode, String errorDescription, String details,
150             String resolution) {
151     
152         this.eType = eType;
153         this.alarmSeverity = alarmSeverity;
154         this.errorSeverity = errorSeverity;
155         this.errorCode = errorCode;
156         this.errorDescription = errorDescription;
157         this.details = details;
158         this.resolution = resolution;
159     }
160
161     public String getDetails() {
162         return this.details;
163     }
164
165     public String getResolution() {
166         return this.resolution;
167     }
168
169     public String getErrorCode() {
170         return this.errorCode;
171     }
172
173     public String getErrorDescription() {
174         return this.errorDescription;
175     }
176
177     
178
179     
180     
181     
182
183 }