Create on boarding docker
[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 OnboardingConfig getOnboarding() {
262         return onboarding;
263     }
264
265     public void setOnboarding(OnboardingConfig onboarding) {
266         this.onboarding = onboarding;
267     }
268
269     public DcaeConfig getDcae() {
270         return dcae;
271     }
272
273     public void setDcae(DcaeConfig dcae) {
274         this.dcae = dcae;
275     }
276
277     @Override
278     public String toString() {
279         return new StringBuilder().append(format("backend host: %s%n", beHost))
280                 .append(format("backend http port: %s%n", beHttpPort))
281                 .append(format("backend ssl port: %s%n", beSslPort)).append(format("backend context: %s%n", beContext))
282                 .append(format("backend protocol: %s%n", beProtocol))
283                 .append(format("onboarding forward context: %s%n", onboardingForwardContext))
284                 .append(format("Version: %s%n", version)).append(format("Released: %s%n", released))
285                 .append(format("Connecting to database: %s%n", connection))
286                 .append(format("Supported protocols: %s%n", protocols)).toString();
287     }
288
289     public static class FeMonitoringConfig {
290
291         Boolean enabled;
292         Boolean isProxy;
293         Integer probeIntervalInSeconds;
294
295         public Boolean getEnabled() {
296             return enabled;
297         }
298
299         public void setEnabled(Boolean enabled) {
300             this.enabled = enabled;
301         }
302
303         public Boolean getIsProxy() {
304             return isProxy;
305         }
306
307         public void setIsProxy(Boolean isProxy) {
308             this.isProxy = isProxy;
309         }
310
311         public Integer getProbeIntervalInSeconds() {
312             return probeIntervalInSeconds;
313         }
314
315         public void setProbeIntervalInSeconds(Integer probeIntervalInSeconds) {
316             this.probeIntervalInSeconds = probeIntervalInSeconds;
317         }
318
319         public Integer getProbeIntervalInSeconds(int defaultVal) {
320             return probeIntervalInSeconds == null ? defaultVal : probeIntervalInSeconds;
321         }
322     }
323
324     public static class OnboardingConfig {
325         String protocolFe = "http";
326         String hostFe;
327         Integer portFe;
328         String protocolBe = "http";
329         String hostBe;
330         Integer portBe;
331         String healthCheckUriFe;
332
333         public String getProtocolFe() {
334             return protocolFe;
335         }
336
337         public void setProtocolFe(String protocolFe) {
338             this.protocolFe = protocolFe;
339         }
340
341         public String getProtocolBe() {
342             return protocolBe;
343         }
344
345         public void setProtocolBe(String protocolBe) {
346             this.protocolBe = protocolBe;
347         }
348
349         public String getHostFe() {
350             return hostFe;
351         }
352
353         public void setHostFe(String hostFe) {
354             this.hostFe = hostFe;
355         }
356
357         public String getHostBe() {
358             return hostBe;
359         }
360
361         public void setHostBe(String hostBe) {
362             this.hostBe = hostBe;
363         }
364
365         public Integer getPortFe() {
366             return portFe;
367         }
368
369         public void setPortFe(Integer portFe) {
370             this.portFe = portFe;
371         }
372
373         public Integer getPortBe() {
374             return portBe;
375         }
376
377         public void setPortBe(Integer portBe) {
378             this.portBe = portBe;
379         }
380
381         public String getHealthCheckUriFe() {
382             return healthCheckUriFe;
383         }
384
385         public void setHealthCheckUriFe(String healthCheckUriFe) {
386             this.healthCheckUriFe = healthCheckUriFe;
387         }
388     }
389
390     public static class DcaeConfig {
391
392         String protocol = "http";
393         String host;
394         Integer port;
395         String healthCheckUri;
396
397         public String getProtocol() {
398             return protocol;
399         }
400
401         public void setProtocol(String protocol) {
402             this.protocol = protocol;
403         }
404
405         public String getHost() {
406             return host;
407         }
408
409         public void setHost(String host) {
410             this.host = host;
411         }
412
413         public Integer getPort() {
414             return port;
415         }
416
417         public void setPort(Integer port) {
418             this.port = port;
419         }
420
421         public String getHealthCheckUri() {
422             return healthCheckUri;
423         }
424
425         public void setHealthCheckUri(String healthCheckUri) {
426             this.healthCheckUri = healthCheckUri;
427         }
428     }
429
430     public List<String> getHealthStatusExclude() {
431         return healthStatusExclude;
432     }
433
434     public void setHealthStatusExclude(List<String> healthStatusExclude) {
435         this.healthStatusExclude = healthStatusExclude;
436     }
437
438 }