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;
25 import java.util.Properties;
28 * DMAAP Topic Sink Factory
30 public interface DmaapTopicSinkFactory {
31 public final String DME2_READ_TIMEOUT_PROPERTY = "AFT_DME2_EP_READ_TIMEOUT_MS";
32 public final String DME2_EP_CONN_TIMEOUT_PROPERTY = "AFT_DME2_EP_CONN_TIMEOUT";
33 public final String DME2_ROUNDTRIP_TIMEOUT_PROPERTY = "AFT_DME2_ROUNDTRIP_TIMEOUT_MS";
34 public final String DME2_VERSION_PROPERTY = "Version";
35 public final String DME2_ROUTE_OFFER_PROPERTY = "routeOffer";
36 public final String DME2_SERVICE_NAME_PROPERTY = "ServiceName";
37 public final String DME2_SUBCONTEXT_PATH_PROPERTY = "SubContextPath";
38 public final String DME2_SESSION_STICKINESS_REQUIRED_PROPERTY = "sessionstickinessrequired";
41 * Instantiates a new DMAAP Topic Sink
43 * @param servers list of servers
44 * @param topic topic name
45 * @param apiKey API Key
46 * @param apiSecret API Secret
47 * @param userName AAF user name
48 * @param password AAF password
49 * @param partitionKey Consumer Group
50 * @param environment DME2 environment
51 * @param aftEnvironment DME2 AFT environment
52 * @param partner DME2 Partner
53 * @param latitude DME2 latitude
54 * @param longitude DME2 longitude
55 * @param additionalProps additional properties to pass to DME2
56 * @param managed is this sink endpoint managed?
58 * @return an DMAAP Topic Sink
59 * @throws IllegalArgumentException if invalid parameters are present
61 public DmaapTopicSink build(List<String> servers, String topic, String apiKey, String apiSecret, String userName,
62 String password, String partitionKey, String environment, String aftEnvironment, String partner,
63 String latitude, String longitude, Map<String, String> additionalProps, boolean managed, boolean useHttps,
64 boolean allowSelfSignedCerts);
67 * Instantiates a new DMAAP Topic Sink
69 * @param servers list of servers
70 * @param topic topic name
71 * @param apiKey API Key
72 * @param apiSecret API Secret
73 * @param userName AAF user name
74 * @param password AAF password
75 * @param partitionKey Consumer Group
76 * @param managed is this sink endpoint managed?
78 * @return an DMAAP Topic Sink
79 * @throws IllegalArgumentException if invalid parameters are present
81 public DmaapTopicSink build(List<String> servers, String topic, String apiKey, String apiSecret, String userName,
82 String password, String partitionKey, boolean managed, boolean useHttps, boolean allowSelfSignedCerts);
85 * Creates an DMAAP Topic Sink based on properties files
87 * @param properties Properties containing initialization values
89 * @return an DMAAP Topic Sink
90 * @throws IllegalArgumentException if invalid parameters are present
92 public List<DmaapTopicSink> build(Properties properties);
95 * Instantiates a new DMAAP Topic Sink
97 * @param servers list of servers
98 * @param topic topic name
100 * @return an DMAAP Topic Sink
101 * @throws IllegalArgumentException if invalid parameters are present
103 public DmaapTopicSink build(List<String> servers, String topic);
106 * Destroys an DMAAP Topic Sink based on a topic
108 * @param topic topic name
109 * @throws IllegalArgumentException if invalid parameters are present
111 public void destroy(String topic);
114 * gets an DMAAP Topic Sink based on topic name
116 * @param topic the topic name
118 * @return an DMAAP Topic Sink with topic name
119 * @throws IllegalArgumentException if an invalid topic is provided
120 * @throws IllegalStateException if the DMAAP Topic Reader is an incorrect state
122 public DmaapTopicSink get(String topic);
125 * Provides a snapshot of the DMAAP Topic Sinks
127 * @return a list of the DMAAP Topic Sinks
129 public List<DmaapTopicSink> inventory();
132 * Destroys all DMAAP Topic Sinks
134 public void destroy();