Catalog alignment
[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 DcaeConfig dcae;
61
62     private CookieConfig authCookie;
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 DcaeConfig getDcae() {
253         return dcae;
254     }
255
256     public void setDcae(DcaeConfig dcae) {
257         this.dcae = dcae;
258     }
259
260     public CookieConfig getAuthCookie() {
261         return authCookie;
262     }
263
264     public void setAuthCookie(CookieConfig authCookie) {
265         this.authCookie = authCookie;
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 DcaeConfig {
382
383         String protocol = "http";
384         String host;
385         Integer port;
386         String healthCheckUri;
387
388         public String getProtocol() {
389             return protocol;
390         }
391
392         public void setProtocol(String protocol) {
393             this.protocol = protocol;
394         }
395
396         public String getHost() {
397             return host;
398         }
399
400         public void setHost(String host) {
401             this.host = host;
402         }
403
404         public Integer getPort() {
405             return port;
406         }
407
408         public void setPort(Integer port) {
409             this.port = port;
410         }
411
412         public String getHealthCheckUri() {
413             return healthCheckUri;
414         }
415
416         public void setHealthCheckUri(String healthCheckUri) {
417             this.healthCheckUri = healthCheckUri;
418         }
419     }
420
421     public static class CookieConfig {
422         String cookieName = "AuthenticationCookie";
423         String path = "";
424         String domain = "";
425         String securityKey = "";
426
427         public String getPath() {
428             return path;
429         }
430
431         public void setPath(String path) {
432             this.path = path;
433         }
434
435         public String getDomain() {
436             return domain;
437         }
438
439         public void setDomain(String domain) {
440             this.domain = domain;
441         }
442
443         public String getSecurityKey() {return securityKey;
444         }
445
446         public void setSecurityKey(String securityKey) {
447             this.securityKey = securityKey;
448         }
449
450         public String getCookieName() {
451             return cookieName;
452         }
453
454         public void setCookieName(String cookieName) {
455             this.cookieName = cookieName;
456         }
457     }
458
459     public static class CatalogFacadeMsConfig {
460         String protocol;
461         String host;
462         Integer port;
463         String healthCheckUri;
464         String path;
465
466         public void setProtocol(String protocol) {
467             this.protocol = protocol;
468         }
469
470         public void setHost(String host) {
471             this.host = host;
472         }
473
474         public void setPort(Integer port) {
475             this.port = port;
476         }
477
478         public void setHealthCheckUri(String healthCheckUri) {
479             this.healthCheckUri = healthCheckUri;
480         }
481
482         public void setPath(String path) {
483             this.path = path;
484         }
485
486         public String getProtocol() {
487             return protocol;
488         }
489
490         public String getHost() {
491             return host;
492         }
493
494         public Integer getPort() {
495             return port;
496         }
497
498         public String getHealthCheckUri() {
499             return healthCheckUri;
500         }
501
502         public String getPath() {
503             return path;
504         }
505
506
507     }
508
509     public List<String> getHealthStatusExclude() {
510         return healthStatusExclude;
511     }
512
513     public void setHealthStatusExclude(List<String> healthStatusExclude) {
514         this.healthStatusExclude = healthStatusExclude;
515     }
516
517 }