aboutsummaryrefslogtreecommitdiffstats
path: root/music-core/src/main/java/org/onap/music/eelf/logging/format/AppMessages.java
blob: 5af3661c5d0a4a9e98041d7493d079de9e43bbde (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
/*
 * ============LICENSE_START==========================================
 * org.onap.music
 * ===================================================================
 *  Copyright (c) 2017 AT&T Intellectual Property
 *  Copyright (c) 2019 IBM Intellectual Property
 * ===================================================================
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 * 
 *     http://www.apache.org/licenses/LICENSE-2.0
 * 
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 * 
 * ============LICENSE_END=============================================
 * ====================================================================
 */

package org.onap.music.eelf.logging.format;

/**
 * @author inam
 *
 */
public enum AppMessages {
    
    
    
    /*
     * 100-199 Security/Permission Related - Authentication problems
     * [ERR100E] Missing Information 
     * [ERR101E] Authentication error occured
     * 
     * 200-299 Availability/Timeout Related/IO - connectivity error - connection timeout
     *  [ERR200E] Connectivity
     *  [ERR201E] Host not available 
     *     [ERR202E] Error while connecting to Cassandra cluster
     *  [ERR203E] IO Error has occured
     *  [ERR204E] Execution Interrupted
     *     [ERR205E] Session Expired
     *  [ERR206E] Cache not authenticated
     * 
     * 
     * 300-399 Data Access/Integrity Related
     * [ERR300E] Incorrect data  
     * 
     * 400-499 - Cassandra Query Related
     * [ERR400E] Error while processing prepared query object
     * [ERR401E] Executing Session Failure for Request
     * [ERR402E] Ill formed queryObject for the request
     * [ERR403E] Error processing Prepared Query Object  
     * 
     * 500-599 - Locking Related
     * [ERR500E] Invalid lock
     * [ERR501E] Locking Error has occured
     * [ERR502E] Deprecated
     * [ERR503E] Failed to aquire lock store handle  
     * [ERR504E] Failed to create Lock Reference
     * [ERR505E] Lock does not exist
     * [ERR506E] Failed to aquire lock
     * [ERR507E] Lock not aquired 
     * [ERR508E] Lock state not set 
     * [ERR509E] Lock not destroyed 
     * [ERR510E] Lock not released 
     * [ERR511E] Lock not deleted 
     * [ERR512E] Deprecated
     * 
     * 
     * 600 - 699 - Music Service Errors
     * [ERR600E] Error initializing the cache 
     * 
     * 700-799 Schema Interface Type/Validation - received Pay-load checksum is
     * invalid - received JSON is not valid
     * 
     * 800-899 Business/Flow Processing Related - check out to service is not
     * allowed - Roll-back is done - failed to generate heat file
     * 
     * 
     * 900-999 Unknown Errors - Unexpected exception
     * [ERR900E] Unexpected error occured
     * [ERR901E] Number format exception  
     * 
     * 
     * 1000-1099 Reserved - do not use
     * 
     */



    
    MISSINGINFO("[ERR100E]", "Missing Information ","Details: NA", "Please check application credentials and/or headers"),
    AUTHENTICATIONERROR("[ERR101E]", "Authentication error occured ","Details: NA", "Please verify application credentials"),
    CONNCECTIVITYERROR("[ERR200E]"," Connectivity error","Details: NA ","Please check connectivity to external resources"),
    HOSTUNAVAILABLE("[ERR201E]","Host not available","Details: NA","Please verify the host details"),
    CASSANDRACONNECTIVITY("[ERR202E]","Error while connecting to Cassandra cluster",""," Please check cassandra cluster details"),
    IOERROR("[ERR203E]","IO Error has occured","","Please check IO"),
    EXECUTIONINTERRUPTED("[ERR204E]"," Execution Interrupted","",""),
    SESSIONEXPIRED("[ERR205E]"," Session Expired","","Session has expired."),
    CACHEAUTHENTICATION("[ERR206E]","Cache not authenticated",""," Cache not authenticated"),
    
    INCORRECTDATA("[ERR300E]"," Incorrect data",""," Please verify the request payload and try again"),
    MULTIPLERECORDS("[ERR301E]"," Multiple records found",""," Please verify the request payload and try again"),
    ALREADYEXIST("[ERR302E]"," Record already exist",""," Please verify the request payload and try again"),
    MISSINGDATA("[ERR300E]"," Incorrect data",""," Please verify the request payload and try again"),
    
    QUERYERROR("[ERR400E]","Error while processing prepared query object",""," Please verify the query"),
    SESSIONFAILED("[ERR401E]","Executing Session Failure for Request","","Please verify the session and request"),
    
    INVALIDLOCK("[ERR500E]"," Invalid lock or acquire failed",""," Lock is not valid to aquire"),
    LOCKINGERROR("[ERR501E]"," Locking Error has occured",""," Locking Error has occured"),
    LOCKHANDLE("[ERR503E]","Failed to aquire lock store handle",""," Failed to aquire lock store handle"),
    CREATELOCK("[ERR504E]","Failed to aquire lock store handle  ","","Failed to aquire lock store handle  "),
    LOCKSTATE("[ERR508E]"," Lock state not set",""," Lock state not set"),
    DESTROYLOCK("[ERR509E]"," Lock not destroyed",""," Lock not destroyed"),
    RELEASELOCK("[ERR510E]"," Lock not released",""," Lock not released"),
    DELTELOCK("[ERR511E]",""," Lock not deleted "," Lock not deleted "),
    CACHEERROR("[ERR600E]"," Error initializing the cache",""," Error initializing the cache"),
    
    UNKNOWNERROR("[ERR900E]"," Unexpected error occured",""," Please check logs for details");




    private ErrorTypes eType;
    private ErrorSeverity alarmSeverity;
    private ErrorSeverity errorSeverity;
    private String errorCode;
    private String errorDescription;
    private String details;
    private String resolution;


    AppMessages(String errorCode, String errorDescription, String details,String resolution) {
    
        this.errorCode = errorCode;
        this.errorDescription = errorDescription;
        this.details = details;
        this.resolution = resolution;
    }


    public ErrorTypes getEType() {
        return eType;
    }

    public ErrorSeverity getAlarmSeverity() {
        return alarmSeverity;
    }
    public ErrorSeverity getErrorSeverity() {
        return errorSeverity;
    }
    
    public void setDetails(String details){ this.details=details; }

    public String getDetails() {
        return this.details;
    }

    public void setResolution(String resolution){ this.resolution=resolution; }

    public String getResolution() {
        return this.resolution;
    }

    public void setErrorCode(String errorCode){ this.errorCode=errorCode; }

    public String getErrorCode() {
        return this.errorCode;
    }

    public void setErrorDescription(String errorDescription){ this.errorDescription=errorDescription; }

    public String getErrorDescription() {
        return this.errorDescription;
    }

    

    
    
    

}