Fix checkstyle contridictions on datarouter node 49/92249/1
authoregernug <gerard.nugent@est.tech>
Tue, 30 Jul 2019 08:15:58 +0000 (08:15 +0000)
committeregernug <gerard.nugent@est.tech>
Tue, 30 Jul 2019 08:15:58 +0000 (08:15 +0000)
Change-Id: Ib1e2fc3c8129698ec77290d8c05ae18056c93831
Issue-ID: DMAAP-1250
Signed-off-by: egernug <gerard.nugent@est.tech>
datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/DeliveryQueue.java
datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/DeliveryQueueHelper.java
datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeMain.java
datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/ProvData.java
datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/StatusLog.java
datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/eelf/AuditFilter.java
datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/eelf/DebugFilter.java
datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/eelf/EelfMsgs.java
datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/eelf/ErrorFilter.java
datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/eelf/MetricsFilter.java

index a3df26a..b7699e5 100644 (file)
@@ -26,19 +26,21 @@ package org.onap.dmaap.datarouter.node;
 
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
 
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
-import java.io.*;
-import java.util.*;
+import java.io.File;
+import java.util.Arrays;
+import java.util.Hashtable;
+import java.util.Vector;
 import org.jetbrains.annotations.Nullable;
 
 /**
  * Mechanism for monitoring and controlling delivery of files to a destination.
 import org.jetbrains.annotations.Nullable;
 
 /**
  * Mechanism for monitoring and controlling delivery of files to a destination.
- * <p>
- * The DeliveryQueue class maintains lists of DeliveryTasks for a single
+ *
+ * <p>The DeliveryQueue class maintains lists of DeliveryTasks for a single
  * destination (a subscription or another data router node) and assigns
  * delivery threads to try to deliver them.  It also maintains a delivery
  * status that causes it to back off on delivery attempts after a failure.
  * destination (a subscription or another data router node) and assigns
  * delivery threads to try to deliver them.  It also maintains a delivery
  * status that causes it to back off on delivery attempts after a failure.
- * <p>
- * If the most recent delivery result was a failure, then no more attempts
+ *
+ * <p>If the most recent delivery result was a failure, then no more attempts
  * will be made for a period of time.  Initially, and on the first failure
  * following a success, this delay will be DeliveryQueueHelper.getInitFailureTimer() (milliseconds).
  * If, after this delay, additional failures occur, each failure will
  * will be made for a period of time.  Initially, and on the first failure
  * following a success, this delay will be DeliveryQueueHelper.getInitFailureTimer() (milliseconds).
  * If, after this delay, additional failures occur, each failure will
@@ -50,8 +52,8 @@ import org.jetbrains.annotations.Nullable;
  * delivery fails while the delay was active, it will not change the delay
  * or change the duration of any subsequent delay.
  * If, however, it succeeds, it will cancel the delay.
  * delivery fails while the delay was active, it will not change the delay
  * or change the duration of any subsequent delay.
  * If, however, it succeeds, it will cancel the delay.
- * <p>
- * The queue maintains 3 collections of files to deliver: A todo list of
+ *
+ * <p>The queue maintains 3 collections of files to deliver: A todo list of
  * files that will be attempted, a working set of files that are being
  * attempted, and a retry set of files that were attempted and failed.
  * Whenever the todo list is empty and needs to be refilled, a scan of the
  * files that will be attempted, a working set of files that are being
  * attempted, and a retry set of files that were attempted and failed.
  * Whenever the todo list is empty and needs to be refilled, a scan of the
@@ -62,13 +64,14 @@ import org.jetbrains.annotations.Nullable;
  * If, when a DeliveryTask is about to be removed from the todo list, its
  * age exceeds DeliveryQueueHelper.getExpirationTimer(), then it is instead
  * marked as expired.
  * If, when a DeliveryTask is about to be removed from the todo list, its
  * age exceeds DeliveryQueueHelper.getExpirationTimer(), then it is instead
  * marked as expired.
- * <p>
- * A delivery queue also maintains a skip flag.  This flag is true if the
+ *
+ * <p>A delivery queue also maintains a skip flag.  This flag is true if the
  * failure timer is active or if no files are found in a directory scan.
  */
 public class DeliveryQueue implements Runnable, DeliveryTaskHelper {
     private static EELFLogger logger = EELFManager.getInstance().getLogger(DeliveryQueue.class);
     private DeliveryQueueHelper deliveryQueueHelper;
  * failure timer is active or if no files are found in a directory scan.
  */
 public class DeliveryQueue implements Runnable, DeliveryTaskHelper {
     private static EELFLogger logger = EELFManager.getInstance().getLogger(DeliveryQueue.class);
     private DeliveryQueueHelper deliveryQueueHelper;
+
     private DestInfo destinationInfo;
     private Hashtable<String, DeliveryTask> working = new Hashtable<>();
     private Hashtable<String, DeliveryTask> retry = new Hashtable<>();
     private DestInfo destinationInfo;
     private Hashtable<String, DeliveryTask> working = new Hashtable<>();
     private Hashtable<String, DeliveryTask> retry = new Hashtable<>();
@@ -107,7 +110,8 @@ public class DeliveryQueue implements Runnable, DeliveryTaskHelper {
         if (dt.isCleaned()) {
             return (0);
         }
         if (dt.isCleaned()) {
             return (0);
         }
-        StatusLog.logExp(dt.getPublishId(), dt.getFeedId(), dt.getSubId(), dt.getURL(), dt.getMethod(), dt.getCType(), dt.getLength(), "diskFull", dt.getAttempts());
+        StatusLog.logExp(dt.getPublishId(), dt.getFeedId(), dt.getSubId(), dt.getURL(),
+                dt.getMethod(), dt.getCType(), dt.getLength(), "diskFull", dt.getAttempts());
         dt.clean();
         return (dt.getLength());
     }
         dt.clean();
         return (dt.getLength());
     }
@@ -148,7 +152,7 @@ public class DeliveryQueue implements Runnable, DeliveryTaskHelper {
             if (failduration == 0) {
                 if (destinationInfo.isPrivilegedSubscriber()) {
                     failduration = deliveryQueueHelper.getWaitForFileProcessFailureTimer();
             if (failduration == 0) {
                 if (destinationInfo.isPrivilegedSubscriber()) {
                     failduration = deliveryQueueHelper.getWaitForFileProcessFailureTimer();
-                } else{
+                } else {
                     failduration = deliveryQueueHelper.getInitFailureTimer();
                 }
             }
                     failduration = deliveryQueueHelper.getInitFailureTimer();
                 }
             }
@@ -224,7 +228,7 @@ public class DeliveryQueue implements Runnable, DeliveryTaskHelper {
     }
 
     /**
     }
 
     /**
-     * Create a delivery queue for a given destination info
+     * Create a delivery queue for a given destination info.
      */
     DeliveryQueue(DeliveryQueueHelper deliveryQueueHelper, DestInfo destinationInfo) {
         this.deliveryQueueHelper = deliveryQueueHelper;
      */
     DeliveryQueue(DeliveryQueueHelper deliveryQueueHelper, DestInfo destinationInfo) {
         this.deliveryQueueHelper = deliveryQueueHelper;
@@ -234,82 +238,93 @@ public class DeliveryQueue implements Runnable, DeliveryTaskHelper {
     }
 
     /**
     }
 
     /**
-     * Update the destination info for this delivery queue
+     * Update the destination info for this delivery queue.
      */
     public void config(DestInfo destinationInfo) {
         this.destinationInfo = destinationInfo;
     }
 
     /**
      */
     public void config(DestInfo destinationInfo) {
         this.destinationInfo = destinationInfo;
     }
 
     /**
-     * Get the dest info
+     * Get the dest info.
      */
     public DestInfo getDestinationInfo() {
         return (destinationInfo);
     }
 
     /**
      */
     public DestInfo getDestinationInfo() {
         return (destinationInfo);
     }
 
     /**
-     * Get the config manager
+     * Get the config manager.
      */
     public DeliveryQueueHelper getConfig() {
         return (deliveryQueueHelper);
     }
 
     /**
      */
     public DeliveryQueueHelper getConfig() {
         return (deliveryQueueHelper);
     }
 
     /**
-     * Exceptional condition occurred during delivery
+     * Exceptional condition occurred during delivery.
      */
     public void reportDeliveryExtra(DeliveryTask task, long sent) {
         StatusLog.logDelExtra(task.getPublishId(), task.getFeedId(), task.getSubId(), task.getLength(), sent);
     }
 
     /**
      */
     public void reportDeliveryExtra(DeliveryTask task, long sent) {
         StatusLog.logDelExtra(task.getPublishId(), task.getFeedId(), task.getSubId(), task.getLength(), sent);
     }
 
     /**
-     * Message too old to deliver
+     * Message too old to deliver.
      */
     void reportExpiry(DeliveryTask task) {
      */
     void reportExpiry(DeliveryTask task) {
-        StatusLog.logExp(task.getPublishId(), task.getFeedId(), task.getSubId(), task.getURL(), task.getMethod(), task.getCType(), task.getLength(), "retriesExhausted", task.getAttempts());
+        StatusLog.logExp(task.getPublishId(), task.getFeedId(), task.getSubId(), task.getURL(), task.getMethod(),
+                task.getCType(), task.getLength(), "retriesExhausted", task.getAttempts());
         markExpired(task);
     }
 
     /**
         markExpired(task);
     }
 
     /**
-     * Completed a delivery attempt
+     * Completed a delivery attempt.
      */
     public void reportStatus(DeliveryTask task, int status, String xpubid, String location) {
         if (status < 300) {
      */
     public void reportStatus(DeliveryTask task, int status, String xpubid, String location) {
         if (status < 300) {
-            StatusLog.logDel(task.getPublishId(), task.getFeedId(), task.getSubId(), task.getURL(), task.getMethod(), task.getCType(), task.getLength(), destinationInfo.getAuthUser(), status, xpubid);
+            StatusLog.logDel(task.getPublishId(), task.getFeedId(), task.getSubId(), task.getURL(), task.getMethod(),
+                    task.getCType(), task.getLength(), destinationInfo.getAuthUser(), status, xpubid);
             if (destinationInfo.isPrivilegedSubscriber()) {
             if (destinationInfo.isPrivilegedSubscriber()) {
-                task.setResumeTime(System.currentTimeMillis() + deliveryQueueHelper.getWaitForFileProcessFailureTimer());
+                task.setResumeTime(System.currentTimeMillis()
+                                           + deliveryQueueHelper.getWaitForFileProcessFailureTimer());
                 markFailWithRetry(task);
             } else {
                 markSuccess(task);
             }
         } else if (status < 400 && deliveryQueueHelper.isFollowRedirects()) {
                 markFailWithRetry(task);
             } else {
                 markSuccess(task);
             }
         } else if (status < 400 && deliveryQueueHelper.isFollowRedirects()) {
-            StatusLog.logDel(task.getPublishId(), task.getFeedId(), task.getSubId(), task.getURL(), task.getMethod(), task.getCType(), task.getLength(), destinationInfo.getAuthUser(), status, location);
+            StatusLog.logDel(task.getPublishId(), task.getFeedId(), task.getSubId(), task.getURL(), task.getMethod(),
+                    task.getCType(), task.getLength(), destinationInfo.getAuthUser(), status, location);
             if (deliveryQueueHelper.handleRedirection(destinationInfo, location, task.getFileId())) {
                 markRedirect(task);
             } else {
             if (deliveryQueueHelper.handleRedirection(destinationInfo, location, task.getFileId())) {
                 markRedirect(task);
             } else {
-                StatusLog.logExp(task.getPublishId(), task.getFeedId(), task.getSubId(), task.getURL(), task.getMethod(), task.getCType(), task.getLength(), "notRetryable", task.getAttempts());
+                StatusLog.logExp(task.getPublishId(), task.getFeedId(), task.getSubId(), task.getURL(),
+                        task.getMethod(), task.getCType(), task.getLength(), "notRetryable", task.getAttempts());
                 markFailNoRetry(task);
             }
                 markFailNoRetry(task);
             }
-        } else if (status < 500 && status != 429) {         // Status 429 is the standard response for Too Many Requests and indicates that a file needs to be delivered again at a later time.
-            StatusLog.logDel(task.getPublishId(), task.getFeedId(), task.getSubId(), task.getURL(), task.getMethod(), task.getCType(), task.getLength(), destinationInfo.getAuthUser(), status, location);
-            StatusLog.logExp(task.getPublishId(), task.getFeedId(), task.getSubId(), task.getURL(), task.getMethod(), task.getCType(), task.getLength(), "notRetryable", task.getAttempts());
+        } else if (status < 500 && status != 429) {
+            // Status 429 is the standard response for Too Many Requests and indicates
+            // that a file needs to be delivered again at a later time.
+            StatusLog.logDel(task.getPublishId(), task.getFeedId(), task.getSubId(), task.getURL(), task.getMethod(),
+                    task.getCType(), task.getLength(), destinationInfo.getAuthUser(), status, location);
+            StatusLog.logExp(task.getPublishId(), task.getFeedId(), task.getSubId(), task.getURL(), task.getMethod(),
+                    task.getCType(), task.getLength(), "notRetryable", task.getAttempts());
             markFailNoRetry(task);
         } else {
             markFailNoRetry(task);
         } else {
-            StatusLog.logDel(task.getPublishId(), task.getFeedId(), task.getSubId(), task.getURL(), task.getMethod(), task.getCType(), task.getLength(), destinationInfo.getAuthUser(), status, location);
+            StatusLog.logDel(task.getPublishId(), task.getFeedId(), task.getSubId(), task.getURL(), task.getMethod(),
+                    task.getCType(), task.getLength(), destinationInfo.getAuthUser(), status, location);
             markFailWithRetry(task);
         }
     }
 
     /**
             markFailWithRetry(task);
         }
     }
 
     /**
-     * Delivery failed by reason of an exception
+     * Delivery failed by reason of an exception.
      */
     public void reportException(DeliveryTask task, Exception exception) {
      */
     public void reportException(DeliveryTask task, Exception exception) {
-        StatusLog.logDel(task.getPublishId(), task.getFeedId(), task.getSubId(), task.getURL(), task.getMethod(), task.getCType(), task.getLength(), destinationInfo.getAuthUser(), -1, exception.toString());
+        StatusLog.logDel(task.getPublishId(), task.getFeedId(), task.getSubId(), task.getURL(), task.getMethod(),
+                task.getCType(), task.getLength(), destinationInfo.getAuthUser(), -1, exception.toString());
         deliveryQueueHelper.handleUnreachable(destinationInfo);
         markFailWithRetry(task);
     }
 
     /**
         deliveryQueueHelper.handleUnreachable(destinationInfo);
         markFailWithRetry(task);
     }
 
     /**
-     * Get the feed ID for a subscription
+     * Get the feed ID for a subscription.
      *
      * @param subid The subscription ID
      * @return The feed ID
      *
      * @param subid The subscription ID
      * @return The feed ID
@@ -319,14 +334,14 @@ public class DeliveryQueue implements Runnable, DeliveryTaskHelper {
     }
 
     /**
     }
 
     /**
-     * Get the URL to deliver a message to given the file ID
+     * Get the URL to deliver a message to given the file ID.
      */
     public String getDestURL(String fileid) {
         return (deliveryQueueHelper.getDestURL(destinationInfo, fileid));
     }
 
     /**
      */
     public String getDestURL(String fileid) {
         return (deliveryQueueHelper.getDestURL(destinationInfo, fileid));
     }
 
     /**
-     * Deliver files until there's a failure or there are no more
+     * Deliver files until there's a failure or there are no more.
      * files to deliver
      */
     public void run() {
      * files to deliver
      */
     public void run() {
@@ -343,21 +358,21 @@ public class DeliveryQueue implements Runnable, DeliveryTaskHelper {
     }
 
     /**
     }
 
     /**
-     * Is there no work to do for this queue right now?
+     * Is there no work to do for this queue right now?.
      */
     synchronized boolean isSkipSet() {
         return (peekNext() == null);
     }
 
     /**
      */
     synchronized boolean isSkipSet() {
         return (peekNext() == null);
     }
 
     /**
-     * Reset the retry timer
+     * Reset the retry timer.
      */
     void resetQueue() {
         resumetime = System.currentTimeMillis();
     }
 
     /**
      */
     void resetQueue() {
         resumetime = System.currentTimeMillis();
     }
 
     /**
-     * Get task if in queue and mark as success
+     * Get task if in queue and mark as success.
      */
     boolean markTaskSuccess(String pubId) {
         DeliveryTask task = working.get(pubId);
      */
     boolean markTaskSuccess(String pubId) {
         DeliveryTask task = working.get(pubId);
@@ -375,6 +390,7 @@ public class DeliveryQueue implements Runnable, DeliveryTaskHelper {
         }
         return false;
     }
         }
         return false;
     }
+
     private void scanForNextTask(String[] files) {
         for (String fname : files) {
             String pubId = getPubId(fname);
     private void scanForNextTask(String[] files) {
         for (String fname : files) {
             String pubId = getPubId(fname);
index 5cf5fa4..5427faf 100644 (file)
@@ -26,33 +26,33 @@ package org.onap.dmaap.datarouter.node;
 
 /**
  * Interface to allow independent testing of the DeliveryQueue code
 
 /**
  * Interface to allow independent testing of the DeliveryQueue code
- * <p>
- * This interface represents all of the configuration information and
+ *
+ * <p>This interface represents all of the configuration information and
  * feedback mechanisms that a delivery queue needs.
  */
 public interface DeliveryQueueHelper {
     /**
  * feedback mechanisms that a delivery queue needs.
  */
 public interface DeliveryQueueHelper {
     /**
-     * Get the timeout (milliseconds) before retrying after an initial delivery failure
+     * Get the timeout (milliseconds) before retrying after an initial delivery failure.
      */
     long getInitFailureTimer();
 
     /**
      */
     long getInitFailureTimer();
 
     /**
-     * Get the timeout before retrying after delivery and wait for file processing
+     * Get the timeout before retrying after delivery and wait for file processing.
      */
     long getWaitForFileProcessFailureTimer();
 
     /**
      */
     long getWaitForFileProcessFailureTimer();
 
     /**
-     * Get the ratio between timeouts on consecutive delivery attempts
+     * Get the ratio between timeouts on consecutive delivery attempts.
      */
     double getFailureBackoff();
 
     /**
      */
     double getFailureBackoff();
 
     /**
-     * Get the maximum timeout (milliseconds) between delivery attempts
+     * Get the maximum timeout (milliseconds) between delivery attempts.
      */
     long getMaxFailureTimer();
 
     /**
      */
     long getMaxFailureTimer();
 
     /**
-     * Get the expiration timer (milliseconds) for deliveries
+     * Get the expiration timer (milliseconds) for deliveries.
      */
     long getExpirationTimer();
 
      */
     long getExpirationTimer();
 
@@ -68,7 +68,7 @@ public interface DeliveryQueueHelper {
     long getFairTimeLimit();
 
     /**
     long getFairTimeLimit();
 
     /**
-     * Get the URL for delivering a file
+     * Get the URL for delivering a file.
      *
      * @param destinationInfo   The destination information for the file to be delivered.
      * @param fileid The file id for the file to be delivered.
      *
      * @param destinationInfo   The destination information for the file to be delivered.
      * @param fileid The file id for the file to be delivered.
@@ -77,14 +77,14 @@ public interface DeliveryQueueHelper {
     String getDestURL(DestInfo destinationInfo, String fileid);
 
     /**
     String getDestURL(DestInfo destinationInfo, String fileid);
 
     /**
-     * Forget redirections associated with a subscriber
+     * Forget redirections associated with a subscriber.
      *
      * @param    destinationInfo    Destination information to forget
      */
     void handleUnreachable(DestInfo destinationInfo);
 
     /**
      *
      * @param    destinationInfo    Destination information to forget
      */
     void handleUnreachable(DestInfo destinationInfo);
 
     /**
-     * Post redirection for a subscriber
+     * Post redirection for a subscriber.
      *
      * @param    destinationInfo    Destination information to update
      * @param    location    Location given by subscriber
      *
      * @param    destinationInfo    Destination information to update
      * @param    location    Location given by subscriber
@@ -94,12 +94,12 @@ public interface DeliveryQueueHelper {
     boolean handleRedirection(DestInfo destinationInfo, String location, String fileid);
 
     /**
     boolean handleRedirection(DestInfo destinationInfo, String location, String fileid);
 
     /**
-     * Should I handle 3xx responses differently than 4xx responses?
+     * Should I handle 3xx responses differently than 4xx responses?.
      */
     boolean isFollowRedirects();
 
     /**
      */
     boolean isFollowRedirects();
 
     /**
-     * Get the feed ID for a subscription
+     * Get the feed ID for a subscription.
      *
      * @param subid The subscription ID
      * @return The feed ID
      *
      * @param subid The subscription ID
      * @return The feed ID
index 6086168..988b05e 100644 (file)
@@ -60,6 +60,7 @@ public class NodeMain {
     /**
      * Reset the retry timer for a subscription.
      */
     /**
      * Reset the retry timer for a subscription.
      */
+
     static void resetQueue(String subid, String ip) {
         delivery.resetQueue(nodeConfigManager.getSpoolDir(subid, ip));
     }
     static void resetQueue(String subid, String ip) {
         delivery.resetQueue(nodeConfigManager.getSpoolDir(subid, ip));
     }
@@ -155,7 +156,8 @@ public class NodeMain {
             server.start();
             nodeMainLogger.debug("NODE00006 Node Server started-" + server.getState());
         } catch (Exception e) {
             server.start();
             nodeMainLogger.debug("NODE00006 Node Server started-" + server.getState());
         } catch (Exception e) {
-            nodeMainLogger.error("NODE00006 Jetty failed to start. Reporting will we unavailable: " + e.getMessage(), e);
+            nodeMainLogger.error("NODE00006 Jetty failed to start. Reporting will we unavailable: "
+                                         + e.getMessage(), e);
         }
         server.join();
         nodeMainLogger.debug("NODE00007 Node Server joined - " + server.getState());
         }
         server.join();
         nodeMainLogger.debug("NODE00007 Node Server joined - " + server.getState());
index 03e952c..2c20580 100644 (file)
@@ -54,6 +54,7 @@ import org.onap.dmaap.datarouter.node.eelf.EelfMsgs;
 public class ProvData {
 
     private static final String FEED_ID = "feedid";
 public class ProvData {
 
     private static final String FEED_ID = "feedid";
+
     private static EELFLogger eelfLogger = EELFManager.getInstance().getLogger(ProvData.class);
     private NodeConfig.ProvNode[] pn;
     private NodeConfig.ProvParam[] pp;
     private static EELFLogger eelfLogger = EELFManager.getInstance().getLogger(ProvData.class);
     private NodeConfig.ProvNode[] pn;
     private NodeConfig.ProvParam[] pp;
@@ -84,8 +85,8 @@ public class ProvData {
         try {
             JSONTokener jtx = new JSONTokener(reader);
             JSONObject jcfg = new JSONObject(jtx);
         try {
             JSONTokener jtx = new JSONTokener(reader);
             JSONObject jcfg = new JSONObject(jtx);
-            char c = jtx.nextClean();
-            if (c != '\0') {
+            char cch = jtx.nextClean();
+            if (cch != '\0') {
                 throw new JSONException("Spurious characters following configuration");
             }
             reader.close();
                 throw new JSONException("Spurious characters following configuration");
             }
             reader.close();
index a9a48ad..8d59ebe 100644 (file)
@@ -46,6 +46,7 @@ public class StatusLog {
     private static StatusLog instance = new StatusLog();
     private SimpleDateFormat filedate = new SimpleDateFormat("-yyyyMMddHHmm");
 
     private static StatusLog instance = new StatusLog();
     private SimpleDateFormat filedate = new SimpleDateFormat("-yyyyMMddHHmm");
 
+
     private String prefix = "logs/events";
     private String suffix = ".log";
     private String plainfile;
     private String prefix = "logs/events";
     private String suffix = ".log";
     private String plainfile;
@@ -158,8 +159,8 @@ public class StatusLog {
         instance.log(
                 "PUB|" + pubid + "|" + feedid + "|" + requrl + "|" + method + "|" + ctype + "|" + clen + "|" + srcip
                         + "|" + user + "|" + status);
         instance.log(
                 "PUB|" + pubid + "|" + feedid + "|" + requrl + "|" + method + "|" + ctype + "|" + clen + "|" + srcip
                         + "|" + user + "|" + status);
-        eelfLogger.info("PUB|" + pubid + "|" + feedid + "|" + requrl + "|" + method + "|" + ctype + "|" + clen + "|" + srcip
-                                + "|" + user + "|" + status);
+        eelfLogger.info("PUB|" + pubid + "|" + feedid + "|" + requrl + "|" + method + "|" + ctype + "|"
+                                + clen + "|" + srcip + "|" + user + "|" + status);
     }
 
     /**
     }
 
     /**
@@ -180,8 +181,8 @@ public class StatusLog {
             long rcvd, String srcip, String user, String error) {
         instance.log("PBF|" + pubid + "|" + feedid + "|" + requrl + "|" + method + "|" + ctype + "|" + clen + "|" + rcvd
                 + "|" + srcip + "|" + user + "|" + error);
             long rcvd, String srcip, String user, String error) {
         instance.log("PBF|" + pubid + "|" + feedid + "|" + requrl + "|" + method + "|" + ctype + "|" + clen + "|" + rcvd
                 + "|" + srcip + "|" + user + "|" + error);
-        eelfLogger.info("PBF|" + pubid + "|" + feedid + "|" + requrl + "|" + method + "|" + ctype + "|" + clen + "|" + rcvd
-                                + "|" + srcip + "|" + user + "|" + error);
+        eelfLogger.info("PBF|" + pubid + "|" + feedid + "|" + requrl + "|" + method + "|" + ctype + "|" + clen
+                                + "|" + rcvd + "|" + srcip + "|" + user + "|" + error);
     }
 
     /**
     }
 
     /**
@@ -206,8 +207,8 @@ public class StatusLog {
         instance.log(
                 "DEL|" + pubid + "|" + feedid + "|" + subid + "|" + requrl + "|" + method + "|" + ctype + "|" + clen
                         + "|" + user + "|" + status + "|" + xpubid);
         instance.log(
                 "DEL|" + pubid + "|" + feedid + "|" + subid + "|" + requrl + "|" + method + "|" + ctype + "|" + clen
                         + "|" + user + "|" + status + "|" + xpubid);
-        eelfLogger.info("DEL|" + pubid + "|" + feedid + "|" + subid + "|" + requrl + "|" + method + "|" + ctype + "|" + clen
-                                + "|" + user + "|" + status + "|" + xpubid);
+        eelfLogger.info("DEL|" + pubid + "|" + feedid + "|" + subid + "|" + requrl + "|" + method + "|"
+                                + ctype + "|" + clen + "|" + user + "|" + status + "|" + xpubid);
     }
 
     /**
     }
 
     /**
@@ -231,8 +232,8 @@ public class StatusLog {
         instance.log(
                 "EXP|" + pubid + "|" + feedid + "|" + subid + "|" + requrl + "|" + method + "|" + ctype + "|" + clen
                         + "|" + reason + "|" + attempts);
         instance.log(
                 "EXP|" + pubid + "|" + feedid + "|" + subid + "|" + requrl + "|" + method + "|" + ctype + "|" + clen
                         + "|" + reason + "|" + attempts);
-        eelfLogger.info("EXP|" + pubid + "|" + feedid + "|" + subid + "|" + requrl + "|" + method + "|" + ctype + "|" + clen
-                                + "|" + reason + "|" + attempts);
+        eelfLogger.info("EXP|" + pubid + "|" + feedid + "|" + subid + "|" + requrl + "|" + method + "|"
+                                + ctype + "|" + clen + "|" + reason + "|" + attempts);
     }
 
     /**
     }
 
     /**
index a278c2e..db02ecb 100644 (file)
@@ -28,8 +28,9 @@ import ch.qos.logback.core.spi.FilterReply;
 public class AuditFilter extends Filter<ILoggingEvent> {
     @Override
     public FilterReply decide(ILoggingEvent event) {
 public class AuditFilter extends Filter<ILoggingEvent> {
     @Override
     public FilterReply decide(ILoggingEvent event) {
-        if (event.getMessage().contains("DEL|") || event.getMessage().contains("PUB|") || event.getMessage().contains("PBF|")
-                                                        || event.getMessage().contains("EXP|") || event.getMessage().contains("DLX|")) {
+        if (event.getMessage().contains("DEL|") || event.getMessage().contains("PUB|")
+                    || event.getMessage().contains("PBF|") || event.getMessage().contains("EXP|")
+                    || event.getMessage().contains("DLX|")) {
             return FilterReply.ACCEPT;
         } else {
             return FilterReply.DENY;
             return FilterReply.ACCEPT;
         } else {
             return FilterReply.DENY;
index 58cd170..23e5612 100644 (file)
@@ -17,6 +17,7 @@
  * SPDX-License-Identifier: Apache-2.0
  * ============LICENSE_END=========================================================
  */
  * SPDX-License-Identifier: Apache-2.0
  * ============LICENSE_END=========================================================
  */
+
 package org.onap.dmaap.datarouter.node.eelf;
 
 import ch.qos.logback.classic.Level;
 package org.onap.dmaap.datarouter.node.eelf;
 
 import ch.qos.logback.classic.Level;
index 756d01a..203c969 100644 (file)
@@ -20,6 +20,7 @@
  * * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  * *
  ******************************************************************************/
  * * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  * *
  ******************************************************************************/
+
 package org.onap.dmaap.datarouter.node.eelf;
 
 import com.att.eelf.i18n.EELFResolvableErrorEnum;
 package org.onap.dmaap.datarouter.node.eelf;
 
 import com.att.eelf.i18n.EELFResolvableErrorEnum;
@@ -28,12 +29,13 @@ import com.att.eelf.i18n.EELFResourceManager;
 public enum EelfMsgs implements EELFResolvableErrorEnum {
 
     /**
 public enum EelfMsgs implements EELFResolvableErrorEnum {
 
     /**
-     * Application message prints user (accepts one argument)
+     * Application message prints user (accepts one argument).
      */
      */
+
     MESSAGE_WITH_BEHALF,
 
     /**
     MESSAGE_WITH_BEHALF,
 
     /**
-     * Application message prints user and FeedID (accepts two arguments)
+     * Application message prints user and FeedID (accepts two arguments).
      */
 
     MESSAGE_WITH_BEHALF_AND_FEEDID,
      */
 
     MESSAGE_WITH_BEHALF_AND_FEEDID,
@@ -45,13 +47,13 @@ public enum EelfMsgs implements EELFResolvableErrorEnum {
     INVOKE,
 
     /**
     INVOKE,
 
     /**
-     * Application message prints keystore file error in EELF errors log
+     * Application message prints keystore file error in EELF errors log.
      */
 
     MESSAGE_KEYSTORE_LOAD_ERROR,
 
     /**
      */
 
     MESSAGE_KEYSTORE_LOAD_ERROR,
 
     /**
-     * Application message prints Error extracting my name from my keystore file
+     * Application message prints Error extracting my name from my keystore file.
      */
 
     MESSAGE_KEYSORE_NAME_ERROR,
      */
 
     MESSAGE_KEYSORE_NAME_ERROR,
@@ -64,21 +66,21 @@ public enum EelfMsgs implements EELFResolvableErrorEnum {
     MESSAGE_PARSING_ERROR,
 
     /**
     MESSAGE_PARSING_ERROR,
 
     /**
-     * Application message printsConfiguration failed
+     * Application message printsConfiguration failed.
      */
 
 
     MESSAGE_CONF_FAILED,
 
     /**
      */
 
 
     MESSAGE_CONF_FAILED,
 
     /**
-     * Application message prints Bad provisioning server URL
+     * Application message prints Bad provisioning server URL.
      */
 
 
     MESSAGE_BAD_PROV_URL,
 
     /**
      */
 
 
     MESSAGE_BAD_PROV_URL,
 
     /**
-     * Application message prints Unable to fetch canonical name from keystore file
+     * Application message prints Unable to fetch canonical name from keystore file.
      */
 
 
      */
 
 
index 84f71cf..8d387f6 100644 (file)
@@ -17,6 +17,7 @@
  * SPDX-License-Identifier: Apache-2.0
  * ============LICENSE_END=========================================================
  */
  * SPDX-License-Identifier: Apache-2.0
  * ============LICENSE_END=========================================================
  */
+
 package org.onap.dmaap.datarouter.node.eelf;
 
 import ch.qos.logback.classic.Level;
 package org.onap.dmaap.datarouter.node.eelf;
 
 import ch.qos.logback.classic.Level;
@@ -28,7 +29,8 @@ import ch.qos.logback.core.spi.FilterReply;
 public class ErrorFilter extends Filter<ILoggingEvent> {
     @Override
     public FilterReply decide(ILoggingEvent event) {
 public class ErrorFilter extends Filter<ILoggingEvent> {
     @Override
     public FilterReply decide(ILoggingEvent event) {
-        if ((event.getLevel().equals(Level.ERROR) || event.getLevel().equals(Level.WARN))  && !event.getMessage().contains("org.eclipse.jetty")) {
+        if ((event.getLevel().equals(Level.ERROR) || event.getLevel().equals(Level.WARN))
+                    && !event.getMessage().contains("org.eclipse.jetty")) {
             return FilterReply.ACCEPT;
         } else {
             return FilterReply.DENY;
             return FilterReply.ACCEPT;
         } else {
             return FilterReply.DENY;
index f3e27fe..af82079 100644 (file)
@@ -29,8 +29,10 @@ import ch.qos.logback.core.spi.FilterReply;
 public class MetricsFilter extends Filter<ILoggingEvent> {
     @Override
     public FilterReply decide(ILoggingEvent event) {
 public class MetricsFilter extends Filter<ILoggingEvent> {
     @Override
     public FilterReply decide(ILoggingEvent event) {
-        if (event.getLevel().equals(Level.INFO) && !event.getMessage().contains("org.eclipse.jetty") && !event.getLoggerName().contains("org.eclipse.jetty")) {
-            if (!event.getMessage().contains("DEL|") && !event.getMessage().contains("PUB|") && !event.getMessage().contains(
+        if (event.getLevel().equals(Level.INFO) && !event.getMessage().contains("org.eclipse.jetty")
+                    && !event.getLoggerName().contains("org.eclipse.jetty")) {
+            if (!event.getMessage().contains("DEL|") && !event.getMessage().contains("PUB|")
+                        && !event.getMessage().contains(
                     "PBF|") && !event.getMessage().contains("EXP|") && !event.getMessage().contains("DLX|")) {
                 return FilterReply.ACCEPT;
             }
                     "PBF|") && !event.getMessage().contains("EXP|") && !event.getMessage().contains("DLX|")) {
                 return FilterReply.ACCEPT;
             }