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