import java.util.*;
import java.io.*;
-import org.apache.log4j.Logger;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
/**
* Main control point for delivering files to destinations.
* that queue has more files to deliver.
*/
public class Delivery {
- private static Logger logger = Logger.getLogger("org.onap.dmaap.datarouter.node.Delivery");
+ private static EELFLogger logger = EELFManager.getInstance().getLogger(Delivery.class);
private static class DelItem implements Comparable<DelItem> {
private String pubid;
this.pubid = pubid;
this.spool = spool;
}
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ DelItem delItem = (DelItem) o;
+ return Objects.equals(pubid, delItem.pubid) &&
+ Objects.equals(getSpool(), delItem.getSpool());
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(pubid, getSpool());
+ }
}
private double fdstart;
try {
wait(nextcheck + 500 - now);
} catch (Exception e) {
+ logger.error("InterruptedException", e);
}
now = System.currentTimeMillis();
}
}
}
}
+
+ /**
+ * Mark the task in spool a success
+ */
+ public synchronized boolean markTaskSuccess(String spool, String pubId) {
+ boolean succeeded = false;
+ if (spool != null) {
+ DeliveryQueue dq = dqs.get(spool);
+ if (dq != null) {
+ succeeded = dq.markTaskSuccess(pubId);
+ }
+ }
+ return succeeded;
+ }
}