|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jwall.web.audit.AuditEventImpl
public class AuditEventImpl
This class defines an audit-event of modsecurity. Currently this class stores the audit-event data as an internal string and has a few hashtables to hold specific properties/fields/parameters of the parsed request. However this will hopefully be turned into an interface to achieve independance of the actual implementations of an AuditEvent.
| Field Summary | |
|---|---|
protected java.lang.String |
eventId
a unique event_id |
static java.lang.Long |
evtCount
a count of all events alive |
static java.text.SimpleDateFormat |
fmt
the format in which the date is printed out |
static long |
serialVersionUID
id for serialization |
| Constructor Summary | |
|---|---|
protected |
AuditEventImpl()
|
|
AuditEventImpl(AuditEventImpl evt)
This clone-constructor creates a copy of the given audit-event. |
|
AuditEventImpl(java.lang.String[] data)
This creates an instance of this class by parsing all fields from the given string-array. |
|
AuditEventImpl(java.lang.String id,
java.lang.String[] data)
This constructor is used, when reading audit-events from a file. |
|
AuditEventImpl(java.lang.String id,
java.lang.String[] data,
java.io.File f,
long off,
long size)
|
| Method Summary | |
|---|---|
int |
compareTo(AuditEvent o)
|
int |
compareTo(AuditEventImpl o)
|
protected void |
finalize()
|
java.lang.String |
get(java.lang.String var)
Returns the given variable as String or an empty string if
the variable is not set. |
java.lang.String |
getAuditHeader()
Returns the header-section of this event. |
java.lang.String |
getAuditLogTrailer()
Returns the header-section of this event. |
java.lang.Long |
getCount()
This method returns the number of instances created from the underlying implementation of this interface. |
java.util.Date |
getDate()
Returns the date of this events birth. |
java.lang.String |
getEventId()
The unique ID, created by modsecurity. |
java.io.File |
getFile()
This method returns the file from which the event has been read. |
java.util.Set<java.lang.String> |
getGetParameterNames()
Returns the set of parameters (their names) that are available in the request-uri of this request. |
java.lang.String |
getGetParameterValue(java.lang.String name)
Returns the value of the parameter name in the url
of this request. |
long |
getOffset()
This method returns the offset (bytes) from the beginning of the file from which this event has been read. |
java.util.Set<java.lang.String> |
getPostParameterNames()
Returns the set of parameters (their names) that are available in the post-body of this request. |
java.lang.String |
getPostParameterValue(java.lang.String name)
Returns the value of the parameter name in the post-body
of this request or null there is no parameter with this
name. |
java.lang.String[] |
getRawData()
This method returns an array of strings that contain the section-data of the appopriate audit-log entry of this event. |
long |
getRelativeSessionTime()
Gets the number of milliseconds from the time the first event of this session has been detected. |
java.lang.String |
getRequestBody()
Return the body of this request. |
java.lang.String |
getRequestCookie(java.lang.String name)
|
java.util.Set<java.lang.String> |
getRequestCookieNames()
|
java.lang.String |
getRequestHeader()
Returns the header-section of this event. |
java.lang.String |
getRequestHeader(java.lang.String name)
Returns the value of the specified header-field of the request. |
java.util.Set<java.lang.String> |
getRequestHeaderNames()
Returns the set of all header-fields sent in the request. |
java.net.URL |
getRequestURL()
Return an URL object that matches the URL requested within this event. |
java.lang.String |
getResponseCookie(java.lang.String name)
|
java.util.Set<java.lang.String> |
getResponseCookieNames()
|
java.lang.String |
getResponseHeader()
Returns the header-section of this event. |
java.lang.String |
getResponseHeader(java.lang.String name)
Returns the value of the specified header-field of the response. |
java.util.Set<java.lang.String> |
getResponseHeaderNames()
Returns the set of all header-fields sent in the response. |
java.lang.String |
getSection(int i)
Returns the string, which contains the whole section of this audit-event. |
java.lang.String |
getSessionId()
The session-id of this request or an empty string, if no session-id has been set. |
long |
getSize()
|
boolean |
isSet(java.lang.String var)
Checks wether the given variable is set or not. |
protected void |
parseSections(java.lang.String[] sections)
|
protected void |
set(java.lang.String var,
java.lang.String val)
|
void |
setRelativeSessionTime(long s)
Sets the number of milliseconds from the time the first event of this session has been detected. |
void |
setSessionId(java.lang.String id)
This method sets the session-id of this event. |
java.lang.String |
toString()
Override Object.toString() by returning a
String of all sections. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final long serialVersionUID
public static java.lang.Long evtCount
public static final java.text.SimpleDateFormat fmt
protected java.lang.String eventId
| Constructor Detail |
|---|
protected AuditEventImpl()
public AuditEventImpl(AuditEventImpl evt)
throws java.lang.Exception
evt - The event to clone.
java.lang.Exception
public AuditEventImpl(java.lang.String[] data)
throws java.lang.Exception
data - An array containing all audit-sections.
java.lang.Exception - in case parsing failed.
public AuditEventImpl(java.lang.String id,
java.lang.String[] data,
java.io.File f,
long off,
long size)
throws java.lang.Exception
java.lang.Exception
public AuditEventImpl(java.lang.String id,
java.lang.String[] data)
throws java.lang.Exception
id - The id that the new event should contain.data - The section-data.
java.lang.Exception - In case anything goes wrong (Parsing, etc...)| Method Detail |
|---|
protected void parseSections(java.lang.String[] sections)
throws java.lang.Exception
java.lang.Exceptionpublic java.lang.String getEventId()
AuditEvent
getEventId in interface AuditEventpublic java.lang.String getSection(int i)
AuditEventModSecurity.java.
getSection in interface AuditEventi - Index of the section as defined by ModSecurity.SECTION_*.
public java.lang.String getAuditHeader()
AuditEventgetSection(ModSecurity.AUDIT_HEADER).
getAuditHeader in interface AuditEventpublic java.lang.String getRequestHeader()
AuditEventgetSection(ModSecurity.REQUEST_HEADER).
getRequestHeader in interface AuditEventpublic java.lang.String getRequestBody()
AuditEvent
getRequestBody in interface AuditEventpublic java.lang.String getResponseHeader()
AuditEventgetSection(ModSecurity.FINAL_RESPONSE_HEADER).
getResponseHeader in interface AuditEventpublic java.lang.String getAuditLogTrailer()
AuditEventgetSection(ModSecurity.AUDIT_TRAILER).
getAuditLogTrailer in interface AuditEventpublic java.lang.String getRequestHeader(java.lang.String name)
AuditEventHEADLINE to retrieve the first line of
the request.
getRequestHeader in interface AuditEventname - The header-field to be returned (see org.modsecurity.HttpProtocol)
null if not set.public java.util.Set<java.lang.String> getRequestHeaderNames()
AuditEvent
getRequestHeaderNames in interface AuditEventpublic java.lang.String getResponseHeader(java.lang.String name)
AuditEvent
getResponseHeader in interface AuditEventname - The header-field name.
null if not set.public java.util.Set<java.lang.String> getResponseHeaderNames()
AuditEventHEADLINE to retrieve the first line of
the response.
getResponseHeaderNames in interface AuditEventpublic java.util.Date getDate()
AuditEvent
getDate in interface AuditEventpublic java.lang.String getSessionId()
AuditEvent
getSessionId in interface AuditEventpublic void setSessionId(java.lang.String id)
AuditEvent
setSessionId in interface AuditEventid - The id of the session with which this event is associated.public boolean isSet(java.lang.String var)
AuditEvent
isSet in interface AuditEventvar - The name of the variable that is checked.
true iff the variable is set.public java.lang.String get(java.lang.String var)
AuditEventString or an empty string if
the variable is not set.
To test if a variable has been set use isSet(String variable).
get in interface AuditEventvar - The name of the variable.
protected void set(java.lang.String var,
java.lang.String val)
public java.util.Set<java.lang.String> getGetParameterNames()
AuditEvent
getGetParameterNames in interface AuditEventpublic java.lang.String getGetParameterValue(java.lang.String name)
AuditEventname in the url
of this request.
getGetParameterValue in interface AuditEventname - The parameter name.
name.public java.util.Set<java.lang.String> getPostParameterNames()
AuditEvent
getPostParameterNames in interface AuditEventpublic java.lang.String getPostParameterValue(java.lang.String name)
AuditEventname in the post-body
of this request or null there is no parameter with this
name.
getPostParameterValue in interface AuditEventname - The name of the parameter.
public java.util.Set<java.lang.String> getRequestCookieNames()
getRequestCookieNames in interface AuditEventpublic java.lang.String getRequestCookie(java.lang.String name)
getRequestCookie in interface AuditEventpublic java.util.Set<java.lang.String> getResponseCookieNames()
getResponseCookieNames in interface AuditEventpublic java.lang.String getResponseCookie(java.lang.String name)
getResponseCookie in interface AuditEventpublic java.lang.String toString()
Object.toString() by returning a
String of all sections.
toString in class java.lang.Objectpublic int compareTo(AuditEvent o)
compareTo in interface java.lang.Comparable<AuditEvent>compareTo in interface AuditEventpublic int compareTo(AuditEventImpl o)
public void setRelativeSessionTime(long s)
AuditEvent
setRelativeSessionTime in interface AuditEvents - Time in milliseconds.public long getRelativeSessionTime()
AuditEvent
getRelativeSessionTime in interface AuditEventpublic java.lang.String[] getRawData()
AuditEvent
getRawData in interface AuditEvent
protected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwablepublic java.lang.Long getCount()
AuditEvent
getCount in interface AuditEventpublic java.net.URL getRequestURL()
AuditEvent
getRequestURL in interface AuditEventpublic java.io.File getFile()
AuditEventnull is returned.
getFile in interface AuditEventpublic long getOffset()
AuditEvent
getOffset in interface AuditEventpublic long getSize()
getSize in interface AuditEvent
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||