DMAAP-MR - Merge MR repos
[dmaap/messagerouter/messageservice.git] / src / main / java / org / onap / dmaap / dmf / mr / exception / DMaaPErrorMessages.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 org.onap.dmaap.dmf.mr.exception;
23
24 import org.springframework.stereotype.Component;
25 import org.springframework.web.context.support.SpringBeanAutowiringSupport;
26
27 import javax.annotation.PostConstruct;
28
29 /**
30  * This Class reads the error message properties
31  * from the properties file
32  * @author rajashree.khare
33  *
34  */
35 @Component
36 public class DMaaPErrorMessages {
37
38         
39                         
40
41         //@Value("${resource.not.found}")
42         private String notFound="The requested resource was not found.Please verify the URL and try again";
43         
44 //      @Value("${server.unavailable}")
45         private String serverUnav="Server is temporarily unavailable or busy.Try again later, or try another server in the cluster.";
46         
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.";
49         
50         //@Value("${incorrect.request.json}")
51         private String badRequest="Incorrect JSON object. Please correct the JSON format and try again.";
52         
53 //      @Value("${network.time.out}")
54         private String nwTimeout="Connection to the DMaaP MR was timed out.Please try again.";
55         
56         //@Value("${get.topic.failure}")
57         private String topicsfailure="Failed to retrieve list of all topics.";
58         
59         //@Value("${not.permitted.access.1}")
60         private String notPermitted1="Access Denied.User does not have permission to perform ";
61         
62         //@Value("${not.permitted.access.2}")
63         private String notPermitted2=" operation on Topic:";
64         
65         //@Value("${get.topic.details.failure}")
66         private String topicDetailsFail="Failed to retrieve details of topic:";
67         
68         //@Value("${create.topic.failure}")
69         private String createTopicFail="Failed to create topic:";
70         
71         //@Value("${delete.topic.failure}")
72         private String deleteTopicFail="Failed to delete topic:";
73         
74         //@Value("${incorrect.json}")
75         private String incorrectJson="Incorrect JSON object.Could not parse JSON. Please correct the JSON format and try again.";
76         
77         //@Value("${consume.msg.error}")
78         private String consumeMsgError="Error while reading data from topic.";
79         
80         //@Value("${publish.msg.error}")
81         private String publishMsgError="Error while publishing data to topic.";
82         
83         
84         //@Value("${publish.msg.count}")
85         private String publishMsgCount="Successfully published number of messages :";
86         
87         
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.";
92         
93         
94         //@Value("${topic.not.exist}")
95         private String topicNotExist="No such topic exists.";
96         
97         public String getMsgSizeExceeds() {
98                 return msgSizeExceeds;
99         }
100
101         public void setMsgSizeExceeds(String msgSizeExceeds) {
102                 this.msgSizeExceeds = msgSizeExceeds;
103         }
104
105         public String getNotFound() {
106                 return notFound;
107         }
108
109         public void setNotFound(String notFound) {
110                 this.notFound = notFound;
111         }
112
113         public String getServerUnav() {
114                 return serverUnav;
115         }
116
117         public void setServerUnav(String serverUnav) {
118                 this.serverUnav = serverUnav;
119         }
120
121         public String getMethodNotAllowed() {
122                 return methodNotAllowed;
123         }
124
125         public void setMethodNotAllowed(String methodNotAllowed) {
126                 this.methodNotAllowed = methodNotAllowed;
127         }
128
129         public String getBadRequest() {
130                 return badRequest;
131         }
132
133         public void setBadRequest(String badRequest) {
134                 this.badRequest = badRequest;
135         }
136
137         public String getNwTimeout() {
138                 return nwTimeout;
139         }
140
141         public void setNwTimeout(String nwTimeout) {
142                 this.nwTimeout = nwTimeout;
143         }
144
145         public String getNotPermitted1() {
146                 return notPermitted1;
147         }
148
149         public void setNotPermitted1(String notPermitted1) {
150                 this.notPermitted1 = notPermitted1;
151         }
152
153         public String getNotPermitted2() {
154                 return notPermitted2;
155         }
156
157         public void setNotPermitted2(String notPermitted2) {
158                 this.notPermitted2 = notPermitted2;
159         }
160
161         public String getTopicsfailure() {
162                 return topicsfailure;
163         }
164
165         public void setTopicsfailure(String topicsfailure) {
166                 this.topicsfailure = topicsfailure;
167         }
168
169         public String getTopicDetailsFail() {
170                 return topicDetailsFail;
171         }
172
173         public void setTopicDetailsFail(String topicDetailsFail) {
174                 this.topicDetailsFail = topicDetailsFail;
175         }
176
177         public String getCreateTopicFail() {
178                 return createTopicFail;
179         }
180
181         public void setCreateTopicFail(String createTopicFail) {
182                 this.createTopicFail = createTopicFail;
183         }
184
185         public String getIncorrectJson() {
186                 return incorrectJson;
187         }
188
189         public void setIncorrectJson(String incorrectJson) {
190                 this.incorrectJson = incorrectJson;
191         }
192
193         public String getDeleteTopicFail() {
194                 return deleteTopicFail;
195         }
196
197         public void setDeleteTopicFail(String deleteTopicFail) {
198                 this.deleteTopicFail = deleteTopicFail;
199         }
200
201         public String getConsumeMsgError() {
202                 return consumeMsgError;
203         }
204
205         public void setConsumeMsgError(String consumeMsgError) {
206                 this.consumeMsgError = consumeMsgError;
207         }
208
209         public String getPublishMsgError() {
210                 return publishMsgError;
211         }
212
213         public void setPublishMsgError(String publishMsgError) {
214                 this.publishMsgError = publishMsgError;
215         }
216
217         public String getPublishMsgCount() {
218                 return publishMsgCount;
219         }
220
221         public String getAuthFailure() {
222                 return authFailure;
223         }
224
225         public void setAuthFailure(String authFailure) {
226                 this.authFailure = authFailure;
227         }
228
229         public void setPublishMsgCount(String publishMsgCount) {
230                 this.publishMsgCount = publishMsgCount;
231         }
232
233         public String getTopicNotExist() {
234                 return topicNotExist;
235         }
236
237         public void setTopicNotExist(String topicNotExist) {
238                 this.topicNotExist = topicNotExist;
239         }
240         
241         
242         @PostConstruct
243         public void init() {
244             SpringBeanAutowiringSupport.processInjectionBasedOnCurrentContext(this);
245         }
246         
247 }