Code style cleanup for prov authz and beans
[dmaap/datarouter.git] / datarouter-prov / src / main / java / org / onap / dmaap / datarouter / provisioning / beans / ExpiryRecord.java
index 9e6987a..d812036 100644 (file)
@@ -46,19 +46,31 @@ public class ExpiryRecord extends BaseLogRecord {
     private int attempts;\r
     private String reason;\r
 \r
+    /**\r
+     * ExpiryRecord constructor.\r
+     * @param pp string array of ExpiryRecord attributes\r
+     * @throws ParseException in case of parse error\r
+     */\r
     public ExpiryRecord(String[] pp) throws ParseException {\r
         super(pp);\r
         String fileid = pp[5];\r
-        if (fileid.lastIndexOf('/') >= 0)\r
+        if (fileid.lastIndexOf('/') >= 0) {\r
             fileid = fileid.substring(fileid.lastIndexOf('/') + 1);\r
+        }\r
         this.subid = Integer.parseInt(pp[4]);\r
         this.fileid = fileid;\r
         this.attempts = Integer.parseInt(pp[10]);\r
         this.reason = pp[9];\r
-        if (!reason.equals("notRetryable") && !reason.equals("retriesExhausted") && !reason.equals("diskFull"))\r
+        if (!reason.equals("notRetryable") && !reason.equals("retriesExhausted") && !reason.equals("diskFull")) {\r
             this.reason = "other";\r
+        }\r
     }\r
 \r
+    /**\r
+     * ExpiryRecord constructor from ResultSet.\r
+     * @param rs ResultSet of ExpiryREcord attributes\r
+     * @throws SQLException in case of error with SQL statement\r
+     */\r
     public ExpiryRecord(ResultSet rs) throws SQLException {\r
         super(rs);\r
         this.subid = rs.getInt("DELIVERY_SUBID");\r
@@ -99,8 +111,13 @@ public class ExpiryRecord extends BaseLogRecord {
         this.reason = reason;\r
     }\r
 \r
+    /**\r
+     * Method to reorder LOGJSONObject.\r
+     * @param jo LOGJSONObject\r
+     * @return LOGJSONObject\r
+     */\r
     public LOGJSONObject reOrderObject(LOGJSONObject jo) {\r
-        LinkedHashMap<String, Object> logrecordObj = new LinkedHashMap<String, Object>();\r
+        LinkedHashMap<String, Object> logrecordObj = new LinkedHashMap<>();\r
 \r
         logrecordObj.put("expiryReason", jo.get("expiryReason"));\r
         logrecordObj.put("publishId", jo.get("publishId"));\r
@@ -112,8 +129,7 @@ public class ExpiryRecord extends BaseLogRecord {
         logrecordObj.put("date", jo.get("date"));\r
         logrecordObj.put("contentLength", jo.get("contentLength"));\r
 \r
-        LOGJSONObject newjo = new LOGJSONObject(logrecordObj);\r
-        return newjo;\r
+        return new LOGJSONObject(logrecordObj);\r
     }\r
 \r
     @Override\r
@@ -123,8 +139,7 @@ public class ExpiryRecord extends BaseLogRecord {
         jo.put("expiryReason", reason);\r
         jo.put("attempts", attempts);\r
 \r
-        LOGJSONObject newjo = this.reOrderObject(jo);\r
-        return newjo;\r
+        return reOrderObject(jo);\r
     }\r
 \r
     @Override\r