2 * ============LICENSE_START===================================================
3 * SPARKY (AAI UI service)
4 * ============================================================================
5 * Copyright © 2017 AT&T Intellectual Property.
6 * Copyright © 2017 Amdocs
8 * ============================================================================
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
20 * ============LICENSE_END=====================================================
22 * ECOMP and OpenECOMP are trademarks
23 * and service marks of AT&T Intellectual Property.
25 package org.onap.aai.sparky.dal.rest.config;
27 import org.onap.aai.restclient.enums.RestAuthenticationMode;
28 import org.onap.aai.sparky.config.SparkyResourceLoader;
30 public class RestEndpointConfig {
32 private String endpointIpAddress;
33 private String endpointServerPort;
34 private int numRequestRetries;
35 private String basicAuthUserName;
36 private String basicAuthPassword;
37 private RestAuthenticationMode restAuthenticationMode;
38 private int connectTimeoutInMs;
39 private int readTimeoutInMs;
40 private String certFileName;
41 private String certPassword;
42 private String truststoreFileName;
43 private boolean validateServerCertChain;
44 private boolean validateServerHostname;
45 private SparkyResourceLoader resourceLoader;
47 public boolean isValidateServerCertChain() {
48 return validateServerCertChain;
51 public void setValidateServerCertChain(boolean validateServerCertChain) {
52 this.validateServerCertChain = validateServerCertChain;
55 public boolean isValidateServerHostname() {
56 return validateServerHostname;
59 public void setValidateServerHostname(boolean validateServerHostname) {
60 this.validateServerHostname = validateServerHostname;
63 public String getEndpointIpAddress() {
64 return endpointIpAddress;
67 public void setEndpointIpAddress(String endpointIpAddress) {
68 this.endpointIpAddress = endpointIpAddress;
71 public String getEndpointServerPort() {
72 return endpointServerPort;
75 public void setEndpointServerPort(String endpointServerPort) {
76 this.endpointServerPort = endpointServerPort;
79 public int getNumRequestRetries() {
80 return numRequestRetries;
83 public void setNumRequestRetries(int numRequestRetries) {
84 this.numRequestRetries = numRequestRetries;
87 public String getBasicAuthUserName() {
88 return basicAuthUserName;
91 public void setBasicAuthUserName(String basicAuthUserName) {
92 this.basicAuthUserName = basicAuthUserName;
95 public String getBasicAuthPassword() {
96 return basicAuthPassword;
99 public void setBasicAuthPassword(String basicAuthPassword) {
100 this.basicAuthPassword = basicAuthPassword;
103 public RestAuthenticationMode getRestAuthenticationMode() {
104 return restAuthenticationMode;
107 public void setRestAuthenticationMode(RestAuthenticationMode restAuthenticationMode) {
108 this.restAuthenticationMode = restAuthenticationMode;
111 public int getConnectTimeoutInMs() {
112 return connectTimeoutInMs;
115 public void setConnectTimeoutInMs(int connectTimeoutInMs) {
116 this.connectTimeoutInMs = connectTimeoutInMs;
119 public int getReadTimeoutInMs() {
120 return readTimeoutInMs;
123 public void setReadTimeoutInMs(int readTimeoutInMs) {
124 this.readTimeoutInMs = readTimeoutInMs;
127 public String getCertFileName() {
131 public void setCertFileName(String certFileName) {
132 this.certFileName = certFileName;
135 public String getCertPassword() {
139 public void setCertPassword(String certPassword) {
140 this.certPassword = certPassword;
143 public String getTruststoreFileName() {
144 return truststoreFileName;
147 public void setTruststoreFileName(String truststoreFileName) {
148 this.truststoreFileName = truststoreFileName;
151 public SparkyResourceLoader getResourceLoader() {
152 return resourceLoader;
155 public void setResourceLoader(SparkyResourceLoader resourceLoader) {
156 this.resourceLoader = resourceLoader;
160 public String toString() {
161 return "RestEndpointConfig ["
162 + (endpointIpAddress != null ? "endpointIpAddress=" + endpointIpAddress + ", " : "")
163 + (endpointServerPort != null ? "endpointServerPort=" + endpointServerPort + ", " : "")
164 + "numRequestRetries=" + numRequestRetries + ", "
165 + (basicAuthUserName != null ? "basicAuthUserName=" + basicAuthUserName + ", " : "")
166 + (basicAuthPassword != null ? "basicAuthPassword=" + basicAuthPassword + ", " : "")
167 + (restAuthenticationMode != null
168 ? "restAuthenticationMode=" + restAuthenticationMode + ", " : "")
169 + "connectTimeoutInMs=" + connectTimeoutInMs + ", readTimeoutInMs=" + readTimeoutInMs + ", "
170 + (certFileName != null ? "certFileName=" + certFileName + ", " : "")
171 + (certPassword != null ? "certPassword=" + certPassword + ", " : "")
172 + (truststoreFileName != null ? "truststoreFileName=" + truststoreFileName + ", " : "")
173 + "validateServerCertChain=" + validateServerCertChain + ", validateServerHostname="
174 + validateServerHostname + "]";