37e59ca527509aa744a1dea621430efacc085ed3
[dcaegen2/services/sdk.git] /
1 /*
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
11  *
12  *      http://www.apache.org/licenses/LICENSE-2.0
13  *
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=========================================================
20  *
21  */
22
23 package org.onap.dcaegen2.services.sdk.rest.services.cbs.client.providers;
24
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;
28
29 /**
30  * Rest CloudConfigurationClient interface which will define all necessary methods in connection with downloading JSON
31  * for each component in DCAEGEN2 repository.
32  *
33  * This interface holds contract for user-defined client or our defined implementation in CBS-client module.
34  *
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
37  * @since 1.0.0
38  */
39 public interface CloudConfigurationProvider {
40
41     /* callForServiceConfigurationReactive */
42
43     /**
44      * Getting configuration for appName from ConfigBindingService.
45      *
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
49      * application Name
50      */
51     Mono<JsonObject> callForServiceConfigurationReactive(CbsClientConfiguration cbsClientConfiguration);
52
53     /* callForServiceConfigurationReactive */
54
55     /**
56      * Getting configuration for appName from ConfigBindingService.
57      *
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.
63      */
64     Mono<JsonObject> callForServiceConfigurationReactive(String consulHost, int consulPort, String cbsName,
65         String appName);
66
67
68
69
70 }