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 Source Factory
29 public interface UebTopicSourceFactory {
32 * Creates an UEB Topic Source based on properties files
34 * @param properties Properties containing initialization values
36 * @return an UEB Topic Source
37 * @throws IllegalArgumentException if invalid parameters are present
39 public List<UebTopicSource> build(Properties properties);
42 * Instantiates a new UEB Topic Source
44 * @param servers list of servers
45 * @param topic topic name
46 * @param apiKey API Key
47 * @param apiSecret API Secret
48 * @param consumerGroup Consumer Group
49 * @param consumerInstance Consumer Instance
50 * @param fetchTimeout Read Fetch Timeout
51 * @param fetchLimit Fetch Limit
52 * @param managed is this source endpoint managed?
54 * @return an UEB Topic Source
55 * @throws IllegalArgumentException if invalid parameters are present
57 public UebTopicSource build(List<String> servers, String topic, String apiKey, String apiSecret,
58 String consumerGroup, String consumerInstance, int fetchTimeout, int fetchLimit, boolean managed,
59 boolean useHttps, boolean allowSelfSignedCerts);
62 * Instantiates a new UEB Topic Source
64 * @param servers list of servers
65 * @param topic topic name
66 * @param apiKey API Key
67 * @param apiSecret API Secret
69 * @return an UEB Topic Source
70 * @throws IllegalArgumentException if invalid parameters are present
72 public UebTopicSource build(List<String> servers, String topic, String apiKey, String apiSecret);
75 * Instantiates a new UEB Topic Source
77 * @param servers list of servers
78 * @param topic topic name
80 * @return an UEB Topic Source
81 * @throws IllegalArgumentException if invalid parameters are present
83 public UebTopicSource build(List<String> servers, String topic);
86 * Destroys an UEB Topic Source based on a topic
88 * @param topic topic name
89 * @throws IllegalArgumentException if invalid parameters are present
91 public void destroy(String topic);
94 * Destroys all UEB Topic Sources
96 public void destroy();
99 * gets an UEB Topic Source based on topic name
101 * @param topic the topic name
102 * @return an UEB Topic Source with topic name
103 * @throws IllegalArgumentException if an invalid topic is provided
104 * @throws IllegalStateException if the UEB Topic Source is an incorrect state
106 public UebTopicSource get(String topic);
109 * Provides a snapshot of the UEB Topic Sources
111 * @return a list of the UEB Topic Sources
113 public List<UebTopicSource> inventory();