d30e5e76457ae285620a1b8429e5d8d5dc708cc7
[aai/sparky-be.git] / src / main / java / org / onap / aai / sparky / dal / rest / config / RestEndpointConfig.java
1 /**
2  * ============LICENSE_START=======================================================
3  * org.onap.aai
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
11  *
12  *       http://www.apache.org/licenses/LICENSE-2.0
13  *
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=========================================================
20  */
21 package org.onap.aai.sparky.dal.rest.config;
22
23 import org.onap.aai.restclient.enums.RestAuthenticationMode;
24
25 public class RestEndpointConfig {
26
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;
40
41   public boolean isValidateServerCertChain() {
42     return validateServerCertChain;
43   }
44
45   public void setValidateServerCertChain(boolean validateServerCertChain) {
46     this.validateServerCertChain = validateServerCertChain;
47   }
48
49   public boolean isValidateServerHostname() {
50     return validateServerHostname;
51   }
52
53   public void setValidateServerHostname(boolean validateServerHostname) {
54     this.validateServerHostname = validateServerHostname;
55   }
56
57   public String getEndpointIpAddress() {
58     return endpointIpAddress;
59   }
60
61   public void setEndpointIpAddress(String endpointIpAddress) {
62     this.endpointIpAddress = endpointIpAddress;
63   }
64
65   public String getEndpointServerPort() {
66     return endpointServerPort;
67   }
68
69   public void setEndpointServerPort(String endpointServerPort) {
70     this.endpointServerPort = endpointServerPort;
71   }
72
73   public int getNumRequestRetries() {
74     return numRequestRetries;
75   }
76
77   public void setNumRequestRetries(int numRequestRetries) {
78     this.numRequestRetries = numRequestRetries;
79   }
80
81   public String getBasicAuthUserName() {
82     return basicAuthUserName;
83   }
84
85   public void setBasicAuthUserName(String basicAuthUserName) {
86     this.basicAuthUserName = basicAuthUserName;
87   }
88
89   public String getBasicAuthPassword() {
90     return basicAuthPassword;
91   }
92
93   public void setBasicAuthPassword(String basicAuthPassword) {
94     this.basicAuthPassword = basicAuthPassword;
95   }
96
97   public RestAuthenticationMode getRestAuthenticationMode() {
98     return restAuthenticationMode;
99   }
100
101   public void setRestAuthenticationMode(RestAuthenticationMode restAuthenticationMode) {
102     this.restAuthenticationMode = restAuthenticationMode;
103   }
104
105   public int getConnectTimeoutInMs() {
106     return connectTimeoutInMs;
107   }
108
109   public void setConnectTimeoutInMs(int connectTimeoutInMs) {
110     this.connectTimeoutInMs = connectTimeoutInMs;
111   }
112
113   public int getReadTimeoutInMs() {
114     return readTimeoutInMs;
115   }
116
117   public void setReadTimeoutInMs(int readTimeoutInMs) {
118     this.readTimeoutInMs = readTimeoutInMs;
119   }
120
121   public String getCertFileName() {
122     return certFileName;
123   }
124
125   public void setCertFileName(String certFileName) {
126     this.certFileName = certFileName;
127   }
128
129   public String getCertPassword() {
130     return certPassword;
131   }
132
133   public void setCertPassword(String certPassword) {
134     this.certPassword = certPassword;
135   }
136
137   public String getTruststoreFileName() {
138     return truststoreFileName;
139   }
140
141   public void setTruststoreFileName(String truststoreFileName) {
142     this.truststoreFileName = truststoreFileName;
143   }
144
145   @Override
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 + "]";
161   }
162
163
164
165 }