1 /*******************************************************************************
2 * ============LICENSE_START=======================================================
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
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=========================================================
19 * ECOMP is a trademark and service mark of AT&T Intellectual Property.
21 *******************************************************************************/
22 package org.onap.dmaap.dmf.mr.service;
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;
32 import java.io.IOException;
35 * interface provide all the topic related operations
37 * @author anowarul.islam
40 public interface TopicService {
42 * method fetch details of all the topics
45 * @throws JSONException
46 * @throws ConfigDbException
49 void getTopics(DMaaPContext dmaapContext) throws JSONException, ConfigDbException, IOException;
50 void getAllTopics(DMaaPContext dmaapContext) throws JSONException, ConfigDbException, IOException;
53 * method fetch details of specific topic
57 * @throws ConfigDbException
59 * @throws TopicExistsException
61 void getTopic(DMaaPContext dmaapContext, String topicName)
62 throws ConfigDbException, IOException, TopicExistsException;
65 * method used to create the topic
69 * @throws CambriaApiException
70 * @throws TopicExistsException
72 * @throws AccessDeniedException
73 * @throws JSONException
76 void createTopic(DMaaPContext dmaapContext, TopicBean topicBean)
77 throws CambriaApiException, TopicExistsException, IOException, AccessDeniedException;
80 * method used to delete to topic
85 * @throws AccessDeniedException
86 * @throws ConfigDbException
87 * @throws CambriaApiException
88 * @throws TopicExistsException
91 void deleteTopic(DMaaPContext dmaapContext, String topicName)
92 throws IOException, AccessDeniedException, ConfigDbException, CambriaApiException, TopicExistsException;
95 * method provides list of all the publishers associated with a topic
100 * @throws ConfigDbException
101 * @throws TopicExistsException
103 void getPublishersByTopicName(DMaaPContext dmaapContext, String topicName)
104 throws IOException, ConfigDbException, TopicExistsException;
107 * method provides details of all the consumer associated with a specific
110 * @param dmaapContext
112 * @throws IOException
113 * @throws ConfigDbException
114 * @throws TopicExistsException
116 void getConsumersByTopicName(DMaaPContext dmaapContext, String topicName)
117 throws IOException, ConfigDbException, TopicExistsException;
120 * method provides publishing right to a specific topic
122 * @param dmaapContext
125 * @throws AccessDeniedException
126 * @throws ConfigDbException
127 * @throws IOException
128 * @throws TopicExistsException
130 void permitPublisherForTopic(DMaaPContext dmaapContext, String topicName, String producerId)
131 throws AccessDeniedException, ConfigDbException, IOException, TopicExistsException,CambriaApiException;
134 * method denies any specific publisher from a topic
136 * @param dmaapContext
139 * @throws AccessDeniedException
140 * @throws ConfigDbException
141 * @throws IOException
142 * @throws TopicExistsException
144 void denyPublisherForTopic(DMaaPContext dmaapContext, String topicName, String producerId)
145 throws AccessDeniedException, ConfigDbException, IOException, TopicExistsException,CambriaApiException;
148 * method provide consuming right to a specific user on a topic
150 * @param dmaapContext
153 * @throws AccessDeniedException
154 * @throws ConfigDbException
155 * @throws IOException
156 * @throws TopicExistsException
158 void permitConsumerForTopic(DMaaPContext dmaapContext, String topicName, String consumerId)
159 throws AccessDeniedException, ConfigDbException, IOException, TopicExistsException,CambriaApiException;
162 * method denies a particular user's consuming right on a topic
164 * @param dmaapContext
167 * @throws AccessDeniedException
168 * @throws ConfigDbException
169 * @throws IOException
170 * @throws TopicExistsException
172 void denyConsumerForTopic(DMaaPContext dmaapContext, String topicName, String consumerId)
173 throws AccessDeniedException, ConfigDbException, IOException, TopicExistsException,CambriaApiException;