1 24 25 package org.objectweb.clif.storage.api; 26 27 import java.io.Serializable ; 28 29 30 37 public class AlarmEvent extends AbstractEvent 38 { 39 static public final String EVENT_TYPE_LABEL = "alarm"; 40 static private final String [] EVENT_FIELD_LABELS = 41 new String [] { "date", "blade id", "severity", "argument" }; 42 static public final int TRACE = 0; 43 static public final int WARNING = 1; 44 static public final int ERROR = 2; 45 static public final int FATAL = 3; 46 47 48 static 49 { 50 AbstractEvent.registerEventFieldLabels( 51 EVENT_TYPE_LABEL, 52 EVENT_FIELD_LABELS); 53 } 54 55 56 public int severity; 57 public Serializable argument; 58 59 60 public AlarmEvent(long date, String bladeId, int severity, Serializable argument) 61 { 62 super(date, bladeId); 63 this.severity = severity; 64 this.argument = argument; 65 } 66 67 68 public String getTypeLabel() 69 { 70 return EVENT_TYPE_LABEL; 71 } 72 73 74 public String toString() 75 { 76 return toString(0, ";"); 77 } 78 79 80 public String toString(long dateOrigin, String separator) 81 { 82 return 83 (date - dateOrigin) + separator 84 + bladeId + separator 85 + severity + separator 86 + argument; 87 } 88 } 89 | Popular Tags |