DMAAP-MR - Merge MR repos
[dmaap/messagerouter/messageservice.git] / src / main / java / org / onap / dmaap / dmf / mr / service / TopicService.java
1 /*******************************************************************************
2  *  ============LICENSE_START=======================================================
3  *  org.onap.dmaap
4  *  ================================================================================
5  *  Copyright © 2017 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  *        http://www.apache.org/licenses/LICENSE-2.0
11 *  
12  *  Unless required by applicable law or agreed to in writing, software
13  *  distributed under the License is distributed on an "AS IS" BASIS,
14  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  *  See the License for the specific language governing permissions and
16  *  limitations under the License.
17  *  ============LICENSE_END=========================================================
18  *  
19  *  ECOMP is a trademark and service mark of AT&T Intellectual Property.
20  *  
21  *******************************************************************************/
22 package org.onap.dmaap.dmf.mr.service;
23
24 import com.att.nsa.configs.ConfigDbException;
25 import com.att.nsa.security.ReadWriteSecuredResource.AccessDeniedException;
26 import org.json.JSONException;
27 import org.onap.dmaap.dmf.mr.CambriaApiException;
28 import org.onap.dmaap.dmf.mr.beans.DMaaPContext;
29 import org.onap.dmaap.dmf.mr.beans.TopicBean;
30 import org.onap.dmaap.dmf.mr.metabroker.Broker.TopicExistsException;
31
32 import java.io.IOException;
33
34 /**
35  * interface provide all the topic related operations
36  * 
37  * @author anowarul.islam
38  *
39  */
40 public interface TopicService {
41         /**
42          * method fetch details of all the topics
43          * 
44          * @param dmaapContext
45          * @throws JSONException
46          * @throws ConfigDbException
47          * @throws IOException
48          */
49         void getTopics(DMaaPContext dmaapContext) throws JSONException, ConfigDbException, IOException;
50         void getAllTopics(DMaaPContext dmaapContext) throws JSONException, ConfigDbException, IOException;
51
52         /**
53          * method fetch details of specific topic
54          * 
55          * @param dmaapContext
56          * @param topicName
57          * @throws ConfigDbException
58          * @throws IOException
59          * @throws TopicExistsException
60          */
61         void getTopic(DMaaPContext dmaapContext, String topicName)
62                         throws ConfigDbException, IOException, TopicExistsException;
63
64         /**
65          * method used to create the topic
66          * 
67          * @param dmaapContext
68          * @param topicBean
69          * @throws CambriaApiException
70          * @throws TopicExistsException
71          * @throws IOException
72          * @throws AccessDeniedException
73          * @throws JSONException 
74          */
75
76         void createTopic(DMaaPContext dmaapContext, TopicBean topicBean)
77                         throws CambriaApiException, TopicExistsException, IOException, AccessDeniedException;
78
79         /**
80          * method used to delete to topic
81          * 
82          * @param dmaapContext
83          * @param topicName
84          * @throws IOException
85          * @throws AccessDeniedException
86          * @throws ConfigDbException
87          * @throws CambriaApiException
88          * @throws TopicExistsException
89          */
90
91         void deleteTopic(DMaaPContext dmaapContext, String topicName)
92                         throws IOException, AccessDeniedException, ConfigDbException, CambriaApiException, TopicExistsException;
93
94         /**
95          * method provides list of all the publishers associated with a topic
96          * 
97          * @param dmaapContext
98          * @param topicName
99          * @throws IOException
100          * @throws ConfigDbException
101          * @throws TopicExistsException
102          */
103         void getPublishersByTopicName(DMaaPContext dmaapContext, String topicName)
104                         throws IOException, ConfigDbException, TopicExistsException;
105
106         /**
107          * method provides details of all the consumer associated with a specific
108          * topic
109          * 
110          * @param dmaapContext
111          * @param topicName
112          * @throws IOException
113          * @throws ConfigDbException
114          * @throws TopicExistsException
115          */
116         void getConsumersByTopicName(DMaaPContext dmaapContext, String topicName)
117                         throws IOException, ConfigDbException, TopicExistsException;
118
119         /**
120          * method provides publishing right to a specific topic
121          * 
122          * @param dmaapContext
123          * @param topicName
124          * @param producerId
125          * @throws AccessDeniedException
126          * @throws ConfigDbException
127          * @throws IOException
128          * @throws TopicExistsException
129          */
130         void permitPublisherForTopic(DMaaPContext dmaapContext, String topicName, String producerId)
131                         throws AccessDeniedException, ConfigDbException, IOException, TopicExistsException,CambriaApiException;
132
133         /**
134          * method denies any specific publisher from a topic
135          * 
136          * @param dmaapContext
137          * @param topicName
138          * @param producerId
139          * @throws AccessDeniedException
140          * @throws ConfigDbException
141          * @throws IOException
142          * @throws TopicExistsException
143          */
144         void denyPublisherForTopic(DMaaPContext dmaapContext, String topicName, String producerId)
145                         throws AccessDeniedException, ConfigDbException, IOException, TopicExistsException,CambriaApiException;
146
147         /**
148          * method provide consuming right to a specific user on a topic
149          * 
150          * @param dmaapContext
151          * @param topicName
152          * @param consumerId
153          * @throws AccessDeniedException
154          * @throws ConfigDbException
155          * @throws IOException
156          * @throws TopicExistsException
157          */
158         void permitConsumerForTopic(DMaaPContext dmaapContext, String topicName, String consumerId)
159                         throws AccessDeniedException, ConfigDbException, IOException, TopicExistsException,CambriaApiException;
160
161         /**
162          * method denies a particular user's consuming right on a topic
163          * 
164          * @param dmaapContext
165          * @param topicName
166          * @param consumerId
167          * @throws AccessDeniedException
168          * @throws ConfigDbException
169          * @throws IOException
170          * @throws TopicExistsException
171          */
172         void denyConsumerForTopic(DMaaPContext dmaapContext, String topicName, String consumerId)
173                         throws AccessDeniedException, ConfigDbException, IOException, TopicExistsException,CambriaApiException;
174
175 }