2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.onap.policy.common.endpoints.event.comm.bus;
23 import java.util.List;
24 import java.util.Properties;
27 * UEB Topic Sink Factory
29 public interface UebTopicSinkFactory {
32 * Instantiates a new UEB Topic Writer
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?
41 * @return an UEB Topic Sink
42 * @throws IllegalArgumentException if invalid parameters are present
44 public UebTopicSink build(List<String> servers, String topic, String apiKey, String apiSecret, String partitionKey,
45 boolean managed, boolean useHttps, boolean allowSelfSignedCerts);
48 * Creates an UEB Topic Writer based on properties files
50 * @param properties Properties containing initialization values
52 * @return an UEB Topic Writer
53 * @throws IllegalArgumentException if invalid parameters are present
55 public List<UebTopicSink> build(Properties properties);
58 * Instantiates a new UEB Topic Writer
60 * @param servers list of servers
61 * @param topic topic name
63 * @return an UEB Topic Writer
64 * @throws IllegalArgumentException if invalid parameters are present
66 public UebTopicSink build(List<String> servers, String topic);
69 * Destroys an UEB Topic Writer based on a topic
71 * @param topic topic name
72 * @throws IllegalArgumentException if invalid parameters are present
74 public void destroy(String topic);
77 * gets an UEB Topic Writer based on topic name
79 * @param topic the topic name
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
85 public UebTopicSink get(String topic);
88 * Provides a snapshot of the UEB Topic Writers
90 * @return a list of the UEB Topic Writers
92 public List<UebTopicSink> inventory();
95 * Destroys all UEB Topic Writers
97 public void destroy();