Change oof trigger functionality considering multiple PM events
[dcaegen2/services/son-handler.git] / src / main / java / org / onap / dcaegen2 / services / sonhms / Configuration.java
1 /*******************************************************************************
2  *  ============LICENSE_START=======================================================
3  *  son-handler
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
10  *  
11  *          http://www.apache.org/licenses/LICENSE-2.0
12  *  
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=========================================================
19  *  
20  *******************************************************************************/
21
22 package org.onap.dcaegen2.services.sonhms;
23
24 import java.util.List;
25 import java.util.Map;
26
27 public class Configuration {
28
29     private static Configuration instance = null;
30     private String pgHost;
31     private int pgPort;
32     private String pgUsername;
33     private String pgPassword;
34     private List<String> dmaapServers;
35     private String configDbService;
36     private String oofService;
37     private String cg;
38     private String cid;
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;
61     
62     
63     public int getPoorCountThreshold() {
64         return poorCountThreshold;
65     }
66
67     public void setPoorCountThreshold(int poorCountThreshold) {
68         this.poorCountThreshold = poorCountThreshold;
69     }
70
71     public int getBadCountThreshold() {
72         return badCountThreshold;
73     }
74
75     public void setBadCountThreshold(int badCountThreshold) {
76         this.badCountThreshold = badCountThreshold;
77     }
78
79     public int getOofTriggerCountTimer() {
80         return oofTriggerCountTimer;
81     }
82
83     public void setOofTriggerCountTimer(int oofTriggerCountTimer) {
84         this.oofTriggerCountTimer = oofTriggerCountTimer;
85     }
86
87     public int getOofTriggerCountThreshold() {
88         return oofTriggerCountThreshold;
89     }
90
91     public void setOofTriggerCountThreshold(int oofTriggerCountThreshold) {
92         this.oofTriggerCountThreshold = oofTriggerCountThreshold;
93     }
94
95     public int getPolicyRespTimer() {
96         return policyRespTimer;
97     }
98
99     public void setPolicyRespTimer(int policyRespTimer) {
100         this.policyRespTimer = policyRespTimer;
101     }
102
103     public int getBadThreshold() {
104         return badThreshold;
105     }
106
107     public void setBadThreshold(int badThreshold) {
108         this.badThreshold = badThreshold;
109     }
110
111     public int getPoorThreshold() {
112         return poorThreshold;
113     }
114
115     public void setPoorThreshold(int poorThreshold) {
116         this.poorThreshold = poorThreshold;
117     }
118
119     /**
120      * Check if topic is secure.
121      */
122     public boolean isSecured() {
123         return (aafUsername != null);
124            
125     }
126
127     public String getAafUsername() {
128         return aafUsername;
129     }
130
131     public void setAafUsername(String aafUsername) {
132         this.aafUsername = aafUsername;
133     }
134
135     public String getAafPassword() {
136         return aafPassword;
137     }
138
139     public void setAafPassword(String aafPassword) {
140         this.aafPassword = aafPassword;
141     }
142
143     public Map<String, Object> getStreamsSubscribes() {
144         return streamsSubscribes;
145     }
146
147     public void setStreamsSubscribes(Map<String, Object> streamsSubscribes) {
148         this.streamsSubscribes = streamsSubscribes;
149     }
150
151     public Map<String, Object> getStreamsPublishes() {
152         return streamsPublishes;
153     }
154
155     public void setStreamsPublishes(Map<String, Object> streamsPublishes) {
156         this.streamsPublishes = streamsPublishes;
157     }
158
159     public int getMaximumClusters() {
160         return maximumClusters;
161     }
162
163     public void setMaximumClusters(int maximumClusters) {
164         this.maximumClusters = maximumClusters;
165     }
166
167     protected Configuration() {
168
169     }
170
171     /**
172      * Get instance of class.
173      */
174     public static Configuration getInstance() {
175         if (instance == null) {
176             instance = new Configuration();
177         }
178         return instance;
179     }
180
181     public String getCg() {
182         return cg;
183     }
184
185     public void setCg(String cg) {
186         this.cg = cg;
187     }
188
189     public String getCid() {
190         return cid;
191     }
192
193     public void setCid(String cid) {
194         this.cid = cid;
195     }
196
197     public int getPollingInterval() {
198         return pollingInterval;
199     }
200
201     public void setPollingInterval(int pollingInterval) {
202         this.pollingInterval = pollingInterval;
203     }
204
205     public int getPollingTimeout() {
206         return pollingTimeout;
207     }
208
209     public void setPollingTimeout(int pollingTimeout) {
210         this.pollingTimeout = pollingTimeout;
211     }
212
213     public int getMinCollision() {
214         return minCollision;
215     }
216
217     public void setMinCollision(int minCollision) {
218         this.minCollision = minCollision;
219     }
220
221     public int getMinConfusion() {
222         return minConfusion;
223     }
224
225     public void setMinConfusion(int minConfusion) {
226         this.minConfusion = minConfusion;
227     }
228
229     public String getOofService() {
230         return oofService;
231     }
232
233     public void setOofService(String oofService) {
234         this.oofService = oofService;
235     }
236
237     public String getSourceId() {
238         return sourceId;
239     }
240
241     public void setSourceId(String sourceId) {
242         this.sourceId = sourceId;
243     }
244
245     public String getCallbackUrl() {
246         return callbackUrl;
247     }
248
249     public void setCallbackUrl(String callbackUrl) {
250         this.callbackUrl = callbackUrl;
251     }
252
253     public int getNumSolutions() {
254         return numSolutions;
255     }
256
257     public void setNumSolutions(int numSolutions) {
258         this.numSolutions = numSolutions;
259     }
260
261     public int getBufferTime() {
262         return bufferTime;
263     }
264
265     public void setBufferTime(int bufferTime) {
266         this.bufferTime = bufferTime;
267     }
268
269     public String getPgHost() {
270         return pgHost;
271     }
272
273     public void setPgHost(String pgHost) {
274         this.pgHost = pgHost;
275     }
276
277     public int getPgPort() {
278         return pgPort;
279     }
280
281     public void setPgPort(int pgPort) {
282         this.pgPort = pgPort;
283     }
284
285     public String getPgUsername() {
286         return pgUsername;
287     }
288
289     public void setPgUsername(String pgUsername) {
290         this.pgUsername = pgUsername;
291     }
292
293     public String getPgPassword() {
294         return pgPassword;
295     }
296
297     public void setPgPassword(String pgPassword) {
298         this.pgPassword = pgPassword;
299     }
300
301     public List<String> getDmaapServers() {
302         return dmaapServers;
303     }
304
305     public void setDmaapServers(List<String> dmaapServers) {
306         this.dmaapServers = dmaapServers;
307     }
308
309     public String getConfigDbService() {
310         return configDbService;
311     }
312
313     public void setConfigDbService(String configDbService) {
314         this.configDbService = configDbService;
315     }
316
317     public String getPciOptimizer() {
318         return pciOptimizer;
319     }
320
321     public void setPciOptimizer(String pciOptimizer) {
322         this.pciOptimizer = pciOptimizer;
323     }
324
325     public String getPciAnrOptimizer() {
326         return pciAnrOptimizer;
327     }
328
329     public void setPciAnrOptimizer(String pciAnrOptimizer) {
330         this.pciAnrOptimizer = pciAnrOptimizer;
331     }
332
333     @Override
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 + "]";
347     }
348     
349     
350
351 }