1 /*******************************************************************************
2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2019 Wipro Limited.
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
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
20 *******************************************************************************/
22 package org.onap.dcaegen2.services.sonhms;
24 import java.util.List;
27 public class Configuration {
29 private static Configuration instance = null;
30 private String pgHost;
32 private String pgUsername;
33 private String pgPassword;
34 private List<String> dmaapServers;
35 private String configDbService;
36 private String oofService;
39 private int pollingInterval;
40 private int pollingTimeout;
41 private int minCollision;
42 private int minConfusion;
43 private String sourceId;
44 private String callbackUrl;
45 private String pciOptimizer;
46 private String pciAnrOptimizer;
47 private int numSolutions;
48 private int bufferTime;
49 private int maximumClusters;
50 private String aafUsername;
51 private String aafPassword;
52 private Map<String, Object> streamsSubscribes;
53 private Map<String, Object> streamsPublishes;
54 private int badThreshold;
55 private int poorThreshold;
56 private int poorCountThreshold;
57 private int badCountThreshold;
58 private int oofTriggerCountTimer;
59 private int oofTriggerCountThreshold;
60 private int policyRespTimer;
63 public int getPoorCountThreshold() {
64 return poorCountThreshold;
67 public void setPoorCountThreshold(int poorCountThreshold) {
68 this.poorCountThreshold = poorCountThreshold;
71 public int getBadCountThreshold() {
72 return badCountThreshold;
75 public void setBadCountThreshold(int badCountThreshold) {
76 this.badCountThreshold = badCountThreshold;
79 public int getOofTriggerCountTimer() {
80 return oofTriggerCountTimer;
83 public void setOofTriggerCountTimer(int oofTriggerCountTimer) {
84 this.oofTriggerCountTimer = oofTriggerCountTimer;
87 public int getOofTriggerCountThreshold() {
88 return oofTriggerCountThreshold;
91 public void setOofTriggerCountThreshold(int oofTriggerCountThreshold) {
92 this.oofTriggerCountThreshold = oofTriggerCountThreshold;
95 public int getPolicyRespTimer() {
96 return policyRespTimer;
99 public void setPolicyRespTimer(int policyRespTimer) {
100 this.policyRespTimer = policyRespTimer;
103 public int getBadThreshold() {
107 public void setBadThreshold(int badThreshold) {
108 this.badThreshold = badThreshold;
111 public int getPoorThreshold() {
112 return poorThreshold;
115 public void setPoorThreshold(int poorThreshold) {
116 this.poorThreshold = poorThreshold;
120 * Check if topic is secure.
122 public boolean isSecured() {
123 return (aafUsername != null);
127 public String getAafUsername() {
131 public void setAafUsername(String aafUsername) {
132 this.aafUsername = aafUsername;
135 public String getAafPassword() {
139 public void setAafPassword(String aafPassword) {
140 this.aafPassword = aafPassword;
143 public Map<String, Object> getStreamsSubscribes() {
144 return streamsSubscribes;
147 public void setStreamsSubscribes(Map<String, Object> streamsSubscribes) {
148 this.streamsSubscribes = streamsSubscribes;
151 public Map<String, Object> getStreamsPublishes() {
152 return streamsPublishes;
155 public void setStreamsPublishes(Map<String, Object> streamsPublishes) {
156 this.streamsPublishes = streamsPublishes;
159 public int getMaximumClusters() {
160 return maximumClusters;
163 public void setMaximumClusters(int maximumClusters) {
164 this.maximumClusters = maximumClusters;
167 protected Configuration() {
172 * Get instance of class.
174 public static Configuration getInstance() {
175 if (instance == null) {
176 instance = new Configuration();
181 public String getCg() {
185 public void setCg(String cg) {
189 public String getCid() {
193 public void setCid(String cid) {
197 public int getPollingInterval() {
198 return pollingInterval;
201 public void setPollingInterval(int pollingInterval) {
202 this.pollingInterval = pollingInterval;
205 public int getPollingTimeout() {
206 return pollingTimeout;
209 public void setPollingTimeout(int pollingTimeout) {
210 this.pollingTimeout = pollingTimeout;
213 public int getMinCollision() {
217 public void setMinCollision(int minCollision) {
218 this.minCollision = minCollision;
221 public int getMinConfusion() {
225 public void setMinConfusion(int minConfusion) {
226 this.minConfusion = minConfusion;
229 public String getOofService() {
233 public void setOofService(String oofService) {
234 this.oofService = oofService;
237 public String getSourceId() {
241 public void setSourceId(String sourceId) {
242 this.sourceId = sourceId;
245 public String getCallbackUrl() {
249 public void setCallbackUrl(String callbackUrl) {
250 this.callbackUrl = callbackUrl;
253 public int getNumSolutions() {
257 public void setNumSolutions(int numSolutions) {
258 this.numSolutions = numSolutions;
261 public int getBufferTime() {
265 public void setBufferTime(int bufferTime) {
266 this.bufferTime = bufferTime;
269 public String getPgHost() {
273 public void setPgHost(String pgHost) {
274 this.pgHost = pgHost;
277 public int getPgPort() {
281 public void setPgPort(int pgPort) {
282 this.pgPort = pgPort;
285 public String getPgUsername() {
289 public void setPgUsername(String pgUsername) {
290 this.pgUsername = pgUsername;
293 public String getPgPassword() {
297 public void setPgPassword(String pgPassword) {
298 this.pgPassword = pgPassword;
301 public List<String> getDmaapServers() {
305 public void setDmaapServers(List<String> dmaapServers) {
306 this.dmaapServers = dmaapServers;
309 public String getConfigDbService() {
310 return configDbService;
313 public void setConfigDbService(String configDbService) {
314 this.configDbService = configDbService;
317 public String getPciOptimizer() {
321 public void setPciOptimizer(String pciOptimizer) {
322 this.pciOptimizer = pciOptimizer;
325 public String getPciAnrOptimizer() {
326 return pciAnrOptimizer;
329 public void setPciAnrOptimizer(String pciAnrOptimizer) {
330 this.pciAnrOptimizer = pciAnrOptimizer;
334 public String toString() {
335 return "Configuration [pgHost=" + pgHost + ", pgPort=" + pgPort + ", pgUsername=" + pgUsername + ", pgPassword="
336 + pgPassword + ", dmaapServers=" + dmaapServers + ", configDbService=" + configDbService
337 + ", oofService=" + oofService + ", cg=" + cg + ", cid=" + cid + ", pollingInterval=" + pollingInterval
338 + ", pollingTimeout=" + pollingTimeout + ", minCollision=" + minCollision + ", minConfusion="
339 + minConfusion + ", sourceId=" + sourceId + ", callbackUrl=" + callbackUrl + ", pciOptimizer="
340 + pciOptimizer + ", pciAnrOptimizer=" + pciAnrOptimizer + ", numSolutions=" + numSolutions
341 + ", bufferTime=" + bufferTime + ", maximumClusters=" + maximumClusters + ", aafUsername=" + aafUsername
342 + ", aafPassword=" + aafPassword + ", streamsSubscribes=" + streamsSubscribes + ", streamsPublishes="
343 + streamsPublishes + ", badThreshold=" + badThreshold + ", poorThreshold=" + poorThreshold
344 + ", poorCountThreshold=" + poorCountThreshold + ", badCountThreshold=" + badCountThreshold
345 + ", oofTriggerCountTimer=" + oofTriggerCountTimer + ", oofTriggerCountThreshold="
346 + oofTriggerCountThreshold + ", policyRespTimer=" + policyRespTimer + "]";