org.jwall.web.audit
Class IronBeeAuditEvent

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap<K,V>
          extended by java.util.LinkedHashMap<String,String>
              extended by org.jwall.web.audit.IronBeeAuditEvent
All Implemented Interfaces:
Serializable, Cloneable, Comparable<AuditEvent>, Map<String,String>, Event, AuditEvent

public class IronBeeAuditEvent
extends LinkedHashMap<String,String>
implements AuditEvent

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
 
Field Summary
static String SECTION_BOUNDARY_KEY
           
 
Fields inherited from interface org.jwall.web.audit.AuditEvent
AGE, EVENT_ID, EVENT_TAGS, EVENT_URL, FILE, FILE_OFFSET, ID, MESSAGE, RECEIVED_AT, SENSOR, SENSOR_ADDR, SENSOR_ID, SENSOR_NAME, SENSOR_TYPE, SESSION_ID, SEVERITY, SITE_ID, SITE_NAME, SIZE, TAGS, VARIABLES
 
Fields inherited from interface org.jwall.audit.Event
TIMESTAMP, TYPE
 
Constructor Summary
IronBeeAuditEvent()
           
IronBeeAuditEvent(stream.data.Data data)
           
 
Method Summary
 int compareTo(AuditEvent o)
           
 String get(String variable)
          Returns the given variable as String or an empty string if the variable is not set.
 List<String> getAll(String variable)
          This method returns the list of a collection which if referenced by the given variable var.
 AuditEventType getAuditEventType()
           
 Date getDate()
          Returns the date of this events birth.
 String getEventId()
          The unique ID, created by modsecurity.
 AuditEventMessage[] getEventMessages()
           
 String[] getRawData()
          This method returns an array of strings that contain the section-data of the appopriate audit-log entry of this event.
 String getSection(int i)
          Returns the string, which contains the whole section of this audit-event.
 String getSessionId()
          The session-id of this request or an empty string, if no session-id has been set.
 Long getTimestamp()
          Returns the time of this event in milliseconds since 1970.
 EventType getType()
           
 List<String> getVariables()
          This method returns the list of all variables available in this event.
 boolean isSet(String variable)
          Checks wether the given variable is set or not.
static String mapVariable(String str)
           
 void set(String variable, String value)
          This method can be used to modify/set properties of the event.
 void setAll(String variable, List<String> values)
          This method can be used to modify/set a collection of the event.
 void setSessionId(String id)
          This method sets the session-id of this event.
 String toString()
           
 
Methods inherited from class java.util.LinkedHashMap
clear, containsValue, get
 
Methods inherited from class java.util.HashMap
clone, containsKey, entrySet, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
containsKey, entrySet, equals, hashCode, isEmpty, keySet, put, putAll, remove, size, values
 

Field Detail

SECTION_BOUNDARY_KEY

public static final String SECTION_BOUNDARY_KEY
See Also:
Constant Field Values
Constructor Detail

IronBeeAuditEvent

public IronBeeAuditEvent()

IronBeeAuditEvent

public IronBeeAuditEvent(stream.data.Data data)
Method Detail

getTimestamp

public Long getTimestamp()
Description copied from interface: Event
Returns the time of this event in milliseconds since 1970.

Specified by:
getTimestamp in interface Event
Returns:

getType

public EventType getType()
Specified by:
getType in interface Event

getEventId

public String getEventId()
Description copied from interface: AuditEvent
The unique ID, created by modsecurity.

Specified by:
getEventId in interface AuditEvent
Returns:
A unique event id.
See Also:
AuditEvent.getEventId()

getSection

public String getSection(int i)
Description copied from interface: AuditEvent
Returns the string, which contains the whole section of this audit-event. The available sections are defined in ModSecurity.java.

Specified by:
getSection in interface AuditEvent
Parameters:
i - Index of the section as defined by ModSecurity.SECTION_*.
Returns:
The string value of the appopriate section of this event.
See Also:
AuditEvent.getSection(int)

getDate

public Date getDate()
Description copied from interface: AuditEvent
Returns the date of this events birth. The value of this date is parsed from the audit-event entry.

Specified by:
getDate in interface AuditEvent
Returns:
The date when this event was created.
See Also:
AuditEvent.getDate()

getSessionId

public String getSessionId()
Description copied from interface: AuditEvent
The session-id of this request or an empty string, if no session-id has been set.

Specified by:
getSessionId in interface AuditEvent
Returns:
The session id.
See Also:
AuditEvent.getSessionId()

setSessionId

public void setSessionId(String id)
Description copied from interface: AuditEvent
This method sets the session-id of this event. Its primary use is to group several events by external session-trackers.

Specified by:
setSessionId in interface AuditEvent
Parameters:
id - The id of the session with which this event is associated.
See Also:
AuditEvent.setSessionId(java.lang.String)

isSet

public boolean isSet(String variable)
Description copied from interface: AuditEvent
Checks wether the given variable is set or not.

Specified by:
isSet in interface AuditEvent
Parameters:
variable - The name of the variable that is checked.
Returns:
true iff the variable is set.
See Also:
AuditEvent.isSet(java.lang.String)

get

public String get(String variable)
Description copied from interface: AuditEvent
Returns the given variable as String or an empty string if the variable is not set. If the given variable is referring to a collection the first value of that collection is returned. To test if a variable has been set, use isSet(String variable).

Specified by:
get in interface Event
Specified by:
get in interface AuditEvent
Parameters:
variable - The name of the variable.
Returns:
The value of this variable.
See Also:
AuditEvent.get(java.lang.String)

getAll

public List<String> getAll(String variable)
Description copied from interface: AuditEvent
This method returns the list of a collection which if referenced by the given variable var.

Specified by:
getAll in interface AuditEvent
Parameters:
variable - The variable name of the collection. May also be a non-collection variable in which case a single-item list will returned if the variable has a value.
Returns:
The list of values for the variable, of NULL if no collection is found by that variable name.
See Also:
AuditEvent.getAll(java.lang.String)

set

public void set(String variable,
                String value)
Description copied from interface: AuditEvent
This method can be used to modify/set properties of the event. There is a distinction between request and event properties. The request properties are parsed from the incoming request and are immutable. The event properties may be changed.

Specified by:
set in interface Event
Specified by:
set in interface AuditEvent
See Also:
AuditEvent.set(java.lang.String, java.lang.String)

setAll

public void setAll(String variable,
                   List<String> values)
Description copied from interface: AuditEvent
This method can be used to modify/set a collection of the event. There is a distinction between request and event properties. The request properties are parsed from the incoming request and are immutable. The event properties may be changed.

Specified by:
setAll in interface AuditEvent
See Also:
AuditEvent.setAll(java.lang.String, java.util.List)

getVariables

public List<String> getVariables()
Description copied from interface: AuditEvent
This method returns the list of all variables available in this event.

Specified by:
getVariables in interface AuditEvent
Returns:
The list of variable names (single variables AND collections) which may be accessed from this event.
See Also:
AuditEvent.getVariables()

compareTo

public int compareTo(AuditEvent o)
Specified by:
compareTo in interface Comparable<AuditEvent>
Specified by:
compareTo in interface AuditEvent
See Also:
AuditEvent.compareTo(org.jwall.web.audit.AuditEvent)

getRawData

public String[] getRawData()
Description copied from interface: AuditEvent
This method returns an array of strings that contain the section-data of the appopriate audit-log entry of this event.

Specified by:
getRawData in interface AuditEvent
Returns:
The list of section-strings.
See Also:
AuditEvent.getRawData()

getAuditEventType

public AuditEventType getAuditEventType()
Specified by:
getAuditEventType in interface AuditEvent

toString

public String toString()
Overrides:
toString in class AbstractMap<String,String>

mapVariable

public static String mapVariable(String str)

getEventMessages

public AuditEventMessage[] getEventMessages()
Specified by:
getEventMessages in interface AuditEvent


Copyright © 2012 jwall.org. All Rights Reserved.