2 * ============LICENSE_START=======================================================
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
12 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
22 package org.onap.policy.common.endpoints.event.comm.bus;
24 import java.util.List;
25 import java.util.Properties;
26 import org.onap.policy.common.endpoints.event.comm.bus.internal.BusTopicParams;
29 * UEB Topic Sink Factory.
31 public interface UebTopicSinkFactory {
34 * Instantiates a new UEB Topic Writer.
36 * @param busTopicParams parameters object
37 * @return an UEB Topic Sink
39 UebTopicSink build(BusTopicParams busTopicParams);
42 * Creates an UEB Topic Writer based on properties files.
44 * @param properties Properties containing initialization values
46 * @return an UEB Topic Writer
47 * @throws IllegalArgumentException if invalid parameters are present
49 List<UebTopicSink> build(Properties properties);
52 * Instantiates a new UEB Topic Writer.
54 * @param servers list of servers
55 * @param topic topic name
57 * @return an UEB Topic Writer
58 * @throws IllegalArgumentException if invalid parameters are present
60 UebTopicSink build(List<String> servers, String topic);
63 * Destroys an UEB Topic Writer based on a topic.
65 * @param topic topic name
66 * @throws IllegalArgumentException if invalid parameters are present
68 void destroy(String topic);
71 * Destroys all UEB Topic Writers.
76 * gets an UEB Topic Writer based on topic name.
78 * @param topic the topic name
80 * @return an UEB Topic Writer with topic name
81 * @throws IllegalArgumentException if an invalid topic is provided
82 * @throws IllegalStateException if the UEB Topic Reader is an incorrect state
84 UebTopicSink get(String topic);
87 * Provides a snapshot of the UEB Topic Writers.
89 * @return a list of the UEB Topic Writers
91 List<UebTopicSink> inventory();