2 * ===============================LICENSE_START======================================
\r
4 * ================================================================================
\r
5 * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
\r
6 * ================================================================================
\r
7 * Licensed under the Apache License, Version 2.0 (the "License");
\r
8 * you may not use this file except in compliance with the License.
\r
9 * You may obtain a copy of the License at
\r
11 * http://www.apache.org/licenses/LICENSE-2.0
\r
13 * Unless required by applicable law or agreed to in writing, software
\r
14 * distributed under the License is distributed on an "AS IS" BASIS,
\r
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
16 * See the License for the specific language governing permissions and
\r
17 * limitations under the License.
\r
18 * ============================LICENSE_END===========================================
\r
21 package org.openecomp.dcae.apod.analytics.dmaap.service.publisher;
\r
23 import java.util.List;
\r
27 * DMaaP MR Publisher Queue handles back pressure in case DMaaP MR Publisher topic
\r
28 * is offline for some reason. It does so by having a recovery queue which keeps
\r
29 * messages in order in case there is temporary interruption in DMaaP Publisher
\r
32 * @author Rajiv Singla . Creation Date: 11/1/2016.
\r
34 public interface DMaaPMRPublisherQueue {
\r
38 * Add batchMessages to Batch Queue
\r
41 * @param batchMessages messages that needs to be added to batch queue
\r
42 * @return current size of batch queue. Throws {@link IllegalStateException}
\r
43 * if batch queue does not have enough space
\r
45 int addBatchMessages(List<String> batchMessages);
\r
50 * Add recoverable messages to Recoverable Queue
\r
53 * @param recoverableMessages messages that needs to be added to recoverable queue
\r
54 * @return current size of the recoverable queue. Throws {@link IllegalStateException}
\r
55 * if recoverable queue does not have enough space
\r
57 int addRecoverableMessages(List<String> recoverableMessages);
\r
61 * Get messages that need to be published to DMaaP topic. Messages in recoverable
\r
62 * queue are appended if present.
\r
65 * @return List of messages from both batch and recovery queue
\r
67 List<String> getMessageForPublishing();
\r
71 * Remaining capacity of Batch Queue
\r
74 * @return Remaining Batch Queue Size
\r
76 int getBatchQueueRemainingSize();
\r
80 * Remaining capacity of Recovery Queue
\r
83 * @return Remaining Recovery Queue Size
\r
85 int getRecoveryQueueRemainingSize();
\r