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;
25 public class RestEndpointConfig {
27 private String endpointIpAddress;
28 private String endpointServerPort;
29 private int numRequestRetries;
30 private String basicAuthUserName;
31 private String basicAuthPassword;
32 private RestAuthenticationMode restAuthenticationMode;
33 private int connectTimeoutInMs;
34 private int readTimeoutInMs;
35 private String certFileName;
36 private String certPassword;
37 private String truststoreFileName;
38 private boolean validateServerCertChain;
39 private boolean validateServerHostname;
41 public boolean isValidateServerCertChain() {
42 return validateServerCertChain;
45 public void setValidateServerCertChain(boolean validateServerCertChain) {
46 this.validateServerCertChain = validateServerCertChain;
49 public boolean isValidateServerHostname() {
50 return validateServerHostname;
53 public void setValidateServerHostname(boolean validateServerHostname) {
54 this.validateServerHostname = validateServerHostname;
57 public String getEndpointIpAddress() {
58 return endpointIpAddress;
61 public void setEndpointIpAddress(String endpointIpAddress) {
62 this.endpointIpAddress = endpointIpAddress;
65 public String getEndpointServerPort() {
66 return endpointServerPort;
69 public void setEndpointServerPort(String endpointServerPort) {
70 this.endpointServerPort = endpointServerPort;
73 public int getNumRequestRetries() {
74 return numRequestRetries;
77 public void setNumRequestRetries(int numRequestRetries) {
78 this.numRequestRetries = numRequestRetries;
81 public String getBasicAuthUserName() {
82 return basicAuthUserName;
85 public void setBasicAuthUserName(String basicAuthUserName) {
86 this.basicAuthUserName = basicAuthUserName;
89 public String getBasicAuthPassword() {
90 return basicAuthPassword;
93 public void setBasicAuthPassword(String basicAuthPassword) {
94 this.basicAuthPassword = basicAuthPassword;
97 public RestAuthenticationMode getRestAuthenticationMode() {
98 return restAuthenticationMode;
101 public void setRestAuthenticationMode(RestAuthenticationMode restAuthenticationMode) {
102 this.restAuthenticationMode = restAuthenticationMode;
105 public int getConnectTimeoutInMs() {
106 return connectTimeoutInMs;
109 public void setConnectTimeoutInMs(int connectTimeoutInMs) {
110 this.connectTimeoutInMs = connectTimeoutInMs;
113 public int getReadTimeoutInMs() {
114 return readTimeoutInMs;
117 public void setReadTimeoutInMs(int readTimeoutInMs) {
118 this.readTimeoutInMs = readTimeoutInMs;
121 public String getCertFileName() {
125 public void setCertFileName(String certFileName) {
126 this.certFileName = certFileName;
129 public String getCertPassword() {
133 public void setCertPassword(String certPassword) {
134 this.certPassword = certPassword;
137 public String getTruststoreFileName() {
138 return truststoreFileName;
141 public void setTruststoreFileName(String truststoreFileName) {
142 this.truststoreFileName = truststoreFileName;
146 public String toString() {
147 return "RestEndpointConfig ["
148 + (endpointIpAddress != null ? "endpointIpAddress=" + endpointIpAddress + ", " : "")
149 + (endpointServerPort != null ? "endpointServerPort=" + endpointServerPort + ", " : "")
150 + "numRequestRetries=" + numRequestRetries + ", "
151 + (basicAuthUserName != null ? "basicAuthUserName=" + basicAuthUserName + ", " : "")
152 + (basicAuthPassword != null ? "basicAuthPassword=" + basicAuthPassword + ", " : "")
153 + (restAuthenticationMode != null
154 ? "restAuthenticationMode=" + restAuthenticationMode + ", " : "")
155 + "connectTimeoutInMs=" + connectTimeoutInMs + ", readTimeoutInMs=" + readTimeoutInMs + ", "
156 + (certFileName != null ? "certFileName=" + certFileName + ", " : "")
157 + (certPassword != null ? "certPassword=" + certPassword + ", " : "")
158 + (truststoreFileName != null ? "truststoreFileName=" + truststoreFileName + ", " : "")
159 + "validateServerCertChain=" + validateServerCertChain + ", validateServerHostname="
160 + validateServerHostname + "]";