X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=datarouter-prov%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fdmaap%2Fdatarouter%2Fprovisioning%2Fbeans%2FExpiryRecord.java;fp=datarouter-prov%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fdmaap%2Fdatarouter%2Fprovisioning%2Fbeans%2FExpiryRecord.java;h=4c7fffaa8b1d5e67239dd538e5c7c6b4aa959d5d;hb=0645ccf674f388cc989ef43d2ce24f359915e453;hp=d812036ab2e631f568b46f9a8cb09aaffe9be4b8;hpb=7fdcc68d546fe95a7863de512bcda09f01e5d39e;p=dmaap%2Fdatarouter.git 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 d812036a..4c7fffaa 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 @@ -41,9 +41,12 @@ import org.onap.dmaap.datarouter.provisioning.utils.LOGJSONObject; * @version $Id: ExpiryRecord.java,v 1.4 2013/10/28 18:06:52 eby Exp $ */ public class ExpiryRecord extends BaseLogRecord { + + public static final String EXPIRY_REASON = "expiryReason"; + public static final String ATTEMPTS = "attempts"; private int subid; private String fileid; - private int attempts; + private int deliveryAttempts; private String reason; /** @@ -53,13 +56,13 @@ public class ExpiryRecord extends BaseLogRecord { */ public ExpiryRecord(String[] pp) throws ParseException { super(pp); - String fileid = pp[5]; - if (fileid.lastIndexOf('/') >= 0) { - fileid = fileid.substring(fileid.lastIndexOf('/') + 1); + String thisFileid = pp[5]; + if (thisFileid.lastIndexOf('/') >= 0) { + thisFileid = thisFileid.substring(thisFileid.lastIndexOf('/') + 1); } this.subid = Integer.parseInt(pp[4]); - this.fileid = fileid; - this.attempts = Integer.parseInt(pp[10]); + this.fileid = thisFileid; + this.deliveryAttempts = Integer.parseInt(pp[10]); this.reason = pp[9]; if (!reason.equals("notRetryable") && !reason.equals("retriesExhausted") && !reason.equals("diskFull")) { this.reason = "other"; @@ -75,7 +78,7 @@ public class ExpiryRecord extends BaseLogRecord { super(rs); this.subid = rs.getInt("DELIVERY_SUBID"); this.fileid = rs.getString("DELIVERY_FILEID"); - this.attempts = rs.getInt("ATTEMPTS"); + this.deliveryAttempts = rs.getInt("ATTEMPTS"); this.reason = rs.getString("REASON"); } @@ -95,12 +98,12 @@ public class ExpiryRecord extends BaseLogRecord { this.fileid = fileid; } - public int getAttempts() { - return attempts; + public int getDeliveryAttempts() { + return deliveryAttempts; } - public void setAttempts(int attempts) { - this.attempts = attempts; + public void setDeliveryAttempts(int deliveryAttempts) { + this.deliveryAttempts = deliveryAttempts; } public String getReason() { @@ -119,9 +122,9 @@ public class ExpiryRecord extends BaseLogRecord { public LOGJSONObject reOrderObject(LOGJSONObject jo) { LinkedHashMap logrecordObj = new LinkedHashMap<>(); - logrecordObj.put("expiryReason", jo.get("expiryReason")); + logrecordObj.put(EXPIRY_REASON, jo.get(EXPIRY_REASON)); logrecordObj.put("publishId", jo.get("publishId")); - logrecordObj.put("attempts", jo.get("attempts")); + logrecordObj.put(ATTEMPTS, jo.get(ATTEMPTS)); logrecordObj.put("requestURI", jo.get("requestURI")); logrecordObj.put("method", jo.get("method")); logrecordObj.put("contentType", jo.get("contentType")); @@ -136,8 +139,8 @@ public class ExpiryRecord extends BaseLogRecord { public LOGJSONObject asJSONObject() { LOGJSONObject jo = super.asJSONObject(); jo.put("type", "exp"); - jo.put("expiryReason", reason); - jo.put("attempts", attempts); + jo.put(EXPIRY_REASON, reason); + jo.put(ATTEMPTS, deliveryAttempts); return reOrderObject(jo); } @@ -153,7 +156,7 @@ public class ExpiryRecord extends BaseLogRecord { ps.setInt(13, getSubid()); ps.setString(14, getFileid()); ps.setNull(15, Types.INTEGER); - ps.setInt(16, getAttempts()); + ps.setInt(16, getDeliveryAttempts()); ps.setString(17, getReason()); ps.setNull(19, Types.BIGINT); ps.setNull(20, Types.VARCHAR);