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 DeliveryTask code.
\r
30 * This interface represents all the configuraiton information and
\r
31 * feedback mechanisms that a delivery task needs.
\r
34 public interface DeliveryTaskHelper {
\r
36 * Report that a delivery attempt failed due to an exception (like can't connect to remote host)
\r
37 * @param task The task that failed
\r
38 * @param exception The exception that occurred
\r
40 public void reportException(DeliveryTask task, Exception exception);
\r
42 * Report that a delivery attempt completed (successfully or unsuccessfully)
\r
43 * @param task The task that failed
\r
44 * @param status The HTTP status
\r
45 * @param xpubid The publish ID from the far end (if any)
\r
46 * @param location The redirection location for a 3XX response
\r
48 public void reportStatus(DeliveryTask task, int status, String xpubid, String location);
\r
50 * Report that a delivery attempt either failed while sending data or that an error was returned instead of a 100 Continue.
\r
51 * @param task The task that failed
\r
52 * @param sent The number of bytes sent or -1 if an error was returned instead of 100 Continue.
\r
54 public void reportDeliveryExtra(DeliveryTask task, long sent);
\r
56 * Get the destination information for the delivery queue
\r
57 * @return The destination information
\r
59 public DestInfo getDestInfo();
\r
61 * Given a file ID, get the URL to deliver to
\r
62 * @param fileid The file id
\r
63 * @return The URL to deliver to
\r
65 public String getDestURL(String fileid);
\r
67 * Get the feed ID for a subscription
\r
68 * @param subid The subscription ID
\r
69 * @return The feed iD
\r
71 public String getFeedId(String subid);
\r