[DMAAP-48] Initial code import
[dmaap/datarouter.git] / datarouter-node / src / main / java / com / att / research / datarouter / node / DeliveryQueueHelper.java
diff --git a/datarouter-node/src/main/java/com/att/research/datarouter/node/DeliveryQueueHelper.java b/datarouter-node/src/main/java/com/att/research/datarouter/node/DeliveryQueueHelper.java
new file mode 100644 (file)
index 0000000..770db1d
--- /dev/null
@@ -0,0 +1,89 @@
+/*******************************************************************************\r
+ * ============LICENSE_START==================================================\r
+ * * org.onap.dmaap\r
+ * * ===========================================================================\r
+ * * Copyright © 2017 AT&T Intellectual Property. All rights reserved.\r
+ * * ===========================================================================\r
+ * * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * * you may not use this file except in compliance with the License.\r
+ * * You may obtain a copy of the License at\r
+ * * \r
+ *  *      http://www.apache.org/licenses/LICENSE-2.0\r
+ * * \r
+ *  * Unless required by applicable law or agreed to in writing, software\r
+ * * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * * See the License for the specific language governing permissions and\r
+ * * limitations under the License.\r
+ * * ============LICENSE_END====================================================\r
+ * *\r
+ * * ECOMP is a trademark and service mark of AT&T Intellectual Property.\r
+ * *\r
+ ******************************************************************************/\r
+\r
+\r
+package com.att.research.datarouter.node;\r
+\r
+/**\r
+ *     Interface to allow independent testing of the DeliveryQueue code\r
+ *     <p>\r
+ *     This interface represents all of the configuration information and\r
+ *     feedback mechanisms that a delivery queue needs.\r
+ */\r
+public interface       DeliveryQueueHelper     {\r
+       /**\r
+        *      Get the timeout (milliseconds) before retrying after an initial delivery failure\r
+        */\r
+       public long getInitFailureTimer();\r
+       /**\r
+        *      Get the ratio between timeouts on consecutive delivery attempts\r
+        */\r
+       public double   getFailureBackoff();\r
+       /**\r
+        *      Get the maximum timeout (milliseconds) between delivery attempts\r
+        */\r
+       public long     getMaxFailureTimer();\r
+       /**\r
+        *      Get the expiration timer (milliseconds) for deliveries\r
+        */\r
+       public long     getExpirationTimer();\r
+       /**\r
+        *      Get the maximum number of file delivery attempts before checking\r
+        *      if another queue has work to be performed.\r
+        */\r
+       public int getFairFileLimit();\r
+       /**\r
+        *      Get the maximum amount of time spent delivering files before checking if another queue has work to be performed.\r
+        */\r
+       public long getFairTimeLimit();\r
+       /**\r
+        *      Get the URL for delivering a file\r
+        *      @param dest     The destination information for the file to be delivered.\r
+        *      @param fileid   The file id for the file to be delivered.\r
+        *      @return The URL for delivering the file (typically, dest.getURL() + "/" + fileid).\r
+        */\r
+       public String   getDestURL(DestInfo dest, String fileid);\r
+       /**\r
+        *      Forget redirections associated with a subscriber\r
+        *      @param  dest    Destination information to forget\r
+        */\r
+       public void     handleUnreachable(DestInfo dest);\r
+       /**\r
+        *      Post redirection for a subscriber\r
+        *      @param  dest    Destination information to update\r
+        *      @param  location        Location given by subscriber\r
+        *      @param  fileid  File ID of request\r
+        *      @return true if this 3xx response is retryable, otherwise, false.\r
+        */\r
+       public boolean  handleRedirection(DestInfo dest, String location, String fileid);\r
+       /**\r
+        *      Should I handle 3xx responses differently than 4xx responses?\r
+        */\r
+       public boolean  isFollowRedirects();\r
+       /**\r
+        *      Get the feed ID for a subscription\r
+        *      @param subid    The subscription ID\r
+        *      @return The feed ID\r
+        */\r
+       public String getFeedId(String subid);\r
+}\r