blob: 02b54c91471500c4bf1e7d5be27d88f72f94282b (
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
|
/*
* ===============================LICENSE_START======================================
* dcae-analytics
* ================================================================================
* 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===========================================
*/
package org.onap.universalvesadapter.utils;
import javax.validation.constraints.NotEmpty;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;
@Component
@PropertySource(value = {"classpath:application.properties","classpath:mapper.properties"})
@ConfigurationProperties
public class DmaapConfig {
// Hostname of DMaaP to be taken from ENV var
@NotEmpty
private String dmaaphost;
// default port number to be taken from ENV var
@NotEmpty
private int DEFAULT_PORT_NUMBER;
@Value("${mr.POLLING_INTERVAL}")
@NotEmpty
private int pollingInterval;
// default to no username
@Value("${mr.DEFAULT_USER_NAME}")
private String DEFAULT_USER_NAME;
//defaults to no userPassword
@Value("${mr.DEFAULT_USER_PASSWORD}")
private String DEFAULT_USER_PASSWORD;
//defaults to using https protocol
@Value("${mr.DEFAULT_PROTOCOL}")
@NotEmpty
private String DEFAULT_PROTOCOL;
//defaults to json content type
@Value("${mr.DEFAULT_CONTENT_TYPE}")
@NotEmpty
private String DEFAULT_CONTENT_TYPE;
@Value("${mr.DMAAP_URI_PATH_PREFIX}")
@NotEmpty
private String DMAAP_URI_PATH_PREFIX;
@Value("${mr.DMAAP_DEFAULT_CONSUMER_ID}")
@NotEmpty
private String DMAAP_DEFAULT_CONSUMER_ID;
@Value("${mr.DMAAP_GROUP_PREFIX}")
@NotEmpty
private String DMAAP_GROUP_PREFIX;
// Publisher Constants
//Dmaap Publisher Topic
@Value("${mr.publisher.topic}")
@NotEmpty
private String publisherTopic;
//disable batching by default
@Value("${mr.publisher.DEFAULT_PUBLISHER_MAX_BATCH_SIZE}")
@NotEmpty
private int publisherDEFAULT_PUBLISHER_MAX_BATCH_SIZE;
//default recovery messages size
@Value("${mr.publisher.DEFAULT_PUBLISHER_MAX_RECOVERY_QUEUE_SIZE}")
@NotEmpty
private int publisherDEFAULT_PUBLISHER_MAX_RECOVERY_QUEUE_SIZE;
//number of retries when flushing messages
@Value("${mr.publisher.PUBLISHER_MAX_FLUSH_RETRIES_ON_CLOSE}")
@NotEmpty
private int publisherPUBLISHER_MAX_FLUSH_RETRIES_ON_CLOSE;
//delay in retrying for flushing messages
@Value("${mr.publisher.PUBLISHER_DELAY_MS_ON_RETRIES_ON_CLOSE}")
@NotEmpty
private int publisherPUBLISHER_DELAY_MS_ON_RETRIES_ON_CLOSE;
// Subscriber Constants
@Value("${mr.subscriber.DEFAULT_SUBSCRIBER_TIMEOUT_MS}")
@NotEmpty
private int subscriberDEFAULT_SUBSCRIBER_TIMEOUT_MS;
@Value("${mr.subscriber.DEFAULT_SUBSCRIBER_MESSAGE_LIMIT}")
@NotEmpty
private int subscriberDEFAULT_SUBSCRIBER_MESSAGE_LIMIT;
@Value("${mr.subscriber.DEFAULT_SUBSCRIBER_GROUP_PREFIX}")
@NotEmpty
private String subscriberDEFAULT_SUBSCRIBER_GROUP_PREFIX;
@Value("${mr.subscriber.SUBSCRIBER_TIMEOUT_QUERY_PARAM_NAME}")
@NotEmpty
private String subscriberSUBSCRIBER_TIMEOUT_QUERY_PARAM_NAME;
@Value("${mr.subscriber.SUBSCRIBER_MSG_LIMIT_QUERY_PARAM_NAME}")
@NotEmpty
private String subscriberSUBSCRIBER_MSG_LIMIT_QUERY_PARAM_NAME;
public void setDmaaphost(String dmaaphost) {
this.dmaaphost = dmaaphost;
}
public String getDmaaphost() {
return dmaaphost;
}
public int getDEFAULT_PORT_NUMBER() {
return DEFAULT_PORT_NUMBER;
}
public void setDEFAULT_PORT_NUMBER(int dEFAULT_PORT_NUMBER) {
DEFAULT_PORT_NUMBER = dEFAULT_PORT_NUMBER;
}
public String getDEFAULT_USER_NAME() {
return DEFAULT_USER_NAME;
}
public void setDEFAULT_USER_NAME(String dEFAULT_USER_NAME) {
DEFAULT_USER_NAME = dEFAULT_USER_NAME;
}
public String getDEFAULT_USER_PASSWORD() {
return DEFAULT_USER_PASSWORD;
}
public void setDEFAULT_USER_PASSWORD(String dEFAULT_USER_PASSWORD) {
DEFAULT_USER_PASSWORD = dEFAULT_USER_PASSWORD;
}
public String getDEFAULT_PROTOCOL() {
return DEFAULT_PROTOCOL;
}
public void setDEFAULT_PROTOCOL(String dEFAULT_PROTOCOL) {
DEFAULT_PROTOCOL = dEFAULT_PROTOCOL;
}
public String getDEFAULT_CONTENT_TYPE() {
return DEFAULT_CONTENT_TYPE;
}
public void setDEFAULT_CONTENT_TYPE(String dEFAULT_CONTENT_TYPE) {
DEFAULT_CONTENT_TYPE = dEFAULT_CONTENT_TYPE;
}
public String getDMAAP_URI_PATH_PREFIX() {
return DMAAP_URI_PATH_PREFIX;
}
public void setDMAAP_URI_PATH_PREFIX(String dMAAP_URI_PATH_PREFIX) {
DMAAP_URI_PATH_PREFIX = dMAAP_URI_PATH_PREFIX;
}
public String getDMAAP_DEFAULT_CONSUMER_ID() {
return DMAAP_DEFAULT_CONSUMER_ID;
}
public void setDMAAP_DEFAULT_CONSUMER_ID(String dMAAP_DEFAULT_CONSUMER_ID) {
DMAAP_DEFAULT_CONSUMER_ID = dMAAP_DEFAULT_CONSUMER_ID;
}
public String getDMAAP_GROUP_PREFIX() {
return DMAAP_GROUP_PREFIX;
}
public void setDMAAP_GROUP_PREFIX(String dMAAP_GROUP_PREFIX) {
DMAAP_GROUP_PREFIX = dMAAP_GROUP_PREFIX;
}
public String getPublisherTopic() {
return publisherTopic;
}
public void setPublisherTopic(String publisherTopic) {
this.publisherTopic = publisherTopic;
}
public int getPublisherDEFAULT_PUBLISHER_MAX_BATCH_SIZE() {
return publisherDEFAULT_PUBLISHER_MAX_BATCH_SIZE;
}
public void setPublisherDEFAULT_PUBLISHER_MAX_BATCH_SIZE(int publisherDEFAULT_PUBLISHER_MAX_BATCH_SIZE) {
this.publisherDEFAULT_PUBLISHER_MAX_BATCH_SIZE = publisherDEFAULT_PUBLISHER_MAX_BATCH_SIZE;
}
public int getPublisherDEFAULT_PUBLISHER_MAX_RECOVERY_QUEUE_SIZE() {
return publisherDEFAULT_PUBLISHER_MAX_RECOVERY_QUEUE_SIZE;
}
public void setPublisherDEFAULT_PUBLISHER_MAX_RECOVERY_QUEUE_SIZE(
int publisherDEFAULT_PUBLISHER_MAX_RECOVERY_QUEUE_SIZE) {
this.publisherDEFAULT_PUBLISHER_MAX_RECOVERY_QUEUE_SIZE = publisherDEFAULT_PUBLISHER_MAX_RECOVERY_QUEUE_SIZE;
}
public int getPublisherPUBLISHER_MAX_FLUSH_RETRIES_ON_CLOSE() {
return publisherPUBLISHER_MAX_FLUSH_RETRIES_ON_CLOSE;
}
public void setPublisherPUBLISHER_MAX_FLUSH_RETRIES_ON_CLOSE(int publisherPUBLISHER_MAX_FLUSH_RETRIES_ON_CLOSE) {
this.publisherPUBLISHER_MAX_FLUSH_RETRIES_ON_CLOSE = publisherPUBLISHER_MAX_FLUSH_RETRIES_ON_CLOSE;
}
public int getPublisherPUBLISHER_DELAY_MS_ON_RETRIES_ON_CLOSE() {
return publisherPUBLISHER_DELAY_MS_ON_RETRIES_ON_CLOSE;
}
public void setPublisherPUBLISHER_DELAY_MS_ON_RETRIES_ON_CLOSE(int publisherPUBLISHER_DELAY_MS_ON_RETRIES_ON_CLOSE) {
this.publisherPUBLISHER_DELAY_MS_ON_RETRIES_ON_CLOSE = publisherPUBLISHER_DELAY_MS_ON_RETRIES_ON_CLOSE;
}
public int getsubscriberDEFAULT_SUBSCRIBER_TIMEOUT_MS() {
return subscriberDEFAULT_SUBSCRIBER_TIMEOUT_MS;
}
public void setsubscriberDEFAULT_SUBSCRIBER_TIMEOUT_MS(int subscriberDEFAULT_SUBSCRIBER_TIMEOUT_MS) {
this.subscriberDEFAULT_SUBSCRIBER_TIMEOUT_MS = subscriberDEFAULT_SUBSCRIBER_TIMEOUT_MS;
}
public int getsubscriberDEFAULT_SUBSCRIBER_MESSAGE_LIMIT() {
return subscriberDEFAULT_SUBSCRIBER_MESSAGE_LIMIT;
}
public void setsubscriberDEFAULT_SUBSCRIBER_MESSAGE_LIMIT(int subscriberDEFAULT_SUBSCRIBER_MESSAGE_LIMIT) {
this.subscriberDEFAULT_SUBSCRIBER_MESSAGE_LIMIT = subscriberDEFAULT_SUBSCRIBER_MESSAGE_LIMIT;
}
public String getsubscriberDEFAULT_SUBSCRIBER_GROUP_PREFIX() {
return subscriberDEFAULT_SUBSCRIBER_GROUP_PREFIX;
}
public void setsubscriberDEFAULT_SUBSCRIBER_GROUP_PREFIX(String subscriberDEFAULT_SUBSCRIBER_GROUP_PREFIX) {
this.subscriberDEFAULT_SUBSCRIBER_GROUP_PREFIX = subscriberDEFAULT_SUBSCRIBER_GROUP_PREFIX;
}
public String getsubscriberSUBSCRIBER_TIMEOUT_QUERY_PARAM_NAME() {
return subscriberSUBSCRIBER_TIMEOUT_QUERY_PARAM_NAME;
}
public void setsubscriberSUBSCRIBER_TIMEOUT_QUERY_PARAM_NAME(String subscriberSUBSCRIBER_TIMEOUT_QUERY_PARAM_NAME) {
this.subscriberSUBSCRIBER_TIMEOUT_QUERY_PARAM_NAME = subscriberSUBSCRIBER_TIMEOUT_QUERY_PARAM_NAME;
}
public String getsubscriberSUBSCRIBER_MSG_LIMIT_QUERY_PARAM_NAME() {
return subscriberSUBSCRIBER_MSG_LIMIT_QUERY_PARAM_NAME;
}
public void setsubscriberSUBSCRIBER_MSG_LIMIT_QUERY_PARAM_NAME(String subscriberSUBSCRIBER_MSG_LIMIT_QUERY_PARAM_NAME) {
this.subscriberSUBSCRIBER_MSG_LIMIT_QUERY_PARAM_NAME = subscriberSUBSCRIBER_MSG_LIMIT_QUERY_PARAM_NAME;
}
public int getPollingInterval() {
return pollingInterval;
}
public void setPollingInterval(int pollingInterval) {
this.pollingInterval = pollingInterval;
}
}
|