a6b5b1d911eebdac4eeeae1b5081c24bc8b15501
[policy/common.git] /
1 /*
2  * ============LICENSE_START=======================================================
3  * ONAP
4  * ================================================================================
5  * Copyright (C) 2019 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
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
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=========================================================
19  */
20
21 package org.onap.policy.common.endpoints.event.comm.bus;
22
23 import java.util.List;
24 import java.util.Properties;
25 import org.onap.policy.common.endpoints.event.comm.Topic;
26 import org.onap.policy.common.endpoints.event.comm.bus.internal.BusTopicParams;
27
28 /**
29  * Topic Base Factory.
30  *
31  * @param <T> Type.
32  */
33 public interface TopicBaseFactory<T extends Topic> {
34
35     /**
36      * build a TopicBase instance.
37      *
38      * @param properties properties.
39      * @return T instance.
40      */
41     List<T> build(Properties properties);
42
43     /**
44      * build a TopicBase instance.
45      *
46      * @param servers servers.
47      * @param topic topic.
48      * @param managed managed.
49      * @return T instance.
50      */
51     T build(List<String> servers, String topic, boolean managed);
52
53     /**
54      * Construct an instance of an endpoint.
55      *
56      * @param param parameters
57      * @return an instance of T.
58      */
59     T build(BusTopicParams param);
60
61     /**
62      * destroy TopicBase instance.
63      * @param topic topic.
64      */
65     void destroy(String topic);
66
67     /**
68      * destroy.
69      */
70     void destroy();
71
72     /**
73      * get T instance.
74      *
75      * @param topic topic.
76      * @return T instance.
77      */
78     T get(String topic);
79
80     /**
81      * inventory of T instances.
82      *
83      * @return T instance list.
84      */
85     List<T> inventory();
86 }