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.datarouter.query;
23 public class RestClientConfig {
25 private String certPath;
26 private String certPassword;
27 private String trustStorePath;
28 private String connectionTimeout;
29 private String readTimeout;
31 public String getCertPath() {
35 public void setCertPath(String certPath) {
36 this.certPath = certPath;
39 public String getCertPassword() {
43 public void setCertPassword(String certPassword) {
44 this.certPassword = certPassword;
47 public String getTrustStorePath() {
48 return trustStorePath;
51 public void setTrustStorePath(String trustStorePath) {
52 this.trustStorePath = trustStorePath;
55 public int getConnectionTimeout() {
56 return parseInt(connectionTimeout,10000);
59 public void setConnectionTimeout(String connectionTimeout) {
60 this.connectionTimeout = connectionTimeout;
63 public int getReadTimeout() {
64 return parseInt(connectionTimeout,10000);
67 public void setReadTimeout(String readTimeout) {
68 this.readTimeout = readTimeout;
72 private int parseInt(String config, int defaultValue) {
73 int intVal = defaultValue; // Default delay of half a sec
75 intVal = Integer.parseInt(config);
76 } catch (Exception e) {
77 // Ignore the parsing error and use the default
82 public String toString() {
83 return "RestClientConfig [certPath=" + certPath + ", certPassword=" + certPassword + ", trustStorePath="
84 + trustStorePath + ", connectionTimeout=" + connectionTimeout + ", readTimeout=" + readTimeout + "]";