37920635bce12e6e9cd8cc1ab45166536cc4f21b
[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 Sink Factory
28  */
29 public interface UebTopicSinkFactory {
30
31     /**
32      * Instantiates a new UEB Topic Writer
33      * 
34      * @param servers list of servers
35      * @param topic topic name
36      * @param apiKey API Key
37      * @param apiSecret API Secret
38      * @param partitionKey Consumer Group
39      * @param managed is this sink endpoint managed?
40      * 
41      * @return an UEB Topic Sink
42      * @throws IllegalArgumentException if invalid parameters are present
43      */
44     public UebTopicSink build(List<String> servers, String topic, String apiKey, String apiSecret, String partitionKey,
45             boolean managed, boolean useHttps, boolean allowSelfSignedCerts);
46
47     /**
48      * Creates an UEB Topic Writer based on properties files
49      * 
50      * @param properties Properties containing initialization values
51      * 
52      * @return an UEB Topic Writer
53      * @throws IllegalArgumentException if invalid parameters are present
54      */
55     public List<UebTopicSink> build(Properties properties);
56
57     /**
58      * Instantiates a new UEB Topic Writer
59      * 
60      * @param servers list of servers
61      * @param topic topic name
62      * 
63      * @return an UEB Topic Writer
64      * @throws IllegalArgumentException if invalid parameters are present
65      */
66     public UebTopicSink build(List<String> servers, String topic);
67
68     /**
69      * Destroys an UEB Topic Writer based on a topic
70      * 
71      * @param topic topic name
72      * @throws IllegalArgumentException if invalid parameters are present
73      */
74     public void destroy(String topic);
75
76     /**
77      * gets an UEB Topic Writer based on topic name
78      * 
79      * @param topic the topic name
80      * 
81      * @return an UEB Topic Writer with topic name
82      * @throws IllegalArgumentException if an invalid topic is provided
83      * @throws IllegalStateException if the UEB Topic Reader is an incorrect state
84      */
85     public UebTopicSink get(String topic);
86
87     /**
88      * Provides a snapshot of the UEB Topic Writers
89      * 
90      * @return a list of the UEB Topic Writers
91      */
92     public List<UebTopicSink> inventory();
93
94     /**
95      * Destroys all UEB Topic Writers
96      */
97     public void destroy();
98 }