1 4 5 6 package org.enhydra.shark.eventaudit; 7 8 import java.util.HashMap ; 9 import java.util.Iterator ; 10 import java.util.Map ; 11 12 import org.enhydra.shark.api.internal.eventaudit.*; 13 14 18 public class HibernateDataEventAudit extends HibernateEventAudit implements DataEventAuditPersistenceInterface { 19 20 private Map oldData; 21 private Map newData; 22 23 public HibernateDataEventAudit(){ 24 oldData = new HashMap (); 25 newData = new HashMap (); 26 } 27 28 public void setOldData(Map od) { 29 this.oldData = od; 30 } 31 32 public Map getOldData() { 33 return oldData; 34 } 35 36 public void setNewData(Map nd) { 37 this.newData = nd; 38 } 39 40 public Map getNewData() { 41 return newData; 42 } 43 44 public String toString() { 45 StringBuffer strBuffer = new StringBuffer (); 46 strBuffer.append("IdDB = " + this.dbId + "\n"); 47 strBuffer.append("timeStamp = " + this.getUTCTime() + "\n"); 48 strBuffer.append("eventType = " + this.getType() + "\n"); 49 strBuffer.append("activityId = " + this.getActivityId() + "\n"); 50 strBuffer.append("activityName = " + this.getActivityName() + "\n"); 51 strBuffer.append("processId = " + this.getProcessId() + "\n"); 52 strBuffer.append("processName = " + this.getProcessName() + "\n"); 53 strBuffer.append("processMgrName = " + this.getProcessDefinitionName() + "\n"); 54 strBuffer.append("processMgrVersion = " + this.getProcessDefinitionVersion() + "\n"); 55 strBuffer.append("activityDefinitionId = " + this.getActivityDefinitionId() + "\n"); 56 strBuffer.append("processDefinitionId = " + this.getProcessDefinitionId() + "\n"); 57 strBuffer.append("packageId = " + this.getPackageId() + "\n"); 58 if (oldData != null){ 59 strBuffer.append("olddata = \n"); 60 Iterator it = this.oldData.entrySet().iterator(); 61 while (it.hasNext()) { 62 Map.Entry me = (Map.Entry ) it.next(); 63 String vdId = (String ) me.getKey(); 64 Object val = me.getValue(); 65 strBuffer.append("\t Entry : " + vdId + "->" + val + "\n"); 66 } 67 } else { 68 strBuffer.append("\nolddata = empty\n"); 69 } 70 if (newData != null){ 71 strBuffer.append("newdata = \n"); 72 Iterator it2 = this.newData.entrySet().iterator(); 73 while (it2.hasNext()) { 74 Map.Entry me = (Map.Entry ) it2.next(); 75 String vdId = (String ) me.getKey(); 76 Object val = me.getValue(); 77 strBuffer.append("\t Entry : " + vdId + "->" + val + "\n"); 78 } 79 } else { 80 strBuffer.append("newdata = empty\n"); 81 } 82 83 84 return strBuffer.toString(); 85 } 86 87 } | Popular Tags |