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 Source Factory
30 public interface DmaapTopicSourceFactory {
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 * Creates an DMAAP Topic Source based on properties files
43 * @param properties Properties containing initialization values
45 * @return an DMAAP Topic Source
46 * @throws IllegalArgumentException if invalid parameters are present
48 public List<DmaapTopicSource> build(Properties properties);
51 * Instantiates a new DMAAP Topic Source
53 * @param servers list of servers
54 * @param topic topic name
55 * @param apiKey API Key
56 * @param apiSecret API Secret
57 * @param userName user name
58 * @param password password
59 * @param consumerGroup Consumer Group
60 * @param consumerInstance Consumer Instance
61 * @param fetchTimeout Read Fetch Timeout
62 * @param fetchLimit Fetch Limit
63 * @param managed is this endpoind managed?
64 * @param useHttps does the connection use HTTPS?
65 * @param allowSelfSignedCerts does connection allow self-signed certificates?
67 * @return an DMAAP Topic Source
68 * @throws IllegalArgumentException if invalid parameters are present
70 public DmaapTopicSource build(List<String> servers, String topic, String apiKey, String apiSecret, String userName,
71 String password, String consumerGroup, String consumerInstance, int fetchTimeout, int fetchLimit,
72 boolean managed, boolean useHttps, boolean allowSelfSignedCerts);
75 * Instantiates a new DMAAP Topic Source
77 * @param servers list of servers
78 * @param topic topic name
79 * @param apiKey API Key
80 * @param apiSecret API Secret
81 * @param userName user name
82 * @param password password
83 * @param consumerGroup Consumer Group
84 * @param consumerInstance Consumer Instance
85 * @param fetchTimeout Read Fetch Timeout
86 * @param fetchLimit Fetch Limit
87 * @param environment DME2 environment
88 * @param aftEnvironment DME2 AFT environment
89 * @param partner DME2 Partner
90 * @param latitude DME2 latitude
91 * @param longitude DME2 longitude
92 * @param additionalProps additional properties to pass to DME2
93 * @param managed is this endpoind managed?
94 * @param useHttps does the connection use HTTPS?
95 * @param allowSelfSignedCerts does connection allow self-signed certificates?
97 * @return an DMAAP Topic Source
98 * @throws IllegalArgumentException if invalid parameters are present
100 public DmaapTopicSource build(List<String> servers, String topic, String apiKey, String apiSecret, String userName,
101 String password, String consumerGroup, String consumerInstance, int fetchTimeout, int fetchLimit,
102 String environment, String aftEnvironment, String partner, String latitude, String longitude,
103 Map<String, String> additionalProps, boolean managed, boolean useHttps, boolean allowSelfSignedCerts);
106 * Instantiates a new DMAAP Topic Source
108 * @param servers list of servers
109 * @param topic topic name
110 * @param apiKey API Key
111 * @param apiSecret API Secret
113 * @return an DMAAP Topic Source
114 * @throws IllegalArgumentException if invalid parameters are present
116 public DmaapTopicSource build(List<String> servers, String topic, String apiKey, String apiSecret);
119 * Instantiates a new DMAAP Topic Source
121 * @param servers list of servers
122 * @param topic topic name
124 * @return an DMAAP Topic Source
125 * @throws IllegalArgumentException if invalid parameters are present
127 public DmaapTopicSource build(List<String> servers, String topic);
130 * Destroys an DMAAP Topic Source based on a topic
132 * @param topic topic name
133 * @throws IllegalArgumentException if invalid parameters are present
135 public void destroy(String topic);
138 * Destroys all DMAAP Topic Sources
140 public void destroy();
143 * gets an DMAAP Topic Source based on topic name
145 * @param topic the topic name
146 * @return an DMAAP Topic Source with topic name
147 * @throws IllegalArgumentException if an invalid topic is provided
148 * @throws IllegalStateException if the DMAAP Topic Source is an incorrect state
150 public DmaapTopicSource get(String topic);
153 * Provides a snapshot of the DMAAP Topic Sources
155 * @return a list of the DMAAP Topic Sources
157 public List<DmaapTopicSource> inventory();