1 /*******************************************************************************
2 * ============LICENSE_START=======================================================
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
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=========================================================
19 * ECOMP is a trademark and service mark of AT&T Intellectual Property.
21 *******************************************************************************/
22 package org.onap.dmaap.dmf.mr.exception;
24 import javax.annotation.PostConstruct;
26 import org.springframework.beans.factory.annotation.Value;
27 import org.springframework.stereotype.Component;
28 import org.springframework.web.context.support.SpringBeanAutowiringSupport;
31 * This Class reads the error message properties
32 * from the properties file
33 * @author rajashree.khare
37 public class DMaaPErrorMessages {
42 //@Value("${resource.not.found}")
43 private String notFound="The requested resource was not found.Please verify the URL and try again";
45 // @Value("${server.unavailable}")
46 private String serverUnav="Server is temporarily unavailable or busy.Try again later, or try another server in the cluster.";
48 // @Value("${http.method.not.allowed}")
49 private String methodNotAllowed="The specified HTTP method is not allowed for the requested resource.Enter a valid HTTP method and try again.";
51 //@Value("${incorrect.request.json}")
52 private String badRequest="Incorrect JSON object. Please correct the JSON format and try again.";
54 // @Value("${network.time.out}")
55 private String nwTimeout="Connection to the DMaaP MR was timed out.Please try again.";
57 //@Value("${get.topic.failure}")
58 private String topicsfailure="Failed to retrieve list of all topics.";
60 //@Value("${not.permitted.access.1}")
61 private String notPermitted1="Access Denied.User does not have permission to perform";
63 //@Value("${not.permitted.access.2}")
64 private String notPermitted2="operation on Topic:";
66 //@Value("${get.topic.details.failure}")
67 private String topicDetailsFail="Failed to retrieve details of topic:";
69 //@Value("${create.topic.failure}")
70 private String createTopicFail="Failed to create topic:";
72 //@Value("${delete.topic.failure}")
73 private String deleteTopicFail="Failed to delete topic:";
75 //@Value("${incorrect.json}")
76 private String incorrectJson="Incorrect JSON object.Could not parse JSON. Please correct the JSON format and try again.";
78 //@Value("${consume.msg.error}")
79 private String consumeMsgError="Error while reading data from topic.";
81 //@Value("${publish.msg.error}")
82 private String publishMsgError="Error while publishing data to topic.";
85 //@Value("${publish.msg.count}")
86 private String publishMsgCount="Successfully published number of messages :";
89 //@Value("${authentication.failure}")
90 private String authFailure="Access Denied: Invalid Credentials. Enter a valid MechId and Password and try again.";
91 //@Value("${msg_size_exceeds}")
92 private String msgSizeExceeds="Message size exceeds the default size.";
95 //@Value("${topic.not.exist}")
96 private String topicNotExist="No such topic exists.";
98 public String getMsgSizeExceeds() {
99 return msgSizeExceeds;
102 public void setMsgSizeExceeds(String msgSizeExceeds) {
103 this.msgSizeExceeds = msgSizeExceeds;
106 public String getNotFound() {
110 public void setNotFound(String notFound) {
111 this.notFound = notFound;
114 public String getServerUnav() {
118 public void setServerUnav(String serverUnav) {
119 this.serverUnav = serverUnav;
122 public String getMethodNotAllowed() {
123 return methodNotAllowed;
126 public void setMethodNotAllowed(String methodNotAllowed) {
127 this.methodNotAllowed = methodNotAllowed;
130 public String getBadRequest() {
134 public void setBadRequest(String badRequest) {
135 this.badRequest = badRequest;
138 public String getNwTimeout() {
142 public void setNwTimeout(String nwTimeout) {
143 this.nwTimeout = nwTimeout;
146 public String getNotPermitted1() {
147 return notPermitted1;
150 public void setNotPermitted1(String notPermitted1) {
151 this.notPermitted1 = notPermitted1;
154 public String getNotPermitted2() {
155 return notPermitted2;
158 public void setNotPermitted2(String notPermitted2) {
159 this.notPermitted2 = notPermitted2;
162 public String getTopicsfailure() {
163 return topicsfailure;
166 public void setTopicsfailure(String topicsfailure) {
167 this.topicsfailure = topicsfailure;
170 public String getTopicDetailsFail() {
171 return topicDetailsFail;
174 public void setTopicDetailsFail(String topicDetailsFail) {
175 this.topicDetailsFail = topicDetailsFail;
178 public String getCreateTopicFail() {
179 return createTopicFail;
182 public void setCreateTopicFail(String createTopicFail) {
183 this.createTopicFail = createTopicFail;
186 public String getIncorrectJson() {
187 return incorrectJson;
190 public void setIncorrectJson(String incorrectJson) {
191 this.incorrectJson = incorrectJson;
194 public String getDeleteTopicFail() {
195 return deleteTopicFail;
198 public void setDeleteTopicFail(String deleteTopicFail) {
199 this.deleteTopicFail = deleteTopicFail;
202 public String getConsumeMsgError() {
203 return consumeMsgError;
206 public void setConsumeMsgError(String consumeMsgError) {
207 this.consumeMsgError = consumeMsgError;
210 public String getPublishMsgError() {
211 return publishMsgError;
214 public void setPublishMsgError(String publishMsgError) {
215 this.publishMsgError = publishMsgError;
218 public String getPublishMsgCount() {
219 return publishMsgCount;
222 public String getAuthFailure() {
226 public void setAuthFailure(String authFailure) {
227 this.authFailure = authFailure;
230 public void setPublishMsgCount(String publishMsgCount) {
231 this.publishMsgCount = publishMsgCount;
234 public String getTopicNotExist() {
235 return topicNotExist;
238 public void setTopicNotExist(String topicNotExist) {
239 this.topicNotExist = topicNotExist;
245 SpringBeanAutowiringSupport.processInjectionBasedOnCurrentContext(this);