1 /*******************************************************************************
\r
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
20 * * ECOMP is a trademark and service mark of AT&T Intellectual Property.
\r
22 ******************************************************************************/
\r
25 package org.onap.dmaap.datarouter.node;
\r
28 * Interface to allow independent testing of the DeliveryQueue code
\r
30 * This interface represents all of the configuration information and
\r
31 * feedback mechanisms that a delivery queue needs.
\r
33 public interface DeliveryQueueHelper {
\r
35 * Get the timeout (milliseconds) before retrying after an initial delivery failure
\r
37 public long getInitFailureTimer();
\r
39 * Get the ratio between timeouts on consecutive delivery attempts
\r
41 public double getFailureBackoff();
\r
43 * Get the maximum timeout (milliseconds) between delivery attempts
\r
45 public long getMaxFailureTimer();
\r
47 * Get the expiration timer (milliseconds) for deliveries
\r
49 public long getExpirationTimer();
\r
51 * Get the maximum number of file delivery attempts before checking
\r
52 * if another queue has work to be performed.
\r
54 public int getFairFileLimit();
\r
56 * Get the maximum amount of time spent delivering files before checking if another queue has work to be performed.
\r
58 public long getFairTimeLimit();
\r
60 * Get the URL for delivering a file
\r
61 * @param dest The destination information for the file to be delivered.
\r
62 * @param fileid The file id for the file to be delivered.
\r
63 * @return The URL for delivering the file (typically, dest.getURL() + "/" + fileid).
\r
65 public String getDestURL(DestInfo dest, String fileid);
\r
67 * Forget redirections associated with a subscriber
\r
68 * @param dest Destination information to forget
\r
70 public void handleUnreachable(DestInfo dest);
\r
72 * Post redirection for a subscriber
\r
73 * @param dest Destination information to update
\r
74 * @param location Location given by subscriber
\r
75 * @param fileid File ID of request
\r
76 * @return true if this 3xx response is retryable, otherwise, false.
\r
78 public boolean handleRedirection(DestInfo dest, String location, String fileid);
\r
80 * Should I handle 3xx responses differently than 4xx responses?
\r
82 public boolean isFollowRedirects();
\r
84 * Get the feed ID for a subscription
\r
85 * @param subid The subscription ID
\r
86 * @return The feed ID
\r
88 public String getFeedId(String subid);
\r