2 * ============LICENSE_START=======================================================
3 * DCAEGEN2-SERVICES-SDK
4 * ================================================================================
5 * Copyright (C) 2018 NOKIA Intellectual Property. 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=========================================================
22 package org.onap.dcaegen2.services.sdk.rest.services.cbs.client.providers;
24 import com.google.gson.JsonObject;
25 import org.onap.dcaegen2.services.sdk.rest.services.cbs.client.model.EnvProperties;
26 import reactor.core.publisher.Mono;
29 * Rest CloudConfigurationClient interface which will define all necessary methods in connection with downloading JSON
30 * for each component in DCAEGEN2 repository.
32 * This interface holds contract for user-defined client or our defined implementation in CBS-client module.
34 * @author <a href="mailto:przemyslaw.wasala@nokia.com">Przemysław Wąsala</a> on 11/16/18
35 * @version 1.0.0 has got only one implementation of this interface: 1. ReactiveCloudConfigurationProvider.class
38 public interface CloudConfigurationProvider {
40 /* callForServiceConfigurationReactive */
43 * Getting configuration for appName from ConfigBindingService.
45 * @param envProperties - Object holds consulPort, consulURL, configBindingSeriveName, applicationName which have
46 * been defined in dcaegen2 cloud environment.
47 * @return Single reactive response which @Mono which holds inside them JsonObject with configuration for specified
50 Mono<JsonObject> callForServiceConfigurationReactive(EnvProperties envProperties);
52 /* callForServiceConfigurationReactive */
55 * Getting configuration for appName from ConfigBindingService.
57 * @param consulHost - Hostname/IPAddress of consul Database
58 * @param consulPort - Port number of consul Database
59 * @param cbsName - ConfigBindingService url
60 * @param appName - ApplicationName for each config will be returned
61 * @return rective configuration for specified application in dcaegen2 cloud infrastructure.
63 Mono<JsonObject> callForServiceConfigurationReactive(String consulHost, int consulPort, String cbsName,
67 /*callForServiceConfiguration*/
70 * Getting configuration for appName from ConfigBindingService.
72 * @param consulHost - Hostname/IPAddress of consul Database
73 * @param consulPort - Port number of consul Database
74 * @param cbsName - ConfigBindingService url
75 * @param appName - ApplicationName for each config will be returned
76 * @return configuration for specified application in dcaegen2 cloud infrastructure.
78 JsonObject callForServiceConfiguration(String consulHost, int consulPort, String cbsName, String appName);
80 /*callForServiceConfiguration*/
83 * Getting configuration for appName from ConfigBindingService.
85 * @param envProperties - Object holds consulPort, consulURL, configBindingSeriveName, applicationName which have
86 * @return configuration for specified application in dcaegen2 cloud infrastructure.
88 JsonObject callForServiceConfiguration(EnvProperties envProperties);