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 java.io.IOException;
26 import org.json.JSONException;
28 import org.onap.dmaap.dmf.mr.CambriaApiException;
29 import org.onap.dmaap.dmf.mr.beans.DMaaPContext;
30 import org.onap.dmaap.dmf.mr.beans.TopicBean;
31 import org.onap.dmaap.dmf.mr.metabroker.Broker.TopicExistsException;
32 import com.att.nsa.configs.ConfigDbException;
33 import com.att.nsa.security.ReadWriteSecuredResource.AccessDeniedException;
36 * interface provide all the topic related operations
38 * @author anowarul.islam
41 public interface TopicService {
43 * method fetch details of all the topics
46 * @throws JSONException
47 * @throws ConfigDbException
50 void getTopics(DMaaPContext dmaapContext) throws JSONException, ConfigDbException, IOException;
51 void getAllTopics(DMaaPContext dmaapContext) throws JSONException, ConfigDbException, IOException;
54 * method fetch details of specific topic
58 * @throws ConfigDbException
60 * @throws TopicExistsException
62 void getTopic(DMaaPContext dmaapContext, String topicName)
63 throws ConfigDbException, IOException, TopicExistsException;
66 * method used to create the topic
70 * @throws CambriaApiException
71 * @throws TopicExistsException
73 * @throws AccessDeniedException
74 * @throws JSONException
77 void createTopic(DMaaPContext dmaapContext, TopicBean topicBean)
78 throws CambriaApiException, TopicExistsException, IOException, AccessDeniedException;
81 * method used to delete to topic
86 * @throws AccessDeniedException
87 * @throws ConfigDbException
88 * @throws CambriaApiException
89 * @throws TopicExistsException
92 void deleteTopic(DMaaPContext dmaapContext, String topicName)
93 throws IOException, AccessDeniedException, ConfigDbException, CambriaApiException, TopicExistsException;
96 * method provides list of all the publishers associated with a topic
100 * @throws IOException
101 * @throws ConfigDbException
102 * @throws TopicExistsException
104 void getPublishersByTopicName(DMaaPContext dmaapContext, String topicName)
105 throws IOException, ConfigDbException, TopicExistsException;
108 * method provides details of all the consumer associated with a specific
111 * @param dmaapContext
113 * @throws IOException
114 * @throws ConfigDbException
115 * @throws TopicExistsException
117 void getConsumersByTopicName(DMaaPContext dmaapContext, String topicName)
118 throws IOException, ConfigDbException, TopicExistsException;
121 * method provides publishing right to a specific topic
123 * @param dmaapContext
126 * @throws AccessDeniedException
127 * @throws ConfigDbException
128 * @throws IOException
129 * @throws TopicExistsException
131 void permitPublisherForTopic(DMaaPContext dmaapContext, String topicName, String producerId)
132 throws AccessDeniedException, ConfigDbException, IOException, TopicExistsException,CambriaApiException;
135 * method denies any specific publisher from a topic
137 * @param dmaapContext
140 * @throws AccessDeniedException
141 * @throws ConfigDbException
142 * @throws IOException
143 * @throws TopicExistsException
145 void denyPublisherForTopic(DMaaPContext dmaapContext, String topicName, String producerId)
146 throws AccessDeniedException, ConfigDbException, IOException, TopicExistsException,CambriaApiException;
149 * method provide consuming right to a specific user on a topic
151 * @param dmaapContext
154 * @throws AccessDeniedException
155 * @throws ConfigDbException
156 * @throws IOException
157 * @throws TopicExistsException
159 void permitConsumerForTopic(DMaaPContext dmaapContext, String topicName, String consumerId)
160 throws AccessDeniedException, ConfigDbException, IOException, TopicExistsException,CambriaApiException;
163 * method denies a particular user's consuming right on a topic
165 * @param dmaapContext
168 * @throws AccessDeniedException
169 * @throws ConfigDbException
170 * @throws IOException
171 * @throws TopicExistsException
173 void denyConsumerForTopic(DMaaPContext dmaapContext, String topicName, String consumerId)
174 throws AccessDeniedException, ConfigDbException, IOException, TopicExistsException,CambriaApiException;