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 String getOnboardingForwardContext() {
262 return onboardingForwardContext;
265 public void setOnboardingForwardContext(String onboardingForwardContext) {
266 this.onboardingForwardContext = onboardingForwardContext;
269 public OnboardingConfig getOnboarding() {
273 public void setOnboarding(OnboardingConfig onboarding) {
274 this.onboarding = onboarding;
277 public DcaeConfig getDcae() {
281 public void setDcae(DcaeConfig dcae) {
286 public String toString() {
287 return new StringBuilder().append(format("backend host: %s%n", beHost))
288 .append(format("backend http port: %s%n", beHttpPort))
289 .append(format("backend ssl port: %s%n", beSslPort)).append(format("backend context: %s%n", beContext))
290 .append(format("backend protocol: %s%n", beProtocol))
291 .append(format("onboarding forward context: %s%n", onboardingForwardContext))
292 .append(format("Version: %s%n", version)).append(format("Released: %s%n", released))
293 .append(format("Connecting to database: %s%n", connection))
294 .append(format("Supported protocols: %s%n", protocols)).toString();
297 public static class FeMonitoringConfig {
301 Integer probeIntervalInSeconds;
303 public Boolean getEnabled() {
307 public void setEnabled(Boolean enabled) {
308 this.enabled = enabled;
311 public Boolean getIsProxy() {
315 public void setIsProxy(Boolean isProxy) {
316 this.isProxy = isProxy;
319 public Integer getProbeIntervalInSeconds() {
320 return probeIntervalInSeconds;
323 public void setProbeIntervalInSeconds(Integer probeIntervalInSeconds) {
324 this.probeIntervalInSeconds = probeIntervalInSeconds;
327 public Integer getProbeIntervalInSeconds(int defaultVal) {
328 return probeIntervalInSeconds == null ? defaultVal : probeIntervalInSeconds;
332 public static class OnboardingConfig {
334 String protocol = "http";
337 String healthCheckUri;
339 public String getProtocol() {
343 public void setProtocol(String protocol) {
344 this.protocol = protocol;
347 public String getHost() {
351 public void setHost(String host) {
355 public Integer getPort() {
359 public void setPort(Integer port) {
363 public String getHealthCheckUri() {
364 return healthCheckUri;
367 public void setHealthCheckUri(String healthCheckUri) {
368 this.healthCheckUri = healthCheckUri;
372 public static class DcaeConfig {
374 String protocol = "http";
377 String healthCheckUri;
379 public String getProtocol() {
383 public void setProtocol(String protocol) {
384 this.protocol = protocol;
387 public String getHost() {
391 public void setHost(String host) {
395 public Integer getPort() {
399 public void setPort(Integer port) {
403 public String getHealthCheckUri() {
404 return healthCheckUri;
407 public void setHealthCheckUri(String healthCheckUri) {
408 this.healthCheckUri = healthCheckUri;
412 public List<String> getHealthStatusExclude() {
413 return healthStatusExclude;
416 public void setHealthStatusExclude(List<String> healthStatusExclude) {
417 this.healthStatusExclude = healthStatusExclude;