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