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=========================================================
20 package org.openecomp.sdc.fe.config;
22 import static java.lang.String.format;
24 import java.util.Date;
25 import java.util.List;
27 import lombok.NoArgsConstructor;
29 import org.openecomp.sdc.common.api.BasicConfiguration;
34 public class Configuration extends BasicConfiguration {
39 private String feFqdn;
43 private String beHost;
47 private Integer beHttpPort;
49 * backend http secured port
51 private Integer beSslPort;
52 private Integer healthCheckSocketTimeoutInMs;
53 private Integer healthCheckIntervalInSeconds;
54 private List<String> healthStatusExclude;
55 private FeMonitoringConfig systemMonitoring;
56 private String onboardingForwardContext;
57 private OnboardingConfig onboarding;
58 private CookieConfig authCookie;
59 private BasicAuthConfig basicAuth;
60 private CatalogFacadeMsConfig catalogFacadeMs;
64 private String beContext;
66 * backend protocol. http | https
68 private String beProtocol = "http";
69 private Date released;
70 private String version = "1111";
71 private Connection connection;
72 private List<String> protocols;
73 private int threadpoolSize;
74 private int requestTimeout;
75 private List<List<String>> identificationHeaderFields;
76 private List<List<String>> optionalHeaderFields;
77 private List<String> forwardHeaderFields;
78 private String dataValidatorFilterExcludedUrls; // Comma separated list of excluded URLs by the DataValidatorFilter
79 private String permittedAncestors; // Space separated list of permitted ancestors
81 public Integer getHealthCheckSocketTimeoutInMs(int defaultVal) {
82 return healthCheckSocketTimeoutInMs == null ? defaultVal : healthCheckSocketTimeoutInMs;
85 public Integer getHealthCheckIntervalInSeconds(int defaultVal) {
86 return healthCheckIntervalInSeconds == null ? defaultVal : healthCheckIntervalInSeconds;
90 public String toString() {
91 return new StringBuilder().append(format("backend host: %s%n", beHost)).append(format("backend http port: %s%n", beHttpPort))
92 .append(format("backend ssl port: %s%n", beSslPort)).append(format("backend context: %s%n", beContext))
93 .append(format("backend protocol: %s%n", beProtocol)).append(format("onboarding forward context: %s%n", onboardingForwardContext))
94 .append(format("Version: %s%n", version)).append(format("Released: %s%n", released))
95 .append(format("Connecting to database: %s%n", connection)).append(format("Supported protocols: %s%n", protocols)).toString();
101 public static class FeMonitoringConfig {
103 private Boolean enabled;
104 private Boolean isProxy;
105 private Integer probeIntervalInSeconds;
107 public Integer getProbeIntervalInSeconds(int defaultVal) {
108 return probeIntervalInSeconds == null ? defaultVal : probeIntervalInSeconds;
115 public static class OnboardingConfig {
117 private String protocolFe = "http";
118 private String hostFe;
119 private Integer portFe;
120 private String protocolBe = "http";
121 private String hostBe;
122 private Integer portBe;
123 private String healthCheckUriFe;
129 public static class CookieConfig {
131 private String cookieName = "AuthenticationCookie";
132 private String path = "";
133 private String domain = "";
134 private String securityKey = "";
140 public static class BasicAuthConfig {
142 private boolean enabled = false;
143 private String userName = "";
144 private String userPass = "";
150 public static class CatalogFacadeMsConfig {
152 private String protocol;
154 private Integer port;
155 private String healthCheckUri;