1 23 24 package org.objectweb.clif.storage.api; 25 26 27 import org.objectweb.clif.storage.api.AbstractEvent; 28 import java.io.Serializable ; 29 30 31 35 public class ActionEvent extends AbstractEvent 36 { 37 static public final String EVENT_TYPE_LABEL = "action"; 38 static private final String [] EVENT_FIELD_LABELS = 39 new String [] { 40 "date", 41 "blade id", 42 "session id", 43 "action type", 44 "iteration", 45 "success", 46 "duration", 47 "comment", 48 "result"}; 49 50 51 static 52 { 53 AbstractEvent.registerEventFieldLabels( 54 EVENT_TYPE_LABEL, 55 EVENT_FIELD_LABELS); 56 } 57 58 59 public String type; 60 public long iteration; 61 public long sessionId; 62 public boolean successful; 63 public int duration; 64 public Serializable result; 65 public String comment; 66 67 68 public ActionEvent( 69 long date, 70 String bladeId, 71 String type, 72 long iteration, 73 long sessionId, 74 boolean successful, 75 int duration, 76 Serializable result, 77 String comment) 78 { 79 super(date, bladeId); 80 this.type = type; 81 this.iteration = iteration; 82 this.sessionId = sessionId; 83 this.successful = successful; 84 this.duration = duration; 85 this.result = result; 86 this.comment = comment; 87 } 88 89 90 public String getTypeLabel() 91 { 92 return EVENT_TYPE_LABEL; 93 } 94 95 96 public boolean isSuccessful() 97 { 98 return successful; 99 } 100 101 102 public int getDuration() 103 { 104 return duration; 105 } 106 107 108 public long getSession() 109 { 110 return sessionId; 111 } 112 113 114 public Serializable getResult() 115 { 116 return result; 117 } 118 119 120 public String getComment() 121 { 122 return comment; 123 } 124 125 126 public String getType() 127 { 128 return type; 129 } 130 131 132 public String toString() 133 { 134 return toString(0, ";"); 135 } 136 137 138 public String toString(long dateOrigin, String separator) 139 { 140 return 141 (date - dateOrigin) + separator 142 + bladeId + separator 143 + sessionId + separator 144 + type + separator 145 + iteration + separator 146 + successful + separator 147 + duration + separator 148 + comment + separator 149 + result; 150 } 151 } 152 | Popular Tags |