org.slf4j.ext
public class EventData extends Object implements Serializable
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.
|
Method Summary | |
---|---|
Serializable | get(String name)
Retrieve an event attribute.
|
Iterator<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.
|
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 | 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.
|
Parameters: map The event data.
Parameters: name The attribute's key.
Returns: The value associated with the key or null if the key is not present.
Returns: an Iterator that can be used to access all the event attributes.
Returns: The Date associated with the event.
Returns: The event identifier
Returns: The Map of attributes in this EventData instance.
Returns: The event type.
Returns: The message text associated with this event or null if there is none.
Returns: the number of attributes in the EventData.
Parameters: name The attribute's key. obj The data associated with the key.
Parameters: data The Map to copy.
Parameters: eventDateTime The event Date.
Parameters: eventId The event identifier.
Parameters: eventType The type of the event.
Parameters: message The message text.
Returns: an XML String containing all the EventDAta items.
Returns: an XML String containing all the EventDAta items.