2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
6 * Copyright © 2017 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 * ECOMP is a trademark and service mark of AT&T Intellectual Property.
23 package org.onap.aai.sparky.dal.rest.config;
25 import org.onap.aai.restclient.enums.RestAuthenticationMode;
27 public class RestEndpointConfig {
29 private String endpointIpAddress;
30 private String endpointServerPort;
31 private int numRequestRetries;
32 private String basicAuthUserName;
33 private String basicAuthPassword;
34 private RestAuthenticationMode restAuthenticationMode;
35 private int connectTimeoutInMs;
36 private int readTimeoutInMs;
37 private String certFileName;
38 private String certPassword;
39 private String truststoreFileName;
40 private boolean validateServerCertChain;
41 private boolean validateServerHostname;
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;
148 public String toString() {
149 return "RestEndpointConfig ["
150 + (endpointIpAddress != null ? "endpointIpAddress=" + endpointIpAddress + ", " : "")
151 + (endpointServerPort != null ? "endpointServerPort=" + endpointServerPort + ", " : "")
152 + "numRequestRetries=" + numRequestRetries + ", "
153 + (basicAuthUserName != null ? "basicAuthUserName=" + basicAuthUserName + ", " : "")
154 + (basicAuthPassword != null ? "basicAuthPassword=" + basicAuthPassword + ", " : "")
155 + (restAuthenticationMode != null
156 ? "restAuthenticationMode=" + restAuthenticationMode + ", " : "")
157 + "connectTimeoutInMs=" + connectTimeoutInMs + ", readTimeoutInMs=" + readTimeoutInMs + ", "
158 + (certFileName != null ? "certFileName=" + certFileName + ", " : "")
159 + (certPassword != null ? "certPassword=" + certPassword + ", " : "")
160 + (truststoreFileName != null ? "truststoreFileName=" + truststoreFileName + ", " : "")
161 + "validateServerCertChain=" + validateServerCertChain + ", validateServerHostname="
162 + validateServerHostname + "]";