d82d5d314cae216fd643f8908eeacb854a235550
[dcaegen2/services/sdk.git] /
1 /*
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
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
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=========================================================
19  *
20  */
21
22 package org.onap.dcaegen2.services.sdk.rest.services.cbs.client.providers;
23
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;
27
28 /**
29  * Rest CloudConfigurationClient interface which will define all necessary methods in connection with downloading JSON
30  * for each component in DCAEGEN2 repository.
31  *
32  * This interface holds contract for user-defined client or our defined implementation in CBS-client module.
33  *
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
36  * @since 1.0.0
37  */
38 public interface CloudConfigurationProvider {
39
40     /* callForServiceConfigurationReactive */
41
42     /**
43      * Getting configuration for appName from ConfigBindingService.
44      *
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
48      * application Name
49      */
50     Mono<JsonObject> callForServiceConfigurationReactive(EnvProperties envProperties);
51
52     /* callForServiceConfigurationReactive */
53
54     /**
55      * Getting configuration for appName from ConfigBindingService.
56      *
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.
62      */
63     Mono<JsonObject> callForServiceConfigurationReactive(String consulHost, int consulPort, String cbsName,
64         String appName);
65
66
67     /*callForServiceConfiguration*/
68
69     /**
70      * Getting configuration for appName from ConfigBindingService.
71      *
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.
77      */
78     JsonObject callForServiceConfiguration(String consulHost, int consulPort, String cbsName, String appName);
79
80     /*callForServiceConfiguration*/
81
82     /**
83      * Getting configuration for appName from ConfigBindingService.
84      *
85      * @param envProperties - Object holds consulPort, consulURL, configBindingSeriveName, applicationName which have
86      * @return configuration for specified application in dcaegen2 cloud infrastructure.
87      */
88     JsonObject callForServiceConfiguration(EnvProperties envProperties);
89
90 }