Update project structure to org.onap
[dmaap/datarouter.git] / datarouter-node / src / main / java / org / onap / dmaap / datarouter / node / DeliveryTaskHelper.java
1 /*******************************************************************************\r
2  * ============LICENSE_START==================================================\r
3  * * org.onap.dmaap\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
10  * * \r
11  *  *      http://www.apache.org/licenses/LICENSE-2.0\r
12  * * \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
19  * *\r
20  * * ECOMP is a trademark and service mark of AT&T Intellectual Property.\r
21  * *\r
22  ******************************************************************************/\r
23 \r
24 \r
25 package org.onap.dmaap.datarouter.node;\r
26 \r
27 /**\r
28  *      Interface to allow independent testing of the DeliveryTask code.\r
29  *      <p>\r
30  *      This interface represents all the configuraiton information and\r
31  *      feedback mechanisms that a delivery task needs.\r
32  */\r
33 \r
34 public interface DeliveryTaskHelper     {\r
35         /**\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
39          */\r
40         public void reportException(DeliveryTask task, Exception exception);\r
41         /**\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
47          */\r
48         public void reportStatus(DeliveryTask task, int status, String xpubid, String location);\r
49         /**\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
53          */\r
54         public void reportDeliveryExtra(DeliveryTask task, long sent);\r
55         /**\r
56          *      Get the destination information for the delivery queue\r
57          *      @return The destination information\r
58          */\r
59         public DestInfo getDestInfo();\r
60         /**\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
64          */\r
65         public String   getDestURL(String fileid);\r
66         /**\r
67          *      Get the feed ID for a subscription\r
68          *      @param subid    The subscription ID\r
69          *      @return The feed iD\r
70          */\r
71         public String   getFeedId(String subid);\r
72 }\r