d3d632e0149b522b16d800cb69d04f0ce3b24415
[policy/common.git] /
1 /*
2  * ============LICENSE_START=======================================================
3  * policy-endpoints
4  * ================================================================================
5  * Copyright (C) 2017-2018 AT&T 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 package org.onap.policy.common.endpoints.event.comm.bus;
22
23 import java.util.List;
24 import java.util.Properties;
25
26 /**
27  * UEB Topic Source Factory
28  */
29 public interface UebTopicSourceFactory {
30
31     /**
32      * Creates an UEB Topic Source based on properties files
33      * 
34      * @param properties Properties containing initialization values
35      * 
36      * @return an UEB Topic Source
37      * @throws IllegalArgumentException if invalid parameters are present
38      */
39     public List<UebTopicSource> build(Properties properties);
40
41     /**
42      * Instantiates a new UEB Topic Source
43      * 
44      * @param servers list of servers
45      * @param topic topic name
46      * @param apiKey API Key
47      * @param apiSecret API Secret
48      * @param consumerGroup Consumer Group
49      * @param consumerInstance Consumer Instance
50      * @param fetchTimeout Read Fetch Timeout
51      * @param fetchLimit Fetch Limit
52      * @param managed is this source endpoint managed?
53      * 
54      * @return an UEB Topic Source
55      * @throws IllegalArgumentException if invalid parameters are present
56      */
57     public UebTopicSource build(List<String> servers, String topic, String apiKey, String apiSecret,
58             String consumerGroup, String consumerInstance, int fetchTimeout, int fetchLimit, boolean managed,
59             boolean useHttps, boolean allowSelfSignedCerts);
60
61     /**
62      * Instantiates a new UEB Topic Source
63      * 
64      * @param servers list of servers
65      * @param topic topic name
66      * @param apiKey API Key
67      * @param apiSecret API Secret
68      * 
69      * @return an UEB Topic Source
70      * @throws IllegalArgumentException if invalid parameters are present
71      */
72     public UebTopicSource build(List<String> servers, String topic, String apiKey, String apiSecret);
73
74     /**
75      * Instantiates a new UEB Topic Source
76      * 
77      * @param servers list of servers
78      * @param topic topic name
79      * 
80      * @return an UEB Topic Source
81      * @throws IllegalArgumentException if invalid parameters are present
82      */
83     public UebTopicSource build(List<String> servers, String topic);
84
85     /**
86      * Destroys an UEB Topic Source based on a topic
87      * 
88      * @param topic topic name
89      * @throws IllegalArgumentException if invalid parameters are present
90      */
91     public void destroy(String topic);
92
93     /**
94      * Destroys all UEB Topic Sources
95      */
96     public void destroy();
97
98     /**
99      * gets an UEB Topic Source based on topic name
100      * 
101      * @param topic the topic name
102      * @return an UEB Topic Source with topic name
103      * @throws IllegalArgumentException if an invalid topic is provided
104      * @throws IllegalStateException if the UEB Topic Source is an incorrect state
105      */
106     public UebTopicSource get(String topic);
107
108     /**
109      * Provides a snapshot of the UEB Topic Sources
110      * 
111      * @return a list of the UEB Topic Sources
112      */
113     public List<UebTopicSource> inventory();
114 }