Remove unused dcae-be healthcheck
[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 onboardingForwardContext;
57
58     private OnboardingConfig onboarding;
59
60     private CookieConfig authCookie;
61
62     private BasicAuthConfig basicAuth;
63
64     private CatalogFacadeMsConfig catalogFacadeMs;
65     /**
66      * be http context
67      */
68     private String beContext;
69     /**
70      * backend protocol. http | https
71      */
72     private String beProtocol = "http";
73     private Date released;
74     private String version = "1111";
75     private Connection connection;
76     private List<String> protocols;
77     private int threadpoolSize;
78     private int requestTimeout;
79     private List<List<String>> identificationHeaderFields;
80     private List<List<String>> optionalHeaderFields;
81
82     private List<String> forwardHeaderFields;
83
84     public CatalogFacadeMsConfig getCatalogFacadeMs() {
85         return catalogFacadeMs;
86     }
87
88     public void setCatalogFacadeMs(CatalogFacadeMsConfig catalogFacadeMs) {
89         this.catalogFacadeMs = catalogFacadeMs;
90     }
91
92     public FeMonitoringConfig getSystemMonitoring() {
93         return systemMonitoring;
94     }
95
96     public void setSystemMonitoring(FeMonitoringConfig systemMonitoring) {
97         this.systemMonitoring = systemMonitoring;
98     }
99
100     public Integer getHealthCheckSocketTimeoutInMs() {
101         return healthCheckSocketTimeoutInMs;
102     }
103
104     public void setHealthCheckSocketTimeoutInMs(Integer healthCheckSocketTimeout) {
105         this.healthCheckSocketTimeoutInMs = healthCheckSocketTimeout;
106     }
107
108     public Integer getHealthCheckSocketTimeoutInMs(int defaultVal) {
109         return healthCheckSocketTimeoutInMs == null ? defaultVal : healthCheckSocketTimeoutInMs;
110     }
111
112     public Integer getHealthCheckIntervalInSeconds() {
113         return healthCheckIntervalInSeconds;
114     }
115
116     public void setHealthCheckIntervalInSeconds(Integer healthCheckInterval) {
117         this.healthCheckIntervalInSeconds = healthCheckInterval;
118     }
119
120     public Integer getHealthCheckIntervalInSeconds(int defaultVal) {
121         return healthCheckIntervalInSeconds == null ? defaultVal : healthCheckIntervalInSeconds;
122     }
123
124     public Date getReleased() {
125         return released;
126     }
127
128     public void setReleased(Date released) {
129         this.released = released;
130     }
131
132     public String getVersion() {
133         return version;
134     }
135
136     public void setVersion(String version) {
137         this.version = version;
138     }
139
140     public Connection getConnection() {
141         return connection;
142     }
143
144     public void setConnection(Connection connection) {
145         this.connection = connection;
146     }
147
148     public List<String> getProtocols() {
149         return protocols;
150     }
151
152     public void setProtocols(List<String> protocols) {
153         this.protocols = protocols;
154     }
155
156     public String getBeHost() {
157         return beHost;
158     }
159
160     public void setBeHost(String beHost) {
161         this.beHost = beHost;
162     }
163
164     public Integer getBeHttpPort() {
165         return beHttpPort;
166     }
167
168     public void setBeHttpPort(Integer beHttpPort) {
169         this.beHttpPort = beHttpPort;
170     }
171
172     public Integer getBeSslPort() {
173         return beSslPort;
174     }
175
176     public void setBeSslPort(Integer beSslPort) {
177         this.beSslPort = beSslPort;
178     }
179
180     public String getBeContext() {
181         return beContext;
182     }
183
184     public void setBeContext(String beContext) {
185         this.beContext = beContext;
186     }
187
188     public String getBeProtocol() {
189         return beProtocol;
190     }
191
192     public void setBeProtocol(String beProtocol) {
193         this.beProtocol = beProtocol;
194     }
195
196     public int getThreadpoolSize() {
197         return threadpoolSize;
198     }
199
200     public void setThreadpoolSize(int threadpoolSize) {
201         this.threadpoolSize = threadpoolSize;
202     }
203
204     public int getRequestTimeout() {
205         return requestTimeout;
206     }
207
208     public void setRequestTimeout(int requestTimeout) {
209         this.requestTimeout = requestTimeout;
210     }
211
212     public List<List<String>> getIdentificationHeaderFields() {
213         return identificationHeaderFields;
214     }
215
216     public void setIdentificationHeaderFields(List<List<String>> identificationHeaderFields) {
217         this.identificationHeaderFields = identificationHeaderFields;
218     }
219
220     public List<List<String>> getOptionalHeaderFields() {
221         return optionalHeaderFields;
222     }
223
224     public void setOptionalHeaderFields(List<List<String>> optionalHeaderFields) {
225         this.optionalHeaderFields = optionalHeaderFields;
226     }
227
228     public List<String> getForwardHeaderFields() {
229         return forwardHeaderFields;
230     }
231
232     public void setForwardHeaderFields(List<String> forwardHeaderFields) {
233         this.forwardHeaderFields = forwardHeaderFields;
234     }
235
236     public String getFeFqdn() {
237         return feFqdn;
238     }
239
240     public void setFeFqdn(String feFqdn) {
241         this.feFqdn = feFqdn;
242     }
243
244     public OnboardingConfig getOnboarding() {
245         return onboarding;
246     }
247
248     public void setOnboarding(OnboardingConfig onboarding) {
249         this.onboarding = onboarding;
250     }
251
252     public CookieConfig getAuthCookie() {
253         return authCookie;
254     }
255
256     public void setAuthCookie(CookieConfig authCookie) {
257         this.authCookie = authCookie;
258     }
259
260     public BasicAuthConfig getBasicAuth() {
261         return basicAuth;
262     }
263
264     public void setBasicAuth(BasicAuthConfig basicAuth) {
265         this.basicAuth = basicAuth;
266     }
267
268     @Override
269     public String toString() {
270         return new StringBuilder().append(format("backend host: %s%n", beHost))
271                 .append(format("backend http port: %s%n", beHttpPort))
272                 .append(format("backend ssl port: %s%n", beSslPort)).append(format("backend context: %s%n", beContext))
273                 .append(format("backend protocol: %s%n", beProtocol))
274                 .append(format("onboarding forward context: %s%n", onboardingForwardContext))
275                 .append(format("Version: %s%n", version)).append(format("Released: %s%n", released))
276                 .append(format("Connecting to database: %s%n", connection))
277                 .append(format("Supported protocols: %s%n", protocols)).toString();
278     }
279
280     public static class FeMonitoringConfig {
281
282         Boolean enabled;
283         Boolean isProxy;
284         Integer probeIntervalInSeconds;
285
286         public Boolean getEnabled() {
287             return enabled;
288         }
289
290         public void setEnabled(Boolean enabled) {
291             this.enabled = enabled;
292         }
293
294         public Boolean getIsProxy() {
295             return isProxy;
296         }
297
298         public void setIsProxy(Boolean isProxy) {
299             this.isProxy = isProxy;
300         }
301
302         public Integer getProbeIntervalInSeconds() {
303             return probeIntervalInSeconds;
304         }
305
306         public void setProbeIntervalInSeconds(Integer probeIntervalInSeconds) {
307             this.probeIntervalInSeconds = probeIntervalInSeconds;
308         }
309
310         public Integer getProbeIntervalInSeconds(int defaultVal) {
311             return probeIntervalInSeconds == null ? defaultVal : probeIntervalInSeconds;
312         }
313     }
314
315     public static class OnboardingConfig {
316         String protocolFe = "http";
317         String hostFe;
318         Integer portFe;
319         String protocolBe = "http";
320         String hostBe;
321         Integer portBe;
322         String healthCheckUriFe;
323
324         public String getProtocolFe() {
325             return protocolFe;
326         }
327
328         public void setProtocolFe(String protocolFe) {
329             this.protocolFe = protocolFe;
330         }
331
332         public String getProtocolBe() {
333             return protocolBe;
334         }
335
336         public void setProtocolBe(String protocolBe) {
337             this.protocolBe = protocolBe;
338         }
339
340         public String getHostFe() {
341             return hostFe;
342         }
343
344         public void setHostFe(String hostFe) {
345             this.hostFe = hostFe;
346         }
347
348         public String getHostBe() {
349             return hostBe;
350         }
351
352         public void setHostBe(String hostBe) {
353             this.hostBe = hostBe;
354         }
355
356         public Integer getPortFe() {
357             return portFe;
358         }
359
360         public void setPortFe(Integer portFe) {
361             this.portFe = portFe;
362         }
363
364         public Integer getPortBe() {
365             return portBe;
366         }
367
368         public void setPortBe(Integer portBe) {
369             this.portBe = portBe;
370         }
371
372         public String getHealthCheckUriFe() {
373             return healthCheckUriFe;
374         }
375
376         public void setHealthCheckUriFe(String healthCheckUriFe) {
377             this.healthCheckUriFe = healthCheckUriFe;
378         }
379     }
380
381     public static class CookieConfig {
382         String cookieName = "AuthenticationCookie";
383         String path = "";
384         String domain = "";
385         String securityKey = "";
386
387         public String getPath() {
388             return path;
389         }
390
391         public void setPath(String path) {
392             this.path = path;
393         }
394
395         public String getDomain() {
396             return domain;
397         }
398
399         public void setDomain(String domain) {
400             this.domain = domain;
401         }
402
403         public String getSecurityKey() {return securityKey;
404         }
405
406         public void setSecurityKey(String securityKey) {
407             this.securityKey = securityKey;
408         }
409
410         public String getCookieName() {
411             return cookieName;
412         }
413
414         public void setCookieName(String cookieName) {
415             this.cookieName = cookieName;
416         }
417     }
418
419     public static class BasicAuthConfig {
420         boolean enabled = false;
421         String userName = "";
422         String userPass = "";
423
424         public boolean getEnabled() {
425             return enabled;
426         }
427
428         public void setEnabled(boolean enabled) {
429             this.enabled = enabled;
430         }
431
432         public String getUserName() {
433             return userName;
434         }
435
436         public void setUserName(String userName) {
437             this.userName = userName;
438         }
439
440         public String getUserPass() {return userPass;
441         }
442
443         public void setUserPass(String userPass) {
444             this.userPass = userPass;
445         }
446
447     }
448
449     public static class CatalogFacadeMsConfig {
450         String protocol;
451         String host;
452         Integer port;
453         String healthCheckUri;
454         String path;
455
456         public void setProtocol(String protocol) {
457             this.protocol = protocol;
458         }
459
460         public void setHost(String host) {
461             this.host = host;
462         }
463
464         public void setPort(Integer port) {
465             this.port = port;
466         }
467
468         public void setHealthCheckUri(String healthCheckUri) {
469             this.healthCheckUri = healthCheckUri;
470         }
471
472         public void setPath(String path) {
473             this.path = path;
474         }
475
476         public String getProtocol() {
477             return protocol;
478         }
479
480         public String getHost() {
481             return host;
482         }
483
484         public Integer getPort() {
485             return port;
486         }
487
488         public String getHealthCheckUri() {
489             return healthCheckUri;
490         }
491
492         public String getPath() {
493             return path;
494         }
495
496
497     }
498
499     public List<String> getHealthStatusExclude() {
500         return healthStatusExclude;
501     }
502
503     public void setHealthStatusExclude(List<String> healthStatusExclude) {
504         this.healthStatusExclude = healthStatusExclude;
505     }
506
507 }