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 kibanaHost;
58 private Integer kibanaPort;
60 private String kibanaProtocol;
62 private String onboardingForwardContext;
64 private OnboardingConfig onboarding;
66 private DcaeConfig dcae;
70 private String beContext;
72 * backend protocol. http | https
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;
85 public String getKibanaProtocol() {
86 return kibanaProtocol;
89 public void setKibanaProtocol(String kibanaProtocol) {
90 this.kibanaProtocol = kibanaProtocol;
93 public String getKibanaHost() {
97 public void setKibanaHost(String kibanaHost) {
98 this.kibanaHost = kibanaHost;
101 public Integer getKibanaPort() {
105 public void setKibanaPort(Integer kibanaPort) {
106 this.kibanaPort = kibanaPort;
109 public FeMonitoringConfig getSystemMonitoring() {
110 return systemMonitoring;
113 public void setSystemMonitoring(FeMonitoringConfig systemMonitoring) {
114 this.systemMonitoring = systemMonitoring;
117 public Integer getHealthCheckSocketTimeoutInMs() {
118 return healthCheckSocketTimeoutInMs;
121 public void setHealthCheckSocketTimeoutInMs(Integer healthCheckSocketTimeout) {
122 this.healthCheckSocketTimeoutInMs = healthCheckSocketTimeout;
125 public Integer getHealthCheckSocketTimeoutInMs(int defaultVal) {
126 return healthCheckSocketTimeoutInMs == null ? defaultVal : healthCheckSocketTimeoutInMs;
129 public Integer getHealthCheckIntervalInSeconds() {
130 return healthCheckIntervalInSeconds;
133 public void setHealthCheckIntervalInSeconds(Integer healthCheckInterval) {
134 this.healthCheckIntervalInSeconds = healthCheckInterval;
137 public Integer getHealthCheckIntervalInSeconds(int defaultVal) {
138 return healthCheckIntervalInSeconds == null ? defaultVal : healthCheckIntervalInSeconds;
141 public Date getReleased() {
145 public void setReleased(Date released) {
146 this.released = released;
149 public String getVersion() {
153 public void setVersion(String version) {
154 this.version = version;
157 public Connection getConnection() {
161 public void setConnection(Connection connection) {
162 this.connection = connection;
165 public List<String> getProtocols() {
169 public void setProtocols(List<String> protocols) {
170 this.protocols = protocols;
173 public String getBeHost() {
177 public void setBeHost(String beHost) {
178 this.beHost = beHost;
181 public Integer getBeHttpPort() {
185 public void setBeHttpPort(Integer beHttpPort) {
186 this.beHttpPort = beHttpPort;
189 public Integer getBeSslPort() {
193 public void setBeSslPort(Integer beSslPort) {
194 this.beSslPort = beSslPort;
197 public String getBeContext() {
201 public void setBeContext(String beContext) {
202 this.beContext = beContext;
205 public String getBeProtocol() {
209 public void setBeProtocol(String beProtocol) {
210 this.beProtocol = beProtocol;
213 public int getThreadpoolSize() {
214 return threadpoolSize;
217 public void setThreadpoolSize(int threadpoolSize) {
218 this.threadpoolSize = threadpoolSize;
221 public int getRequestTimeout() {
222 return requestTimeout;
225 public void setRequestTimeout(int requestTimeout) {
226 this.requestTimeout = requestTimeout;
229 public List<List<String>> getIdentificationHeaderFields() {
230 return identificationHeaderFields;
233 public void setIdentificationHeaderFields(List<List<String>> identificationHeaderFields) {
234 this.identificationHeaderFields = identificationHeaderFields;
237 public List<List<String>> getOptionalHeaderFields() {
238 return optionalHeaderFields;
241 public void setOptionalHeaderFields(List<List<String>> optionalHeaderFields) {
242 this.optionalHeaderFields = optionalHeaderFields;
245 public List<String> getForwardHeaderFields() {
246 return forwardHeaderFields;
249 public void setForwardHeaderFields(List<String> forwardHeaderFields) {
250 this.forwardHeaderFields = forwardHeaderFields;
253 public String getFeFqdn() {
257 public void setFeFqdn(String feFqdn) {
258 this.feFqdn = feFqdn;
261 public OnboardingConfig getOnboarding() {
265 public void setOnboarding(OnboardingConfig onboarding) {
266 this.onboarding = onboarding;
269 public DcaeConfig getDcae() {
273 public void setDcae(DcaeConfig dcae) {
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();
289 public static class FeMonitoringConfig {
293 Integer probeIntervalInSeconds;
295 public Boolean getEnabled() {
299 public void setEnabled(Boolean enabled) {
300 this.enabled = enabled;
303 public Boolean getIsProxy() {
307 public void setIsProxy(Boolean isProxy) {
308 this.isProxy = isProxy;
311 public Integer getProbeIntervalInSeconds() {
312 return probeIntervalInSeconds;
315 public void setProbeIntervalInSeconds(Integer probeIntervalInSeconds) {
316 this.probeIntervalInSeconds = probeIntervalInSeconds;
319 public Integer getProbeIntervalInSeconds(int defaultVal) {
320 return probeIntervalInSeconds == null ? defaultVal : probeIntervalInSeconds;
324 public static class OnboardingConfig {
325 String protocolFe = "http";
328 String protocolBe = "http";
331 String healthCheckUriFe;
333 public String getProtocolFe() {
337 public void setProtocolFe(String protocolFe) {
338 this.protocolFe = protocolFe;
341 public String getProtocolBe() {
345 public void setProtocolBe(String protocolBe) {
346 this.protocolBe = protocolBe;
349 public String getHostFe() {
353 public void setHostFe(String hostFe) {
354 this.hostFe = hostFe;
357 public String getHostBe() {
361 public void setHostBe(String hostBe) {
362 this.hostBe = hostBe;
365 public Integer getPortFe() {
369 public void setPortFe(Integer portFe) {
370 this.portFe = portFe;
373 public Integer getPortBe() {
377 public void setPortBe(Integer portBe) {
378 this.portBe = portBe;
381 public String getHealthCheckUriFe() {
382 return healthCheckUriFe;
385 public void setHealthCheckUriFe(String healthCheckUriFe) {
386 this.healthCheckUriFe = healthCheckUriFe;
390 public static class DcaeConfig {
392 String protocol = "http";
395 String healthCheckUri;
397 public String getProtocol() {
401 public void setProtocol(String protocol) {
402 this.protocol = protocol;
405 public String getHost() {
409 public void setHost(String host) {
413 public Integer getPort() {
417 public void setPort(Integer port) {
421 public String getHealthCheckUri() {
422 return healthCheckUri;
425 public void setHealthCheckUri(String healthCheckUri) {
426 this.healthCheckUri = healthCheckUri;
430 public List<String> getHealthStatusExclude() {
431 return healthStatusExclude;
434 public void setHealthStatusExclude(List<String> healthStatusExclude) {
435 this.healthStatusExclude = healthStatusExclude;