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 CookieConfig authCookie;
62 private BasicAuthConfig basicAuth;
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 CookieConfig getAuthCookie() {
256 public void setAuthCookie(CookieConfig authCookie) {
257 this.authCookie = authCookie;
260 public BasicAuthConfig getBasicAuth() {
264 public void setBasicAuth(BasicAuthConfig basicAuth) {
265 this.basicAuth = basicAuth;
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 CookieConfig {
382 String cookieName = "AuthenticationCookie";
385 String securityKey = "";
387 public String getPath() {
391 public void setPath(String path) {
395 public String getDomain() {
399 public void setDomain(String domain) {
400 this.domain = domain;
403 public String getSecurityKey() {return securityKey;
406 public void setSecurityKey(String securityKey) {
407 this.securityKey = securityKey;
410 public String getCookieName() {
414 public void setCookieName(String cookieName) {
415 this.cookieName = cookieName;
419 public static class BasicAuthConfig {
420 boolean enabled = false;
421 String userName = "";
422 String userPass = "";
424 public boolean getEnabled() {
428 public void setEnabled(boolean enabled) {
429 this.enabled = enabled;
432 public String getUserName() {
436 public void setUserName(String userName) {
437 this.userName = userName;
440 public String getUserPass() {return userPass;
443 public void setUserPass(String userPass) {
444 this.userPass = userPass;
449 public static class CatalogFacadeMsConfig {
453 String healthCheckUri;
456 public void setProtocol(String protocol) {
457 this.protocol = protocol;
460 public void setHost(String host) {
464 public void setPort(Integer port) {
468 public void setHealthCheckUri(String healthCheckUri) {
469 this.healthCheckUri = healthCheckUri;
472 public void setPath(String path) {
476 public String getProtocol() {
480 public String getHost() {
484 public Integer getPort() {
488 public String getHealthCheckUri() {
489 return healthCheckUri;
492 public String getPath() {
499 public List<String> getHealthStatusExclude() {
500 return healthStatusExclude;
503 public void setHealthStatusExclude(List<String> healthStatusExclude) {
504 this.healthStatusExclude = healthStatusExclude;