2 * ============LICENSE_START=======================================================
3 * aaf-certservice-client
4 * ================================================================================
5 * Copyright (C) 2020 Nokia. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.onap.aaf.certservice.client.configuration.model;
23 import org.onap.aaf.certservice.client.configuration.ClientConfigurationEnvs;
25 public class ClientConfiguration implements ConfigurationModel {
27 private static final Integer DEFAULT_TIMEOUT_MS = 30000;
28 private static final String DEFAULT_REQUEST_URL = "https://aaf-cert-service:8443/v1/certificate/";
30 private String urlToCertService;
31 private Integer requestTimeout;
32 private String certsOutputPath;
33 private String caName;
36 public ClientConfiguration() {
37 urlToCertService = DEFAULT_REQUEST_URL;
38 requestTimeout = DEFAULT_TIMEOUT_MS;
42 public String getUrlToCertService() {
43 return urlToCertService;
46 public ClientConfiguration setUrlToCertService(String urlToCertService) {
47 this.urlToCertService = urlToCertService;
51 public Integer getRequestTimeout() {
52 return requestTimeout;
55 public ClientConfiguration setRequestTimeout(Integer requestTimeout) {
56 this.requestTimeout = requestTimeout;
60 public String getCertsOutputPath() {
61 return certsOutputPath;
64 public ClientConfiguration setCertsOutputPath(String certsOutputPath) {
65 this.certsOutputPath = certsOutputPath;
69 public String getCaName() {
73 public ClientConfiguration setCaName(String caName) {
79 public String toString() {
80 return String.format("%s: %s, %s: %s, %s: %s, %s: %s",
81 ClientConfigurationEnvs.REQUEST_URL, urlToCertService,
82 ClientConfigurationEnvs.REQUEST_TIMEOUT, requestTimeout,
83 ClientConfigurationEnvs.OUTPUT_PATH, certsOutputPath,
84 ClientConfigurationEnvs.CA_NAME, caName);