bump the version
[dmaap/messagerouter/msgrtr.git] / src / main / java / com / att / 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 com.att.dmf.mr.service;
23
24 import java.io.IOException;
25
26 import org.json.JSONException;
27
28 import com.att.dmf.mr.CambriaApiException;
29 import com.att.dmf.mr.beans.DMaaPContext;
30 import com.att.dmf.mr.beans.TopicBean;
31 import com.att.dmf.mr.metabroker.Broker.TopicExistsException;
32 import com.att.nsa.configs.ConfigDbException;
33 import com.att.nsa.security.ReadWriteSecuredResource.AccessDeniedException;
34
35 /**
36  * interface provide all the topic related operations
37  * 
38  * @author anowarul.islam
39  *
40  */
41 public interface TopicService {
42         /**
43          * method fetch details of all the topics
44          * 
45          * @param dmaapContext
46          * @throws JSONException
47          * @throws ConfigDbException
48          * @throws IOException
49          */
50         void getTopics(DMaaPContext dmaapContext) throws JSONException, ConfigDbException, IOException;
51         void getAllTopics(DMaaPContext dmaapContext) throws JSONException, ConfigDbException, IOException;
52
53         /**
54          * method fetch details of specific topic
55          * 
56          * @param dmaapContext
57          * @param topicName
58          * @throws ConfigDbException
59          * @throws IOException
60          * @throws TopicExistsException
61          */
62         void getTopic(DMaaPContext dmaapContext, String topicName)
63                         throws ConfigDbException, IOException, TopicExistsException;
64
65         /**
66          * method used to create the topic
67          * 
68          * @param dmaapContext
69          * @param topicBean
70          * @throws CambriaApiException
71          * @throws TopicExistsException
72          * @throws IOException
73          * @throws AccessDeniedException
74          * @throws JSONException 
75          */
76
77         void createTopic(DMaaPContext dmaapContext, TopicBean topicBean)
78                         throws CambriaApiException, TopicExistsException, IOException, AccessDeniedException;
79
80         /**
81          * method used to delete to topic
82          * 
83          * @param dmaapContext
84          * @param topicName
85          * @throws IOException
86          * @throws AccessDeniedException
87          * @throws ConfigDbException
88          * @throws CambriaApiException
89          * @throws TopicExistsException
90          */
91
92         void deleteTopic(DMaaPContext dmaapContext, String topicName)
93                         throws IOException, AccessDeniedException, ConfigDbException, CambriaApiException, TopicExistsException;
94
95         /**
96          * method provides list of all the publishers associated with a topic
97          * 
98          * @param dmaapContext
99          * @param topicName
100          * @throws IOException
101          * @throws ConfigDbException
102          * @throws TopicExistsException
103          */
104         void getPublishersByTopicName(DMaaPContext dmaapContext, String topicName)
105                         throws IOException, ConfigDbException, TopicExistsException;
106
107         /**
108          * method provides details of all the consumer associated with a specific
109          * topic
110          * 
111          * @param dmaapContext
112          * @param topicName
113          * @throws IOException
114          * @throws ConfigDbException
115          * @throws TopicExistsException
116          */
117         void getConsumersByTopicName(DMaaPContext dmaapContext, String topicName)
118                         throws IOException, ConfigDbException, TopicExistsException;
119
120         /**
121          * method provides publishing right to a specific topic
122          * 
123          * @param dmaapContext
124          * @param topicName
125          * @param producerId
126          * @throws AccessDeniedException
127          * @throws ConfigDbException
128          * @throws IOException
129          * @throws TopicExistsException
130          */
131         void permitPublisherForTopic(DMaaPContext dmaapContext, String topicName, String producerId)
132                         throws AccessDeniedException, ConfigDbException, IOException, TopicExistsException,CambriaApiException;
133
134         /**
135          * method denies any specific publisher from a topic
136          * 
137          * @param dmaapContext
138          * @param topicName
139          * @param producerId
140          * @throws AccessDeniedException
141          * @throws ConfigDbException
142          * @throws IOException
143          * @throws TopicExistsException
144          */
145         void denyPublisherForTopic(DMaaPContext dmaapContext, String topicName, String producerId)
146                         throws AccessDeniedException, ConfigDbException, IOException, TopicExistsException,CambriaApiException;
147
148         /**
149          * method provide consuming right to a specific user on a topic
150          * 
151          * @param dmaapContext
152          * @param topicName
153          * @param consumerId
154          * @throws AccessDeniedException
155          * @throws ConfigDbException
156          * @throws IOException
157          * @throws TopicExistsException
158          */
159         void permitConsumerForTopic(DMaaPContext dmaapContext, String topicName, String consumerId)
160                         throws AccessDeniedException, ConfigDbException, IOException, TopicExistsException,CambriaApiException;
161
162         /**
163          * method denies a particular user's consuming right on a topic
164          * 
165          * @param dmaapContext
166          * @param topicName
167          * @param consumerId
168          * @throws AccessDeniedException
169          * @throws ConfigDbException
170          * @throws IOException
171          * @throws TopicExistsException
172          */
173         void denyConsumerForTopic(DMaaPContext dmaapContext, String topicName, String consumerId)
174                         throws AccessDeniedException, ConfigDbException, IOException, TopicExistsException,CambriaApiException;
175
176 }