Convert Sparky to Spring-Boot
[aai/sparky-be.git] / sparkybe-onap-service / src / main / java / org / onap / aai / sparky / dal / rest / config / RestEndpointConfig.java
1 /**
2  * ============LICENSE_START===================================================
3  * SPARKY (AAI UI service)
4  * ============================================================================
5  * Copyright © 2017 AT&T Intellectual Property.
6  * Copyright © 2017 Amdocs
7  * All rights reserved.
8  * ============================================================================
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  *      http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  * ============LICENSE_END=====================================================
21  *
22  * ECOMP and OpenECOMP are trademarks
23  * and service marks of AT&T Intellectual Property.
24  */
25 package org.onap.aai.sparky.dal.rest.config;
26
27 import org.onap.aai.restclient.enums.RestAuthenticationMode;
28 import org.onap.aai.sparky.config.SparkyResourceLoader;
29
30 public class RestEndpointConfig {
31
32   private String endpointIpAddress;
33   private String endpointServerPort;
34   private int numRequestRetries;
35   private String basicAuthUserName;
36   private String basicAuthPassword;
37   private RestAuthenticationMode restAuthenticationMode;
38   private int connectTimeoutInMs;
39   private int readTimeoutInMs;
40   private String certFileName;
41   private String certPassword;
42   private String truststoreFileName;
43   private boolean validateServerCertChain;
44   private boolean validateServerHostname;
45   private SparkyResourceLoader resourceLoader;
46
47   public boolean isValidateServerCertChain() {
48     return validateServerCertChain;
49   }
50
51   public void setValidateServerCertChain(boolean validateServerCertChain) {
52     this.validateServerCertChain = validateServerCertChain;
53   }
54
55   public boolean isValidateServerHostname() {
56     return validateServerHostname;
57   }
58
59   public void setValidateServerHostname(boolean validateServerHostname) {
60     this.validateServerHostname = validateServerHostname;
61   }
62
63   public String getEndpointIpAddress() {
64     return endpointIpAddress;
65   }
66
67   public void setEndpointIpAddress(String endpointIpAddress) {
68     this.endpointIpAddress = endpointIpAddress;
69   }
70
71   public String getEndpointServerPort() {
72     return endpointServerPort;
73   }
74
75   public void setEndpointServerPort(String endpointServerPort) {
76     this.endpointServerPort = endpointServerPort;
77   }
78
79   public int getNumRequestRetries() {
80     return numRequestRetries;
81   }
82
83   public void setNumRequestRetries(int numRequestRetries) {
84     this.numRequestRetries = numRequestRetries;
85   }
86
87   public String getBasicAuthUserName() {
88     return basicAuthUserName;
89   }
90
91   public void setBasicAuthUserName(String basicAuthUserName) {
92     this.basicAuthUserName = basicAuthUserName;
93   }
94
95   public String getBasicAuthPassword() {
96     return basicAuthPassword;
97   }
98
99   public void setBasicAuthPassword(String basicAuthPassword) {
100     this.basicAuthPassword = basicAuthPassword;
101   }
102
103   public RestAuthenticationMode getRestAuthenticationMode() {
104     return restAuthenticationMode;
105   }
106
107   public void setRestAuthenticationMode(RestAuthenticationMode restAuthenticationMode) {
108     this.restAuthenticationMode = restAuthenticationMode;
109   }
110
111   public int getConnectTimeoutInMs() {
112     return connectTimeoutInMs;
113   }
114
115   public void setConnectTimeoutInMs(int connectTimeoutInMs) {
116     this.connectTimeoutInMs = connectTimeoutInMs;
117   }
118
119   public int getReadTimeoutInMs() {
120     return readTimeoutInMs;
121   }
122
123   public void setReadTimeoutInMs(int readTimeoutInMs) {
124     this.readTimeoutInMs = readTimeoutInMs;
125   }
126
127   public String getCertFileName() {
128     return certFileName;
129   }
130
131   public void setCertFileName(String certFileName) {
132     this.certFileName = certFileName;
133   }
134
135   public String getCertPassword() {
136     return certPassword;
137   }
138
139   public void setCertPassword(String certPassword) {
140     this.certPassword = certPassword;
141   }
142
143   public String getTruststoreFileName() {
144     return truststoreFileName;
145   }
146
147   public void setTruststoreFileName(String truststoreFileName) {
148     this.truststoreFileName = truststoreFileName;
149   }
150
151   public SparkyResourceLoader getResourceLoader() {
152     return resourceLoader;
153   }
154
155   public void setResourceLoader(SparkyResourceLoader resourceLoader) {
156     this.resourceLoader = resourceLoader;
157   }
158
159   @Override
160   public String toString() {
161     return "RestEndpointConfig ["
162         + (endpointIpAddress != null ? "endpointIpAddress=" + endpointIpAddress + ", " : "")
163         + (endpointServerPort != null ? "endpointServerPort=" + endpointServerPort + ", " : "")
164         + "numRequestRetries=" + numRequestRetries + ", "
165         + (basicAuthUserName != null ? "basicAuthUserName=" + basicAuthUserName + ", " : "")
166         + (basicAuthPassword != null ? "basicAuthPassword=" + basicAuthPassword + ", " : "")
167         + (restAuthenticationMode != null
168             ? "restAuthenticationMode=" + restAuthenticationMode + ", " : "")
169         + "connectTimeoutInMs=" + connectTimeoutInMs + ", readTimeoutInMs=" + readTimeoutInMs + ", "
170         + (certFileName != null ? "certFileName=" + certFileName + ", " : "")
171         + (certPassword != null ? "certPassword=" + certPassword + ", " : "")
172         + (truststoreFileName != null ? "truststoreFileName=" + truststoreFileName + ", " : "")
173         + "validateServerCertChain=" + validateServerCertChain + ", validateServerHostname="
174         + validateServerHostname + "]";
175   }
176
177
178
179 }