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 {
33 String DME2_READ_TIMEOUT_PROPERTY = "AFT_DME2_EP_READ_TIMEOUT_MS";
34 String DME2_EP_CONN_TIMEOUT_PROPERTY = "AFT_DME2_EP_CONN_TIMEOUT";
35 String DME2_ROUNDTRIP_TIMEOUT_PROPERTY = "AFT_DME2_ROUNDTRIP_TIMEOUT_MS";
36 String DME2_VERSION_PROPERTY = "Version";
37 String DME2_ROUTE_OFFER_PROPERTY = "routeOffer";
38 String DME2_SERVICE_NAME_PROPERTY = "ServiceName";
39 String DME2_SUBCONTEXT_PATH_PROPERTY = "SubContextPath";
40 String DME2_SESSION_STICKINESS_REQUIRED_PROPERTY = "sessionstickinessrequired";
44 * Instantiate a new DMAAP Topic Sink, with following params.
45 * servers list of servers
48 * apiSecret API Secret
49 * userName AAF user name
50 * password AAF password
51 * partitionKey Consumer Group
52 * environment DME2 environment
53 * aftEnvironment DME2 AFT environment
54 * partner DME2 Partner
55 * latitude DME2 latitude
56 * longitude DME2 longitude
57 * additionalProps additional properties to pass to DME2
58 * managed is this sink endpoint managed?
60 * @param busTopicParams parameter object
61 * @return DmaapTopicSink object
62 * @throws IllegalArgumentException if invalid parameters are present
64 DmaapTopicSink build(BusTopicParams busTopicParams);
67 * Creates an DMAAP Topic Sink based on properties files.
69 * @param properties Properties containing initialization values
70 * @return an DMAAP Topic Sink
71 * @throws IllegalArgumentException if invalid parameters are present
73 List<DmaapTopicSink> build(Properties properties);
76 * Instantiates a new DMAAP Topic Sink.
78 * @param servers list of servers
79 * @param topic topic name
80 * @return an DMAAP Topic Sink
81 * @throws IllegalArgumentException if invalid parameters are present
83 DmaapTopicSink build(List<String> servers, String topic);
86 * Destroys an DMAAP Topic Sink based on a topic.
88 * @param topic topic name
89 * @throws IllegalArgumentException if invalid parameters are present
91 void destroy(String topic);
94 * Destroys all DMAAP Topic Sinks.
99 * Gets an DMAAP Topic Sink based on topic name.
101 * @param topic the topic name
102 * @return an DMAAP Topic Sink with topic name
103 * @throws IllegalArgumentException if an invalid topic is provided
104 * @throws IllegalStateException if the DMAAP Topic Reader is an incorrect state
106 DmaapTopicSink get(String topic);
109 * Provides a snapshot of the DMAAP Topic Sinks.
111 * @return a list of the DMAAP Topic Sinks
113 List<DmaapTopicSink> inventory();