Merge "DR AAF CADI integration"
authorConor Ward <conor.ward@est.tech>
Mon, 1 Apr 2019 15:50:38 +0000 (15:50 +0000)
committerGerrit Code Review <gerrit@onap.org>
Mon, 1 Apr 2019 15:50:38 +0000 (15:50 +0000)
1  2 
datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/DeliveryTask.java
pom.xml

@@@ -64,9 -64,9 +64,10 @@@ public class DeliveryTask implements Ru
      private String feedid;
      private String subid;
      private int attempts;
+     private boolean followRedirects;
      private String[][] hdrs;
      private String newInvocationId;
 +    private long resumeTime;
  
  
      /**
       *                           the base for the file name in the spool directory and is of
       *                           the form <milliseconds since 1970>.<fqdn of initial data router node>
       */
 -    public DeliveryTask(DeliveryTaskHelper deliveryTaskHelper, String pubid) {
 +    DeliveryTask(DeliveryTaskHelper deliveryTaskHelper, String pubid) {
          this.deliveryTaskHelper = deliveryTaskHelper;
          this.pubid = pubid;
          destInfo = deliveryTaskHelper.getDestinationInfo();
          subid = destInfo.getSubId();
+         this.followRedirects = destInfo.isFollowRedirects();
          feedid = destInfo.getLogData();
          spool = destInfo.getSpool();
          String dfn = spool + "/" + pubid;
@@@ -90,7 -91,6 +92,7 @@@
          metafile = new File(mfn);
          boolean monly = destInfo.isMetaDataOnly();
          date = Long.parseLong(pubid.substring(0, pubid.indexOf('.')));
 +        resumeTime = System.currentTimeMillis();
          Vector<String[]> hdrv = new Vector<>();
  
          try (BufferedReader br = new BufferedReader(new FileReader(metafile))) {
                  hdrv.add(new String[]{h, v});
              }
          } catch (Exception e) {
-             loggerDeliveryTask.error("Exception "+e.getStackTrace(),e);
+             loggerDeliveryTask.error("Exception "+ Arrays.toString(e.getStackTrace()), e);
          }
          hdrs = hdrv.toArray(new String[hdrv.size()][]);
          url = deliveryTaskHelper.getDestURL(fileid);
      /**
       * Get the publish ID
       */
 -    public String getPublishId() {
 +    String getPublishId() {
          return (pubid);
      }
  
              }
              deliveryTaskHelper.reportStatus(this, rc, xpubid, rmsg);
          } catch (Exception e) {
-             loggerDeliveryTask.error("Exception " + e.getStackTrace(), e);
+             loggerDeliveryTask.error("Exception " + Arrays.toString(e.getStackTrace()), e);
              deliveryTaskHelper.reportException(this, e);
          }
      }
          } catch (ProtocolException pe) {
              deliveryTaskHelper.reportDeliveryExtra(this, -1L);
              // Rcvd error instead of 100-continue
-             loggerDeliveryTask.error("Exception " + pe.getStackTrace(), pe);
+             loggerDeliveryTask.error("Exception " + Arrays.toString(pe.getStackTrace()), pe);
          }
          return outputStream;
      }
      /**
       * Remove meta and data files
       */
 -    public void clean() {
 +    void clean() {
          datafile.delete();
          metafile.delete();
          eelflogger.info(EelfMsgs.INVOKE, newInvocationId);
          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);
      }
  
      /**
       * Get creation date as encoded in the publish ID.
       */
 -    public long getDate() {
 +    long getDate() {
          return (date);
      }
  
      /**
       * 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);
      }
+     /**
+      * Get the followRedirects for this delivery task
+      */
+     public boolean getFollowRedirects() {
+         return(followRedirects);
+     }
  }
diff --combined pom.xml
+++ b/pom.xml
@@@ -55,6 -55,7 +55,7 @@@
          <thoughtworks.version>1.4.10</thoughtworks.version>
          <google.guava.version>26.0-jre</google.guava.version>
          <qos.logback.version>1.2.3</qos.logback.version>
+         <aaf-cadi-aaf.version>2.1.10</aaf-cadi-aaf.version>
          <snapshotNexusPath>/content/repositories/snapshots/</snapshotNexusPath>
          <releaseNexusPath>/content/repositories/releases/</releaseNexusPath>
          <stagingNexusPath>/content/repositories/staging/</stagingNexusPath>
@@@ -63,7 -64,7 +64,7 @@@
          <skip.docker.tag>true</skip.docker.tag>
          <skip.docker.push>true</skip.docker.push>
          <commons-codec.version>1.10</commons-codec.version>
 -        <sonar.coverage.exclusions>datarouter-prov/src/main/java/org/onap/dmaap/datarouter/reports/*</sonar.coverage.exclusions>
 +        <sonar.exclusions>**/src/main/java/org/onap/dmaap/datarouter/reports/**</sonar.exclusions>
      </properties>
      <modules>
          <module>datarouter-prov</module>
                          <exclude>**/generated-sources/**</exclude>
                          <exclude>**/yang-gen/**</exclude>
                          <exclude>**/pax/**</exclude>
 +                        <exclude>**/src/main/java/org/onap/dmaap/datarouter/reports/**</exclude>
                      </excludes>
                  </configuration>
                  <executions>