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 * DMAAP Topic Sink Factory.
31 public interface DmaapTopicSinkFactory {
35 * Instantiate a new DMAAP Topic Sink, with following params.
36 * servers list of servers
39 * apiSecret API Secret
40 * userName AAF user name
41 * password AAF password
42 * partitionKey Consumer Group
43 * environment DME2 environment
44 * aftEnvironment DME2 AFT environment
45 * partner DME2 Partner
46 * latitude DME2 latitude
47 * longitude DME2 longitude
48 * additionalProps additional properties to pass to DME2
49 * managed is this sink endpoint managed?
51 * @param busTopicParams parameter object
52 * @return DmaapTopicSink object
53 * @throws IllegalArgumentException if invalid parameters are present
55 DmaapTopicSink build(BusTopicParams busTopicParams);
58 * Creates an DMAAP Topic Sink based on properties files.
60 * @param properties Properties containing initialization values
61 * @return an DMAAP Topic Sink
62 * @throws IllegalArgumentException if invalid parameters are present
64 List<DmaapTopicSink> build(Properties properties);
67 * Instantiates a new DMAAP Topic Sink.
69 * @param servers list of servers
70 * @param topic topic name
71 * @return an DMAAP Topic Sink
72 * @throws IllegalArgumentException if invalid parameters are present
74 DmaapTopicSink build(List<String> servers, String topic);
77 * Destroys an DMAAP Topic Sink based on a topic.
79 * @param topic topic name
80 * @throws IllegalArgumentException if invalid parameters are present
82 void destroy(String topic);
85 * Destroys all DMAAP Topic Sinks.
90 * Gets an DMAAP Topic Sink based on topic name.
92 * @param topic the topic name
93 * @return an DMAAP Topic Sink with topic name
94 * @throws IllegalArgumentException if an invalid topic is provided
95 * @throws IllegalStateException if the DMAAP Topic Reader is an incorrect state
97 DmaapTopicSink get(String topic);
100 * Provides a snapshot of the DMAAP Topic Sinks.
102 * @return a list of the DMAAP Topic Sinks
104 List<DmaapTopicSink> inventory();