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 permittedAncestors; // Space separated list of permitted ancestors
80 public Integer getHealthCheckSocketTimeoutInMs(int defaultVal) {
81 return healthCheckSocketTimeoutInMs == null ? defaultVal : healthCheckSocketTimeoutInMs;
84 public Integer getHealthCheckIntervalInSeconds(int defaultVal) {
85 return healthCheckIntervalInSeconds == null ? defaultVal : healthCheckIntervalInSeconds;
89 public String toString() {
90 return new StringBuilder().append(format("backend host: %s%n", beHost)).append(format("backend http port: %s%n", beHttpPort))
91 .append(format("backend ssl port: %s%n", beSslPort)).append(format("backend context: %s%n", beContext))
92 .append(format("backend protocol: %s%n", beProtocol)).append(format("onboarding forward context: %s%n", onboardingForwardContext))
93 .append(format("Version: %s%n", version)).append(format("Released: %s%n", released))
94 .append(format("Connecting to database: %s%n", connection)).append(format("Supported protocols: %s%n", protocols)).toString();
100 public static class FeMonitoringConfig {
102 private Boolean enabled;
103 private Boolean isProxy;
104 private Integer probeIntervalInSeconds;
106 public Integer getProbeIntervalInSeconds(int defaultVal) {
107 return probeIntervalInSeconds == null ? defaultVal : probeIntervalInSeconds;
114 public static class OnboardingConfig {
116 private String protocolFe = "http";
117 private String hostFe;
118 private Integer portFe;
119 private String protocolBe = "http";
120 private String hostBe;
121 private Integer portBe;
122 private String healthCheckUriFe;
128 public static class CookieConfig {
130 private String cookieName = "AuthenticationCookie";
131 private String path = "";
132 private String domain = "";
133 private String securityKey = "";
139 public static class BasicAuthConfig {
141 private boolean enabled = false;
142 private String userName = "";
143 private String userPass = "";
149 public static class CatalogFacadeMsConfig {
151 private String protocol;
153 private Integer port;
154 private String healthCheckUri;