org.ow2.clif.storage.api
Class AlarmEvent

java.lang.Object
  extended by org.ow2.clif.storage.api.AbstractEvent
      extended by org.ow2.clif.storage.api.AlarmEvent
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable, BladeEvent

public class AlarmEvent
extends AbstractEvent

This class represent the different alarm generated by injector or console

Author:
Julien Buret, Nicolas Droze, Bruno Dillenseger
See Also:
Serialized Form

Field Summary
 java.io.Serializable argument
           
static java.lang.String ARGUMENT_FIELD
           
static java.lang.String DATE_FIELD
           
static int ERROR
           
static java.lang.String EVENT_TYPE_LABEL
           
static int FATAL
           
static int INFO
           
 int severity
           
static java.lang.String SEVERITY_FIELD
           
static int WARNING
           
 
Fields inherited from class org.ow2.clif.storage.api.AbstractEvent
date, DEFAULT_SEPARATOR
 
Constructor Summary
AlarmEvent(long date, int severity, java.io.Serializable argument)
           
 
Method Summary
 java.lang.String[] getFieldLabels()
           
 java.lang.Object getFieldValue(java.lang.String fieldLabel)
           
 java.lang.String getTypeLabel()
           
 java.lang.String toString()
           
 java.lang.String toString(long dateOrigin, java.lang.String separator)
           
 
Methods inherited from class org.ow2.clif.storage.api.AbstractEvent
compareTo, getDate, getEventFactory, getEventFieldLabels, registerEventFieldLabels, setDate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DATE_FIELD

public static final java.lang.String DATE_FIELD
See Also:
Constant Field Values

SEVERITY_FIELD

public static final java.lang.String SEVERITY_FIELD
See Also:
Constant Field Values

ARGUMENT_FIELD

public static final java.lang.String ARGUMENT_FIELD
See Also:
Constant Field Values

EVENT_TYPE_LABEL

public static final java.lang.String EVENT_TYPE_LABEL
See Also:
Constant Field Values

INFO

public static final int INFO
See Also:
Constant Field Values

WARNING

public static final int WARNING
See Also:
Constant Field Values

ERROR

public static final int ERROR
See Also:
Constant Field Values

FATAL

public static final int FATAL
See Also:
Constant Field Values

severity

public int severity

argument

public java.io.Serializable argument
Constructor Detail

AlarmEvent

public AlarmEvent(long date,
                  int severity,
                  java.io.Serializable argument)
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getTypeLabel

public java.lang.String getTypeLabel()
Returns:
a label uniquely designating this class of event

toString

public java.lang.String toString(long dateOrigin,
                                 java.lang.String separator)
Parameters:
dateOrigin - the origin date in milliseconds (since 1st January 1970). This value is substracted from the event date before printing, thus allowing a change of date origin.
separator - the separator string to be used to separate the event values
Returns:
a text line describing this scenario event, consisting of values separated by the given separator string. The first field shall be an integer giving the date of the event.

getFieldLabels

public java.lang.String[] getFieldLabels()
Returns:
an array of labels identifying the fields (attributes) hold by this event, in the same order as they are displayed by toString(long, String).
See Also:
BladeEvent.toString(long, String)

getFieldValue

public java.lang.Object getFieldValue(java.lang.String fieldLabel)
Parameters:
fieldLabel - the label of the target field
Returns:
the value as an Object hold by the given field.