2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.openecomp.sdc.fe.config;
23 import org.openecomp.sdc.common.api.BasicConfiguration;
25 import java.util.Date;
26 import java.util.List;
28 import static java.lang.String.format;
30 public class Configuration extends BasicConfiguration {
34 private String feFqdn;
38 private String beHost;
42 private Integer beHttpPort;
44 * backend http secured port
46 private Integer beSslPort;
48 private Integer healthCheckSocketTimeoutInMs;
50 private Integer healthCheckIntervalInSeconds;
52 private List<String> healthStatusExclude;
54 private FeMonitoringConfig systemMonitoring;
56 private String onboardingForwardContext;
58 private OnboardingConfig onboarding;
60 private DcaeConfig dcae;
62 private CookieConfig authCookie;
64 private CatalogFacadeMsConfig catalogFacadeMs;
68 private String beContext;
70 * backend protocol. http | https
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;
82 private List<String> forwardHeaderFields;
84 public CatalogFacadeMsConfig getCatalogFacadeMs() {
85 return catalogFacadeMs;
88 public void setCatalogFacadeMs(CatalogFacadeMsConfig catalogFacadeMs) {
89 this.catalogFacadeMs = catalogFacadeMs;
92 public FeMonitoringConfig getSystemMonitoring() {
93 return systemMonitoring;
96 public void setSystemMonitoring(FeMonitoringConfig systemMonitoring) {
97 this.systemMonitoring = systemMonitoring;
100 public Integer getHealthCheckSocketTimeoutInMs() {
101 return healthCheckSocketTimeoutInMs;
104 public void setHealthCheckSocketTimeoutInMs(Integer healthCheckSocketTimeout) {
105 this.healthCheckSocketTimeoutInMs = healthCheckSocketTimeout;
108 public Integer getHealthCheckSocketTimeoutInMs(int defaultVal) {
109 return healthCheckSocketTimeoutInMs == null ? defaultVal : healthCheckSocketTimeoutInMs;
112 public Integer getHealthCheckIntervalInSeconds() {
113 return healthCheckIntervalInSeconds;
116 public void setHealthCheckIntervalInSeconds(Integer healthCheckInterval) {
117 this.healthCheckIntervalInSeconds = healthCheckInterval;
120 public Integer getHealthCheckIntervalInSeconds(int defaultVal) {
121 return healthCheckIntervalInSeconds == null ? defaultVal : healthCheckIntervalInSeconds;
124 public Date getReleased() {
128 public void setReleased(Date released) {
129 this.released = released;
132 public String getVersion() {
136 public void setVersion(String version) {
137 this.version = version;
140 public Connection getConnection() {
144 public void setConnection(Connection connection) {
145 this.connection = connection;
148 public List<String> getProtocols() {
152 public void setProtocols(List<String> protocols) {
153 this.protocols = protocols;
156 public String getBeHost() {
160 public void setBeHost(String beHost) {
161 this.beHost = beHost;
164 public Integer getBeHttpPort() {
168 public void setBeHttpPort(Integer beHttpPort) {
169 this.beHttpPort = beHttpPort;
172 public Integer getBeSslPort() {
176 public void setBeSslPort(Integer beSslPort) {
177 this.beSslPort = beSslPort;
180 public String getBeContext() {
184 public void setBeContext(String beContext) {
185 this.beContext = beContext;
188 public String getBeProtocol() {
192 public void setBeProtocol(String beProtocol) {
193 this.beProtocol = beProtocol;
196 public int getThreadpoolSize() {
197 return threadpoolSize;
200 public void setThreadpoolSize(int threadpoolSize) {
201 this.threadpoolSize = threadpoolSize;
204 public int getRequestTimeout() {
205 return requestTimeout;
208 public void setRequestTimeout(int requestTimeout) {
209 this.requestTimeout = requestTimeout;
212 public List<List<String>> getIdentificationHeaderFields() {
213 return identificationHeaderFields;
216 public void setIdentificationHeaderFields(List<List<String>> identificationHeaderFields) {
217 this.identificationHeaderFields = identificationHeaderFields;
220 public List<List<String>> getOptionalHeaderFields() {
221 return optionalHeaderFields;
224 public void setOptionalHeaderFields(List<List<String>> optionalHeaderFields) {
225 this.optionalHeaderFields = optionalHeaderFields;
228 public List<String> getForwardHeaderFields() {
229 return forwardHeaderFields;
232 public void setForwardHeaderFields(List<String> forwardHeaderFields) {
233 this.forwardHeaderFields = forwardHeaderFields;
236 public String getFeFqdn() {
240 public void setFeFqdn(String feFqdn) {
241 this.feFqdn = feFqdn;
244 public OnboardingConfig getOnboarding() {
248 public void setOnboarding(OnboardingConfig onboarding) {
249 this.onboarding = onboarding;
252 public DcaeConfig getDcae() {
256 public void setDcae(DcaeConfig dcae) {
260 public CookieConfig getAuthCookie() {
264 public void setAuthCookie(CookieConfig authCookie) {
265 this.authCookie = authCookie;
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();
280 public static class FeMonitoringConfig {
284 Integer probeIntervalInSeconds;
286 public Boolean getEnabled() {
290 public void setEnabled(Boolean enabled) {
291 this.enabled = enabled;
294 public Boolean getIsProxy() {
298 public void setIsProxy(Boolean isProxy) {
299 this.isProxy = isProxy;
302 public Integer getProbeIntervalInSeconds() {
303 return probeIntervalInSeconds;
306 public void setProbeIntervalInSeconds(Integer probeIntervalInSeconds) {
307 this.probeIntervalInSeconds = probeIntervalInSeconds;
310 public Integer getProbeIntervalInSeconds(int defaultVal) {
311 return probeIntervalInSeconds == null ? defaultVal : probeIntervalInSeconds;
315 public static class OnboardingConfig {
316 String protocolFe = "http";
319 String protocolBe = "http";
322 String healthCheckUriFe;
324 public String getProtocolFe() {
328 public void setProtocolFe(String protocolFe) {
329 this.protocolFe = protocolFe;
332 public String getProtocolBe() {
336 public void setProtocolBe(String protocolBe) {
337 this.protocolBe = protocolBe;
340 public String getHostFe() {
344 public void setHostFe(String hostFe) {
345 this.hostFe = hostFe;
348 public String getHostBe() {
352 public void setHostBe(String hostBe) {
353 this.hostBe = hostBe;
356 public Integer getPortFe() {
360 public void setPortFe(Integer portFe) {
361 this.portFe = portFe;
364 public Integer getPortBe() {
368 public void setPortBe(Integer portBe) {
369 this.portBe = portBe;
372 public String getHealthCheckUriFe() {
373 return healthCheckUriFe;
376 public void setHealthCheckUriFe(String healthCheckUriFe) {
377 this.healthCheckUriFe = healthCheckUriFe;
381 public static class DcaeConfig {
383 String protocol = "http";
386 String healthCheckUri;
388 public String getProtocol() {
392 public void setProtocol(String protocol) {
393 this.protocol = protocol;
396 public String getHost() {
400 public void setHost(String host) {
404 public Integer getPort() {
408 public void setPort(Integer port) {
412 public String getHealthCheckUri() {
413 return healthCheckUri;
416 public void setHealthCheckUri(String healthCheckUri) {
417 this.healthCheckUri = healthCheckUri;
421 public static class CookieConfig {
422 String cookieName = "AuthenticationCookie";
425 String securityKey = "";
427 public String getPath() {
431 public void setPath(String path) {
435 public String getDomain() {
439 public void setDomain(String domain) {
440 this.domain = domain;
443 public String getSecurityKey() {return securityKey;
446 public void setSecurityKey(String securityKey) {
447 this.securityKey = securityKey;
450 public String getCookieName() {
454 public void setCookieName(String cookieName) {
455 this.cookieName = cookieName;
459 public static class CatalogFacadeMsConfig {
463 String healthCheckUri;
466 public void setProtocol(String protocol) {
467 this.protocol = protocol;
470 public void setHost(String host) {
474 public void setPort(Integer port) {
478 public void setHealthCheckUri(String healthCheckUri) {
479 this.healthCheckUri = healthCheckUri;
482 public void setPath(String path) {
486 public String getProtocol() {
490 public String getHost() {
494 public Integer getPort() {
498 public String getHealthCheckUri() {
499 return healthCheckUri;
502 public String getPath() {
509 public List<String> getHealthStatusExclude() {
510 return healthStatusExclude;
513 public void setHealthStatusExclude(List<String> healthStatusExclude) {
514 this.healthStatusExclude = healthStatusExclude;