593863aee51e10a545d651db74e0f53faf8daa23
[dmaap/messagerouter/msgrtr.git] / src / main / java / com / att / dmf / mr / exception / DMaaPResponseCode.java
1 /*******************************************************************************
2  *  ============LICENSE_START=======================================================
3  *  org.onap.dmaap
4  *  ================================================================================
5  *  Copyright © 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  *        http://www.apache.org/licenses/LICENSE-2.0
11 *  
12  *  Unless required by applicable law or agreed to in writing, software
13  *  distributed under the License is distributed on an "AS IS" BASIS,
14  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  *  See the License for the specific language governing permissions and
16  *  limitations under the License.
17  *  ============LICENSE_END=========================================================
18  *  
19  *  ECOMP is a trademark and service mark of AT&T Intellectual Property.
20  *  
21  *******************************************************************************/
22 package com.att.dmf.mr.exception;
23
24 /**
25  * Define the Error Response Codes for MR
26  * using this enumeration
27  * @author rajashree.khare
28  *
29  */
30 public enum DMaaPResponseCode {
31         
32           
33           /**
34            * GENERIC
35            */
36           RESOURCE_NOT_FOUND(3001),
37           SERVER_UNAVAILABLE(3002),
38           METHOD_NOT_ALLOWED(3003),
39           GENERIC_INTERNAL_ERROR(1004),
40           /**
41            * AAF
42            */
43           INVALID_CREDENTIALS(4001),
44           ACCESS_NOT_PERMITTED(4002),
45           UNABLE_TO_AUTHORIZE(4003),
46           /**
47            * PUBLISH AND SUBSCRIBE
48            */
49           MSG_SIZE_EXCEEDS_BATCH_LIMIT(5001),
50           UNABLE_TO_PUBLISH(5002),
51           INCORRECT_BATCHING_FORMAT(5003),
52           MSG_SIZE_EXCEEDS_MSG_LIMIT(5004),
53           INCORRECT_JSON(5005),
54           CONN_TIMEOUT(5006),
55           PARTIAL_PUBLISH_MSGS(5007),
56           CONSUME_MSG_ERROR(5008),
57           PUBLISH_MSG_ERROR(5009), 
58           RETRIEVE_TRANSACTIONS(5010),
59           RETRIEVE_TRANSACTIONS_DETAILS(5011),
60           TOO_MANY_REQUESTS(5012),
61           
62           RATE_LIMIT_EXCEED(301),
63          
64           /**
65            * TOPICS
66            */
67         GET_TOPICS_FAIL(6001),
68         GET_TOPICS_DETAILS_FAIL(6002),
69         CREATE_TOPIC_FAIL(6003),
70         DELETE_TOPIC_FAIL(6004),
71         GET_PUBLISHERS_BY_TOPIC(6005),
72         GET_CONSUMERS_BY_TOPIC(6006),
73         PERMIT_PUBLISHER_FOR_TOPIC(6007),
74         REVOKE_PUBLISHER_FOR_TOPIC(6008),
75         PERMIT_CONSUMER_FOR_TOPIC(6009),
76         REVOKE_CONSUMER_FOR_TOPIC(6010),
77         GET_CONSUMER_CACHE(6011),
78         DROP_CONSUMER_CACHE(6012),
79         GET_METRICS_ERROR(6013),
80         GET_BLACKLIST(6014),
81         ADD_BLACKLIST(6015),
82         REMOVE_BLACKLIST(6016),
83         TOPIC_NOT_IN_AAF(6017);
84         private int responseCode;
85         
86         public int getResponseCode() {
87                 return responseCode;
88         }
89         private DMaaPResponseCode (final int code) {
90                 responseCode = code;
91         }
92
93 }