|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jwall.web.audit.ModSecurityAuditEvent
public class ModSecurityAuditEvent
This class defines an audit-event of modsecurity. Currently this class stores the audit-event data as an internal string and has a few hash tables to hold specific properties/fields/parameters of the parsed request. However this will hopefully be turned into an interface to achieve independence of the actual implementations of an AuditEvent.
| Field Summary | |
|---|---|
static SimpleDateFormat |
fmt
the format in which the date is printed out |
| 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 | |
|---|---|
ModSecurityAuditEvent(ModSecurityAuditEvent evt)
This clone-constructor creates a copy of the given audit-event. |
|
ModSecurityAuditEvent(String[] data,
AuditEventType type)
This creates an instance of this class by parsing all fields from the given string-array. |
|
ModSecurityAuditEvent(String id,
String[] data,
AuditEventType type)
This constructor is used, when reading audit-events from a file. |
|
ModSecurityAuditEvent(String id,
String[] data,
File f,
long off,
long size,
AuditEventType type)
|
|
| Method Summary | |
|---|---|
int |
compareTo(AuditEvent o)
|
int |
compareTo(ModSecurityAuditEvent o)
|
boolean |
equals(ModSecurityAuditEvent 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 v)
This method returns the list of a collection which if referenced by the given variable var. |
AuditEventType |
getAuditEventType()
|
String |
getAuditHeader()
|
String |
getAuditLogTrailer()
Deprecated. |
Long |
getCount()
|
Date |
getDate()
Returns the date of this events birth. |
String |
getEventId()
The unique ID, created by modsecurity. |
AuditEventMessage[] |
getEventMessages()
|
File |
getFile()
|
static Long |
getInstanceCount()
|
long |
getOffset()
|
String[] |
getRawData()
This method returns an array of strings that contain the section-data of the appopriate audit-log entry of this event. |
String |
getRequestBody()
|
String |
getRequestHeader()
|
URL |
getRequestURL()
|
String |
getResponseHeader()
Deprecated. |
String |
getSection(int i)
Returns the string, which contains the whole section of this audit-event. |
String[] |
getSections()
|
String |
getSessionId()
The session-id of this request or an empty string, if no session-id has been set. |
long |
getSize()
|
Set<String> |
getTags()
|
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 var)
Checks wether the given variable is set or not. |
void |
recycle()
|
void |
set(String var,
String val)
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. |
void |
tag(String tag)
|
String |
toString()
Override Object.toString() by returning a String of all
sections. |
void |
untag(String tag)
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final SimpleDateFormat fmt
| Constructor Detail |
|---|
public ModSecurityAuditEvent(ModSecurityAuditEvent evt)
throws Exception
evt - The event to clone.
Exception
public ModSecurityAuditEvent(String[] data,
AuditEventType type)
throws ParseException
data - An array containing all audit-sections.
Exception - in case parsing failed.
ParseException
public ModSecurityAuditEvent(String id,
String[] data,
File f,
long off,
long size,
AuditEventType type)
throws ParseException
ParseException
public ModSecurityAuditEvent(String id,
String[] data,
AuditEventType type)
throws Exception
id - The id that the new event should contain.data - The section-data.
Exception - In case anything goes wrong (Parsing, etc...)| Method Detail |
|---|
public String[] getSections()
public EventType getType()
getType in interface Eventpublic Long getTimestamp()
Event
getTimestamp in interface Eventpublic String getEventId()
AuditEvent
getEventId in interface AuditEventpublic String getSection(int i)
AuditEventModSecurity.java.
getSection in interface AuditEventi - Index of the section as defined by
ModSecurity.SECTION_*.
public String getAuditHeader()
public String getRequestHeader()
public String getRequestBody()
public String getResponseHeader()
org.modsecurity.audit.AuditEvent#getResponseHeader()public String getAuditLogTrailer()
public Date getDate()
AuditEvent
getDate in interface AuditEventpublic String getSessionId()
AuditEvent
getSessionId in interface AuditEventpublic void setSessionId(String id)
AuditEvent
setSessionId in interface AuditEventid - The id of the session with which this event is associated.public boolean isSet(String var)
AuditEvent
isSet in interface AuditEventvar - The name of the variable that is checked.
true iff the variable is set.public String get(String variable)
AuditEventString 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).
get in interface Eventget in interface AuditEventvariable - The name of the variable.
public List<String> getAll(String v)
AuditEventvar.
getAll in interface AuditEventv - 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.
NULL if no
collection is found by that variable name.public List<String> getVariables()
AuditEvent
getVariables in interface AuditEvent
public void set(String var,
String val)
AuditEvent
set in interface Eventset in interface AuditEventpublic String toString()
Object.toString() by returning a String of all
sections.
toString in class Objectpublic int compareTo(AuditEvent o)
compareTo in interface Comparable<AuditEvent>compareTo in interface AuditEventpublic int compareTo(ModSecurityAuditEvent o)
public boolean equals(ModSecurityAuditEvent o)
public String[] getRawData()
AuditEvent
getRawData in interface AuditEventpublic Long getCount()
public URL getRequestURL()
public File getFile()
public long getOffset()
public long getSize()
public void recycle()
public void tag(String tag)
public void untag(String tag)
public Set<String> getTags()
public static Long getInstanceCount()
public void setAll(String variable,
List<String> values)
AuditEvent
setAll in interface AuditEventpublic AuditEventType getAuditEventType()
getAuditEventType in interface AuditEventpublic AuditEventMessage[] getEventMessages()
getEventMessages in interface AuditEvent
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||