X-Git-Url: https://gerrit.onap.org/r/gitweb?p=dmaap%2Fdatarouter.git;a=blobdiff_plain;f=datarouter-node%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fdmaap%2Fdatarouter%2Fnode%2FDeliveryTask.java;h=46c46675fc9e92afb71f1551c03b0643352dfe00;hp=b64396bc9f678f2731b243fdfed97aaaf0d62691;hb=875daad0a737115702458d1850ddee87ac4cea30;hpb=5775de7b0fc84a29511dc4a1a480c3ab32da2ade diff --git a/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/DeliveryTask.java b/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/DeliveryTask.java index b64396bc..46c46675 100644 --- a/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/DeliveryTask.java +++ b/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/DeliveryTask.java @@ -67,6 +67,7 @@ public class DeliveryTask implements Runnable, Comparable { private boolean followRedirects; private String[][] hdrs; private String newInvocationId; + private long resumeTime; /** @@ -77,7 +78,7 @@ public class DeliveryTask implements Runnable, Comparable { * the base for the file name in the spool directory and is of * the form . */ - public DeliveryTask(DeliveryTaskHelper deliveryTaskHelper, String pubid) { + DeliveryTask(DeliveryTaskHelper deliveryTaskHelper, String pubid) { this.deliveryTaskHelper = deliveryTaskHelper; this.pubid = pubid; destInfo = deliveryTaskHelper.getDestinationInfo(); @@ -91,6 +92,7 @@ public class DeliveryTask implements Runnable, Comparable { metafile = new File(mfn); boolean monly = destInfo.isMetaDataOnly(); date = Long.parseLong(pubid.substring(0, pubid.indexOf('.'))); + resumeTime = System.currentTimeMillis(); Vector hdrv = new Vector<>(); try (BufferedReader br = new BufferedReader(new FileReader(metafile))) { @@ -167,7 +169,7 @@ public class DeliveryTask implements Runnable, Comparable { /** * Get the publish ID */ - public String getPublishId() { + String getPublishId() { return (pubid); } @@ -334,7 +336,7 @@ public class DeliveryTask implements Runnable, Comparable { /** * Remove meta and data files */ - public void clean() { + void clean() { datafile.delete(); metafile.delete(); eelflogger.info(EelfMsgs.INVOKE, newInvocationId); @@ -342,10 +344,24 @@ public class DeliveryTask implements Runnable, Comparable { hdrs = null; } + /** + * Set the resume time for a delivery task. + */ + void setResumeTime(long resumeTime) { + this.resumeTime = resumeTime; + } + + /** + * Get the resume time for a delivery task. + */ + long getResumeTime() { + return resumeTime; + } + /** * Has this delivery task been cleaned? */ - public boolean isCleaned() { + boolean isCleaned() { return (hdrs == null); } @@ -359,7 +375,7 @@ public class DeliveryTask implements Runnable, Comparable { /** * Get creation date as encoded in the publish ID. */ - public long getDate() { + long getDate() { return (date); } @@ -373,42 +389,42 @@ public class DeliveryTask implements Runnable, Comparable { /** * Get the content type */ - public String getCType() { + String getCType() { return (ctype); } /** * Get the method */ - public String getMethod() { + String getMethod() { return (method); } /** * Get the file ID */ - public String getFileId() { + String getFileId() { return (fileid); } /** * Get the number of delivery attempts */ - public int getAttempts() { + int getAttempts() { return (attempts); } /** * Get the (space delimited list of) subscription ID for this delivery task */ - public String getSubId() { + String getSubId() { return (subid); } /** * Get the feed ID for this delivery task */ - public String getFeedId() { + String getFeedId() { return (feedid); }