|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.slf4j.ext.EventData
public class EventData
Base class for Event Data. Event Data contains data to be logged about an event. Users may extend this class for each EventType they want to log.
Field Summary | |
---|---|
static String |
EVENT_DATETIME
|
static String |
EVENT_ID
|
static String |
EVENT_MESSAGE
|
static String |
EVENT_TYPE
|
Constructor Summary | |
---|---|
EventData()
Default Constructor |
|
EventData(Map<String,Object> map)
Constructor to create event data from a Map. |
|
EventData(String xml)
Construct from a serialized form of the Map containing the RequestInfo elements |
Method Summary | |
---|---|
boolean |
equals(Object o)
Compare two EventData objects for equality. |
Serializable |
get(String name)
Retrieve an event attribute. |
Iterator<Map.Entry<String,Object>> |
getEntrySetIterator()
Returns an Iterator over all the entries in the EventDAta. |
Date |
getEventDateTime()
Retrieve the date and time the event occurred. |
String |
getEventId()
Retrieve the event identifier. |
Map<String,Object> |
getEventMap()
Retrieve all the attributes in the EventData as a Map. |
String |
getEventType()
Retrieve the type of the event. |
String |
getMessage()
Retrieve the message text associated with this event, if any. |
int |
getSize()
Returns the number of attributes in the EventData. |
int |
hashCode()
Compute the hashCode for this EventData instance. |
void |
put(String name,
Serializable obj)
Add arbitrary attributes about the event. |
void |
putAll(Map<String,Object> data)
Populate the event data from a Map. |
void |
setEventDateTime(Date eventDateTime)
Set the date and time the event occurred in case it is not the same as when the event was logged. |
void |
setEventId(String eventId)
Set the event identifier. |
void |
setEventType(String eventType)
Set the type of event that occurred. |
void |
setMessage(String message)
Set the message text associated with this event. |
String |
toString()
Convert the EventData to a String. |
String |
toXML()
Serialize all the EventData items into an XML representation. |
static String |
toXML(Map<String,Object> map)
Serialize all the EventData items into an XML representation. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String EVENT_MESSAGE
public static final String EVENT_TYPE
public static final String EVENT_DATETIME
public static final String EVENT_ID
Constructor Detail |
---|
public EventData()
public EventData(Map<String,Object> map)
map
- The event data.public EventData(String xml)
xml
- The serialized form of the RequestInfo Map.Method Detail |
---|
public String toXML()
public static String toXML(Map<String,Object> map)
public String getEventId()
public void setEventId(String eventId)
eventId
- The event identifier.public String getMessage()
public void setMessage(String message)
message
- The message text.public Date getEventDateTime()
public void setEventDateTime(Date eventDateTime)
eventDateTime
- The event Date.public void setEventType(String eventType)
eventType
- The type of the event.public String getEventType()
public void put(String name, Serializable obj)
name
- The attribute's key.obj
- The data associated with the key.public Serializable get(String name)
name
- The attribute's key.
public void putAll(Map<String,Object> data)
data
- The Map to copy.public int getSize()
public Iterator<Map.Entry<String,Object>> getEntrySetIterator()
public Map<String,Object> getEventMap()
public String toString()
toString
in class Object
public boolean equals(Object o)
equals
in class Object
o
- The Object to compare.
public int hashCode()
hashCode
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |