X-Git-Url: https://gerrit.onap.org/r/gitweb?p=dmaap%2Fdatarouter.git;a=blobdiff_plain;f=datarouter-prov%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fdmaap%2Fdatarouter%2Fprovisioning%2Fbeans%2FExpiryRecord.java;h=d812036ab2e631f568b46f9a8cb09aaffe9be4b8;hp=8e841e6858997c7f156b85b873bd6806bbca98fa;hb=bc1df610cddfb558cf6bde90c269b4af59768648;hpb=a60d80ff7bfae8a152c950486d9a1877628e13a4 diff --git a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/ExpiryRecord.java b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/ExpiryRecord.java index 8e841e68..d812036a 100644 --- a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/ExpiryRecord.java +++ b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/ExpiryRecord.java @@ -46,19 +46,31 @@ public class ExpiryRecord extends BaseLogRecord { private int attempts; private String reason; + /** + * ExpiryRecord constructor. + * @param pp string array of ExpiryRecord attributes + * @throws ParseException in case of parse error + */ public ExpiryRecord(String[] pp) throws ParseException { super(pp); String fileid = pp[5]; - if (fileid.lastIndexOf('/') >= 0) + if (fileid.lastIndexOf('/') >= 0) { fileid = fileid.substring(fileid.lastIndexOf('/') + 1); + } this.subid = Integer.parseInt(pp[4]); this.fileid = fileid; this.attempts = Integer.parseInt(pp[10]); this.reason = pp[9]; - if (!reason.equals("notRetryable") && !reason.equals("retriesExhausted") && !reason.equals("diskFull")) + if (!reason.equals("notRetryable") && !reason.equals("retriesExhausted") && !reason.equals("diskFull")) { this.reason = "other"; + } } + /** + * ExpiryRecord constructor from ResultSet. + * @param rs ResultSet of ExpiryREcord attributes + * @throws SQLException in case of error with SQL statement + */ public ExpiryRecord(ResultSet rs) throws SQLException { super(rs); this.subid = rs.getInt("DELIVERY_SUBID"); @@ -99,6 +111,11 @@ public class ExpiryRecord extends BaseLogRecord { this.reason = reason; } + /** + * Method to reorder LOGJSONObject. + * @param jo LOGJSONObject + * @return LOGJSONObject + */ public LOGJSONObject reOrderObject(LOGJSONObject jo) { LinkedHashMap logrecordObj = new LinkedHashMap<>(); @@ -122,7 +139,7 @@ public class ExpiryRecord extends BaseLogRecord { jo.put("expiryReason", reason); jo.put("attempts", attempts); - return this.reOrderObject(jo); + return reOrderObject(jo); } @Override