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 org.springframework.stereotype.Component;
25 import org.springframework.web.context.support.SpringBeanAutowiringSupport;
27 import javax.annotation.PostConstruct;
30 * This Class reads the error message properties
31 * from the properties file
32 * @author rajashree.khare
36 public class DMaaPErrorMessages {
41 //@Value("${resource.not.found}")
42 private String notFound="The requested resource was not found.Please verify the URL and try again";
44 // @Value("${server.unavailable}")
45 private String serverUnav="Server is temporarily unavailable or busy.Try again later, or try another server in the cluster.";
47 // @Value("${http.method.not.allowed}")
48 private String methodNotAllowed="The specified HTTP method is not allowed for the requested resource.Enter a valid HTTP method and try again.";
50 //@Value("${incorrect.request.json}")
51 private String badRequest="Incorrect JSON object. Please correct the JSON format and try again.";
53 // @Value("${network.time.out}")
54 private String nwTimeout="Connection to the DMaaP MR was timed out.Please try again.";
56 //@Value("${get.topic.failure}")
57 private String topicsfailure="Failed to retrieve list of all topics.";
59 //@Value("${not.permitted.access.1}")
60 private String notPermitted1="Access Denied.User does not have permission to perform ";
62 //@Value("${not.permitted.access.2}")
63 private String notPermitted2=" operation on Topic:";
65 //@Value("${get.topic.details.failure}")
66 private String topicDetailsFail="Failed to retrieve details of topic:";
68 //@Value("${create.topic.failure}")
69 private String createTopicFail="Failed to create topic:";
71 //@Value("${delete.topic.failure}")
72 private String deleteTopicFail="Failed to delete topic:";
74 //@Value("${incorrect.json}")
75 private String incorrectJson="Incorrect JSON object.Could not parse JSON. Please correct the JSON format and try again.";
77 //@Value("${consume.msg.error}")
78 private String consumeMsgError="Error while reading data from topic.";
80 //@Value("${publish.msg.error}")
81 private String publishMsgError="Error while publishing data to topic.";
84 //@Value("${publish.msg.count}")
85 private String publishMsgCount="Successfully published number of messages :";
88 //@Value("${authentication.failure}")
89 private String authFailure="Access Denied: Invalid Credentials. Enter a valid MechId and Password and try again.";
90 //@Value("${msg_size_exceeds}")
91 private String msgSizeExceeds="Message size exceeds the default size.";
94 //@Value("${topic.not.exist}")
95 private String topicNotExist="No such topic exists.";
97 public String getMsgSizeExceeds() {
98 return msgSizeExceeds;
101 public void setMsgSizeExceeds(String msgSizeExceeds) {
102 this.msgSizeExceeds = msgSizeExceeds;
105 public String getNotFound() {
109 public void setNotFound(String notFound) {
110 this.notFound = notFound;
113 public String getServerUnav() {
117 public void setServerUnav(String serverUnav) {
118 this.serverUnav = serverUnav;
121 public String getMethodNotAllowed() {
122 return methodNotAllowed;
125 public void setMethodNotAllowed(String methodNotAllowed) {
126 this.methodNotAllowed = methodNotAllowed;
129 public String getBadRequest() {
133 public void setBadRequest(String badRequest) {
134 this.badRequest = badRequest;
137 public String getNwTimeout() {
141 public void setNwTimeout(String nwTimeout) {
142 this.nwTimeout = nwTimeout;
145 public String getNotPermitted1() {
146 return notPermitted1;
149 public void setNotPermitted1(String notPermitted1) {
150 this.notPermitted1 = notPermitted1;
153 public String getNotPermitted2() {
154 return notPermitted2;
157 public void setNotPermitted2(String notPermitted2) {
158 this.notPermitted2 = notPermitted2;
161 public String getTopicsfailure() {
162 return topicsfailure;
165 public void setTopicsfailure(String topicsfailure) {
166 this.topicsfailure = topicsfailure;
169 public String getTopicDetailsFail() {
170 return topicDetailsFail;
173 public void setTopicDetailsFail(String topicDetailsFail) {
174 this.topicDetailsFail = topicDetailsFail;
177 public String getCreateTopicFail() {
178 return createTopicFail;
181 public void setCreateTopicFail(String createTopicFail) {
182 this.createTopicFail = createTopicFail;
185 public String getIncorrectJson() {
186 return incorrectJson;
189 public void setIncorrectJson(String incorrectJson) {
190 this.incorrectJson = incorrectJson;
193 public String getDeleteTopicFail() {
194 return deleteTopicFail;
197 public void setDeleteTopicFail(String deleteTopicFail) {
198 this.deleteTopicFail = deleteTopicFail;
201 public String getConsumeMsgError() {
202 return consumeMsgError;
205 public void setConsumeMsgError(String consumeMsgError) {
206 this.consumeMsgError = consumeMsgError;
209 public String getPublishMsgError() {
210 return publishMsgError;
213 public void setPublishMsgError(String publishMsgError) {
214 this.publishMsgError = publishMsgError;
217 public String getPublishMsgCount() {
218 return publishMsgCount;
221 public String getAuthFailure() {
225 public void setAuthFailure(String authFailure) {
226 this.authFailure = authFailure;
229 public void setPublishMsgCount(String publishMsgCount) {
230 this.publishMsgCount = publishMsgCount;
233 public String getTopicNotExist() {
234 return topicNotExist;
237 public void setTopicNotExist(String topicNotExist) {
238 this.topicNotExist = topicNotExist;
244 SpringBeanAutowiringSupport.processInjectionBasedOnCurrentContext(this);