c555d94f9b88a809c7a4053283bae3fd739279bc
[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  * Noop Topic Sink Factory
28  */
29 public interface NoopTopicSinkFactory {
30
31     /**
32      * Creates noop topic sinks based on properties files
33      * 
34      * @param properties Properties containing initialization values
35      * 
36      * @return a noop topic sink
37      * @throws IllegalArgumentException if invalid parameters are present
38      */
39     public List<NoopTopicSink> build(Properties properties);
40
41     /**
42      * builds a noop sink
43      * 
44      * @param servers list of servers
45      * @param topic topic name
46      * @param managed is this sink endpoint managed?
47      * @return a noop topic sink
48      * @throws IllegalArgumentException if invalid parameters are present
49      */
50     public NoopTopicSink build(List<String> servers, String topic, boolean managed);
51
52     /**
53      * Destroys a sink based on the topic
54      * 
55      * @param topic topic name
56      * @throws IllegalArgumentException if invalid parameters are present
57      */
58     public void destroy(String topic);
59
60     /**
61      * gets a sink based on topic name
62      * 
63      * @param topic the topic name
64      * 
65      * @return a sink with topic name
66      * @throws IllegalArgumentException if an invalid topic is provided
67      * @throws IllegalStateException if the sink is in an incorrect state
68      */
69     public NoopTopicSink get(String topic);
70
71     /**
72      * Provides a snapshot of the UEB Topic Writers
73      * 
74      * @return a list of the UEB Topic Writers
75      */
76     public List<NoopTopicSink> inventory();
77
78     /**
79      * Destroys all sinks
80      */
81     public void destroy();
82 }