X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=datarouter-prov%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fdmaap%2Fdatarouter%2Fprovisioning%2Fbeans%2FDeliveryRecord.java;h=648c4e54ef934e98341819d878b6cec2c9ca5107;hb=refs%2Fchanges%2F87%2F92187%2F5;hp=0bce491050219e3c9c85b0c5a6469f4701dfc7fd;hpb=bc1df610cddfb558cf6bde90c269b4af59768648;p=dmaap%2Fdatarouter.git diff --git a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/DeliveryRecord.java b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/DeliveryRecord.java index 0bce4910..648c4e54 100644 --- a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/DeliveryRecord.java +++ b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/DeliveryRecord.java @@ -41,6 +41,9 @@ import org.onap.dmaap.datarouter.provisioning.utils.LOGJSONObject; * @version $Id: DeliveryRecord.java,v 1.9 2014/03/12 19:45:41 eby Exp $ */ public class DeliveryRecord extends BaseLogRecord { + + private static final String STATUS_CODE = "statusCode"; + private static final String DELIVERY_ID = "deliveryId"; private int subid; private String fileid; private int result; @@ -53,12 +56,12 @@ public class DeliveryRecord extends BaseLogRecord { */ public DeliveryRecord(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.fileid = thisFileid; this.result = Integer.parseInt(pp[10]); this.user = pp[9]; if (this.user != null && this.user.length() > 50) { @@ -119,14 +122,12 @@ public class DeliveryRecord extends BaseLogRecord { public LOGJSONObject reOrderObject(LOGJSONObject jo) { LinkedHashMap logrecordObj = new LinkedHashMap<>(); - logrecordObj.put("statusCode", jo.get("statusCode")); - logrecordObj.put("deliveryId", jo.get("deliveryId")); + logrecordObj.put(STATUS_CODE, jo.get(STATUS_CODE)); + logrecordObj.put(DELIVERY_ID, jo.get(DELIVERY_ID)); logrecordObj.put("publishId", jo.get("publishId")); logrecordObj.put("requestURI", jo.get("requestURI")); - //logrecordObj.put("sourceIP", jo.get("sourceIP")); logrecordObj.put("method", jo.get("method")); logrecordObj.put("contentType", jo.get("contentType")); - //logrecordObj.put("endpointId", jo.get("endpointId")); logrecordObj.put("type", jo.get("type")); logrecordObj.put("date", jo.get("date")); logrecordObj.put("contentLength", jo.get("contentLength")); @@ -139,8 +140,8 @@ public class DeliveryRecord extends BaseLogRecord { public LOGJSONObject asJSONObject() { LOGJSONObject jo = super.asJSONObject(); jo.put("type", "del"); - jo.put("deliveryId", user); - jo.put("statusCode", result); + jo.put(DELIVERY_ID, user); + jo.put(STATUS_CODE, result); return this.reOrderObject(jo); }