beacee3b87f59edc87b313b0bc7f31a6dc6e0735
[policy/common.git] /
1 /*
2  * ============LICENSE_START=======================================================
3  * policy-endpoints
4  * ================================================================================
5  * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
6  * Modified Copyright (C) 2018 Samsung Electronics Co., Ltd.
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 package org.onap.policy.common.endpoints.event.comm.bus;
23
24 import java.util.List;
25 import java.util.Properties;
26 import org.onap.policy.common.endpoints.event.comm.bus.internal.BusTopicParams;
27
28 /**
29  * UEB Topic Source Factory.
30  */
31 public interface UebTopicSourceFactory {
32
33     /**
34      * Creates an UEB Topic Source based on properties files.
35      * 
36      * @param properties Properties containing initialization values
37      * 
38      * @return an UEB Topic Source
39      * @throws IllegalArgumentException if invalid parameters are present
40      */
41     List<UebTopicSource> build(Properties properties);
42
43     /**
44      * Instantiates a new UEB Topic Source.
45      * 
46      * @param busTopicParams parameters object
47      * @return an UEB Topic Source
48      */
49     UebTopicSource build(BusTopicParams busTopicParams);
50
51     /**
52      * Instantiates a new UEB Topic Source.
53      * 
54      * @param servers list of servers
55      * @param topic topic name
56      * @param apiKey API Key
57      * @param apiSecret API Secret
58      * 
59      * @return an UEB Topic Source
60      * @throws IllegalArgumentException if invalid parameters are present
61      */
62     UebTopicSource build(List<String> servers, String topic, String apiKey, String apiSecret);
63
64     /**
65      * Instantiates a new UEB Topic Source.
66      * 
67      * @param servers list of servers
68      * @param topic topic name
69      * 
70      * @return an UEB Topic Source
71      * @throws IllegalArgumentException if invalid parameters are present
72      */
73     UebTopicSource build(List<String> servers, String topic);
74
75     /**
76      * Destroys an UEB Topic Source based on a topic.
77      * 
78      * @param topic topic name
79      * @throws IllegalArgumentException if invalid parameters are present
80      */
81     void destroy(String topic);
82
83     /**
84      * Destroys all UEB Topic Sources.
85      */
86     void destroy();
87
88     /**
89      * Gets an UEB Topic Source based on topic name.
90      * 
91      * @param topic the topic name
92      * @return an UEB Topic Source with topic name
93      * @throws IllegalArgumentException if an invalid topic is provided
94      * @throws IllegalStateException if the UEB Topic Source is an incorrect state
95      */
96     UebTopicSource get(String topic);
97
98     /**
99      * Provides a snapshot of the UEB Topic Sources.
100      * 
101      * @return a list of the UEB Topic Sources
102      */
103     List<UebTopicSource> inventory();
104 }