summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/onap/dmaap/dmf/mr/exception/DMaaPResponseCode.java
blob: a7b073a9e2ba9608ec69da20b9200563c8d2e2c6 (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
/*******************************************************************************
 *  ============LICENSE_START=======================================================
 *  org.onap.dmaap
 *  ================================================================================
 *  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
 *  ================================================================================
 *  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=========================================================
 *  
 *  ECOMP is a trademark and service mark of AT&T Intellectual Property.
 *  
 *******************************************************************************/
package org.onap.dmaap.dmf.mr.exception;

/**
 * Define the Error Response Codes for MR
 * using this enumeration
 * @author rajashree.khare
 *
 */
public enum DMaaPResponseCode {
	
	  
	  /**
	   * GENERIC
	   */
	  RESOURCE_NOT_FOUND(3001),
	  SERVER_UNAVAILABLE(3002),
	  METHOD_NOT_ALLOWED(3003),
	  GENERIC_INTERNAL_ERROR(1004),
	  /**
	   * AAF
	   */
	  INVALID_CREDENTIALS(4001),
	  ACCESS_NOT_PERMITTED(4002),
	  UNABLE_TO_AUTHORIZE(4003),
	  /**
	   * PUBLISH AND SUBSCRIBE
	   */
	  MSG_SIZE_EXCEEDS_BATCH_LIMIT(5001),
	  UNABLE_TO_PUBLISH(5002),
	  INCORRECT_BATCHING_FORMAT(5003),
	  MSG_SIZE_EXCEEDS_MSG_LIMIT(5004),
	  INCORRECT_JSON(5005),
	  CONN_TIMEOUT(5006),
	  PARTIAL_PUBLISH_MSGS(5007),
	  CONSUME_MSG_ERROR(5008),
	  PUBLISH_MSG_ERROR(5009), 
	  RETRIEVE_TRANSACTIONS(5010),
	  RETRIEVE_TRANSACTIONS_DETAILS(5011),
	  TOO_MANY_REQUESTS(5012),
	  
	  RATE_LIMIT_EXCEED(301),
	 
	  /**
	   * TOPICS
	   */
	GET_TOPICS_FAIL(6001),
	GET_TOPICS_DETAILS_FAIL(6002),
	CREATE_TOPIC_FAIL(6003),
	DELETE_TOPIC_FAIL(6004),
	GET_PUBLISHERS_BY_TOPIC(6005),
	GET_CONSUMERS_BY_TOPIC(6006),
	PERMIT_PUBLISHER_FOR_TOPIC(6007),
	REVOKE_PUBLISHER_FOR_TOPIC(6008),
	PERMIT_CONSUMER_FOR_TOPIC(6009),
	REVOKE_CONSUMER_FOR_TOPIC(6010),
	GET_CONSUMER_CACHE(6011),
	DROP_CONSUMER_CACHE(6012),
	GET_METRICS_ERROR(6013),
	GET_BLACKLIST(6014),
	ADD_BLACKLIST(6015),
	REMOVE_BLACKLIST(6016),
	TOPIC_NOT_IN_AAF(6017);
	private int responseCode;
	
	public int getResponseCode() {
		return responseCode;
	}
	private DMaaPResponseCode (final int code) {
		responseCode = code;
	}

}