Sync Integ to Master
[sdc.git] / common-app-api / src / main / java / org / openecomp / sdc / fe / config / Configuration.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
4  * ================================================================================
5  * Copyright (C) 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  *
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 package org.openecomp.sdc.fe.config;
22
23 import org.openecomp.sdc.common.api.BasicConfiguration;
24
25 import java.util.Date;
26 import java.util.List;
27
28 import static java.lang.String.format;
29
30 public class Configuration extends BasicConfiguration {
31     /**
32      * fe FQDN
33      */
34     private String feFqdn;
35     /**
36      * backend host
37      */
38     private String beHost;
39     /**
40      * backend http port
41      */
42     private Integer beHttpPort;
43     /**
44      * backend http secured port
45      */
46     private Integer beSslPort;
47
48     private Integer healthCheckSocketTimeoutInMs;
49
50     private Integer healthCheckIntervalInSeconds;
51
52     private List<String> healthStatusExclude;
53
54     private FeMonitoringConfig systemMonitoring;
55
56     private String kibanaHost;
57
58     private Integer kibanaPort;
59
60     private String kibanaProtocol;
61
62     private String onboardingForwardContext;
63
64     private OnboardingConfig onboarding;
65
66     private DcaeConfig dcae;
67     /**
68      * be http context
69      */
70     private String beContext;
71     /**
72      * backend protocol. http | https
73      */
74     private String beProtocol = "http";
75     private Date released;
76     private String version = "1111";
77     private Connection connection;
78     private List<String> protocols;
79     private int threadpoolSize;
80     private int requestTimeout;
81     private List<List<String>> identificationHeaderFields;
82     private List<List<String>> optionalHeaderFields;
83     private List<String> forwardHeaderFields;
84
85     public String getKibanaProtocol() {
86         return kibanaProtocol;
87     }
88
89     public void setKibanaProtocol(String kibanaProtocol) {
90         this.kibanaProtocol = kibanaProtocol;
91     }
92
93     public String getKibanaHost() {
94         return kibanaHost;
95     }
96
97     public void setKibanaHost(String kibanaHost) {
98         this.kibanaHost = kibanaHost;
99     }
100
101     public Integer getKibanaPort() {
102         return kibanaPort;
103     }
104
105     public void setKibanaPort(Integer kibanaPort) {
106         this.kibanaPort = kibanaPort;
107     }
108
109     public FeMonitoringConfig getSystemMonitoring() {
110         return systemMonitoring;
111     }
112
113     public void setSystemMonitoring(FeMonitoringConfig systemMonitoring) {
114         this.systemMonitoring = systemMonitoring;
115     }
116
117     public Integer getHealthCheckSocketTimeoutInMs() {
118         return healthCheckSocketTimeoutInMs;
119     }
120
121     public void setHealthCheckSocketTimeoutInMs(Integer healthCheckSocketTimeout) {
122         this.healthCheckSocketTimeoutInMs = healthCheckSocketTimeout;
123     }
124
125     public Integer getHealthCheckSocketTimeoutInMs(int defaultVal) {
126         return healthCheckSocketTimeoutInMs == null ? defaultVal : healthCheckSocketTimeoutInMs;
127     }
128
129     public Integer getHealthCheckIntervalInSeconds() {
130         return healthCheckIntervalInSeconds;
131     }
132
133     public void setHealthCheckIntervalInSeconds(Integer healthCheckInterval) {
134         this.healthCheckIntervalInSeconds = healthCheckInterval;
135     }
136
137     public Integer getHealthCheckIntervalInSeconds(int defaultVal) {
138         return healthCheckIntervalInSeconds == null ? defaultVal : healthCheckIntervalInSeconds;
139     }
140
141     public Date getReleased() {
142         return released;
143     }
144
145     public void setReleased(Date released) {
146         this.released = released;
147     }
148
149     public String getVersion() {
150         return version;
151     }
152
153     public void setVersion(String version) {
154         this.version = version;
155     }
156
157     public Connection getConnection() {
158         return connection;
159     }
160
161     public void setConnection(Connection connection) {
162         this.connection = connection;
163     }
164
165     public List<String> getProtocols() {
166         return protocols;
167     }
168
169     public void setProtocols(List<String> protocols) {
170         this.protocols = protocols;
171     }
172
173     public String getBeHost() {
174         return beHost;
175     }
176
177     public void setBeHost(String beHost) {
178         this.beHost = beHost;
179     }
180
181     public Integer getBeHttpPort() {
182         return beHttpPort;
183     }
184
185     public void setBeHttpPort(Integer beHttpPort) {
186         this.beHttpPort = beHttpPort;
187     }
188
189     public Integer getBeSslPort() {
190         return beSslPort;
191     }
192
193     public void setBeSslPort(Integer beSslPort) {
194         this.beSslPort = beSslPort;
195     }
196
197     public String getBeContext() {
198         return beContext;
199     }
200
201     public void setBeContext(String beContext) {
202         this.beContext = beContext;
203     }
204
205     public String getBeProtocol() {
206         return beProtocol;
207     }
208
209     public void setBeProtocol(String beProtocol) {
210         this.beProtocol = beProtocol;
211     }
212
213     public int getThreadpoolSize() {
214         return threadpoolSize;
215     }
216
217     public void setThreadpoolSize(int threadpoolSize) {
218         this.threadpoolSize = threadpoolSize;
219     }
220
221     public int getRequestTimeout() {
222         return requestTimeout;
223     }
224
225     public void setRequestTimeout(int requestTimeout) {
226         this.requestTimeout = requestTimeout;
227     }
228
229     public List<List<String>> getIdentificationHeaderFields() {
230         return identificationHeaderFields;
231     }
232
233     public void setIdentificationHeaderFields(List<List<String>> identificationHeaderFields) {
234         this.identificationHeaderFields = identificationHeaderFields;
235     }
236
237     public List<List<String>> getOptionalHeaderFields() {
238         return optionalHeaderFields;
239     }
240
241     public void setOptionalHeaderFields(List<List<String>> optionalHeaderFields) {
242         this.optionalHeaderFields = optionalHeaderFields;
243     }
244
245     public List<String> getForwardHeaderFields() {
246         return forwardHeaderFields;
247     }
248
249     public void setForwardHeaderFields(List<String> forwardHeaderFields) {
250         this.forwardHeaderFields = forwardHeaderFields;
251     }
252
253     public String getFeFqdn() {
254         return feFqdn;
255     }
256
257     public void setFeFqdn(String feFqdn) {
258         this.feFqdn = feFqdn;
259     }
260
261     public String getOnboardingForwardContext() {
262         return onboardingForwardContext;
263     }
264
265     public void setOnboardingForwardContext(String onboardingForwardContext) {
266         this.onboardingForwardContext = onboardingForwardContext;
267     }
268
269     public OnboardingConfig getOnboarding() {
270         return onboarding;
271     }
272
273     public void setOnboarding(OnboardingConfig onboarding) {
274         this.onboarding = onboarding;
275     }
276
277     public DcaeConfig getDcae() {
278         return dcae;
279     }
280
281     public void setDcae(DcaeConfig dcae) {
282         this.dcae = dcae;
283     }
284
285     @Override
286     public String toString() {
287         return new StringBuilder().append(format("backend host: %s%n", beHost))
288                 .append(format("backend http port: %s%n", beHttpPort))
289                 .append(format("backend ssl port: %s%n", beSslPort)).append(format("backend context: %s%n", beContext))
290                 .append(format("backend protocol: %s%n", beProtocol))
291                 .append(format("onboarding forward context: %s%n", onboardingForwardContext))
292                 .append(format("Version: %s%n", version)).append(format("Released: %s%n", released))
293                 .append(format("Connecting to database: %s%n", connection))
294                 .append(format("Supported protocols: %s%n", protocols)).toString();
295     }
296
297     public static class FeMonitoringConfig {
298
299         Boolean enabled;
300         Boolean isProxy;
301         Integer probeIntervalInSeconds;
302
303         public Boolean getEnabled() {
304             return enabled;
305         }
306
307         public void setEnabled(Boolean enabled) {
308             this.enabled = enabled;
309         }
310
311         public Boolean getIsProxy() {
312             return isProxy;
313         }
314
315         public void setIsProxy(Boolean isProxy) {
316             this.isProxy = isProxy;
317         }
318
319         public Integer getProbeIntervalInSeconds() {
320             return probeIntervalInSeconds;
321         }
322
323         public void setProbeIntervalInSeconds(Integer probeIntervalInSeconds) {
324             this.probeIntervalInSeconds = probeIntervalInSeconds;
325         }
326
327         public Integer getProbeIntervalInSeconds(int defaultVal) {
328             return probeIntervalInSeconds == null ? defaultVal : probeIntervalInSeconds;
329         }
330     }
331
332     public static class OnboardingConfig {
333
334         String protocol = "http";
335         String host;
336         Integer port;
337         String healthCheckUri;
338
339         public String getProtocol() {
340             return protocol;
341         }
342
343         public void setProtocol(String protocol) {
344             this.protocol = protocol;
345         }
346
347         public String getHost() {
348             return host;
349         }
350
351         public void setHost(String host) {
352             this.host = host;
353         }
354
355         public Integer getPort() {
356             return port;
357         }
358
359         public void setPort(Integer port) {
360             this.port = port;
361         }
362
363         public String getHealthCheckUri() {
364             return healthCheckUri;
365         }
366
367         public void setHealthCheckUri(String healthCheckUri) {
368             this.healthCheckUri = healthCheckUri;
369         }
370     }
371
372     public static class DcaeConfig {
373
374         String protocol = "http";
375         String host;
376         Integer port;
377         String healthCheckUri;
378
379         public String getProtocol() {
380             return protocol;
381         }
382
383         public void setProtocol(String protocol) {
384             this.protocol = protocol;
385         }
386
387         public String getHost() {
388             return host;
389         }
390
391         public void setHost(String host) {
392             this.host = host;
393         }
394
395         public Integer getPort() {
396             return port;
397         }
398
399         public void setPort(Integer port) {
400             this.port = port;
401         }
402
403         public String getHealthCheckUri() {
404             return healthCheckUri;
405         }
406
407         public void setHealthCheckUri(String healthCheckUri) {
408             this.healthCheckUri = healthCheckUri;
409         }
410     }
411
412     public List<String> getHealthStatusExclude() {
413         return healthStatusExclude;
414     }
415
416     public void setHealthStatusExclude(List<String> healthStatusExclude) {
417         this.healthStatusExclude = healthStatusExclude;
418     }
419
420 }