2 * ============LICENSE_START=======================================================
3 * DCAEGEN2-SERVICES-SDK
4 * ================================================================================
5 * Copyright (C) 2018 NOKIA Intellectual Property. All rights reserved.
6 * Copyright (C) 2022 AT&T Intellectual Property. All rights reserved.
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=========================================================
23 package org.onap.dcaegen2.services.sdk.rest.services.cbs.client.providers;
25 import com.google.gson.JsonObject;
26 import org.onap.dcaegen2.services.sdk.rest.services.cbs.client.model.CbsClientConfiguration;
27 import reactor.core.publisher.Mono;
30 * Rest CloudConfigurationClient interface which will define all necessary methods in connection with downloading JSON
31 * for each component in DCAEGEN2 repository.
33 * This interface holds contract for user-defined client or our defined implementation in CBS-client module.
35 * @author <a href="mailto:przemyslaw.wasala@nokia.com">Przemysław Wąsala</a> on 11/16/18
36 * @version 1.0.0 has got only one implementation of this interface: 1. ReactiveCloudConfigurationProvider.class
39 public interface CloudConfigurationProvider {
41 /* callForServiceConfigurationReactive */
44 * Getting configuration for appName from ConfigBindingService.
46 * @param cbsClientConfiguration - Object holds consulPort, consulURL, configBindingSeriveName, applicationName which have
47 * been defined in dcaegen2 cloud environment.
48 * @return Single reactive response which @Mono which holds inside them JsonObject with configuration for specified
51 Mono<JsonObject> callForServiceConfigurationReactive(CbsClientConfiguration cbsClientConfiguration);
53 /* callForServiceConfigurationReactive */
56 * Getting configuration for appName from ConfigBindingService.
58 * @param consulHost - Hostname/IPAddress of consul Database
59 * @param consulPort - Port number of consul Database
60 * @param cbsName - ConfigBindingService url
61 * @param appName - ApplicationName for each config will be returned
62 * @return rective configuration for specified application in dcaegen2 cloud infrastructure.
64 Mono<JsonObject> callForServiceConfigurationReactive(String consulHost, int consulPort, String cbsName,