wt.audit
Class AuditReport

java.lang.Object
  extended bywt.audit.AuditReport
All Implemented Interfaces:
Externalizable, Serializable

public class AuditReport
extends Object
implements Externalizable

Report of audit events for a period and event. The events are indexed by target and by user for easy of retrieval.

Supported API: false

Extendable: false

See Also:
Serialized Form

Field Summary
private static String CLASSNAME
           
private  AuditEventType eventType
           
static long EXTERNALIZATION_VERSION_UID
           
protected static long OLD_FORMAT_VERSION_UID
           
private  AuditPeriod period
           
private static String RESOURCE
           
(package private) static long serialVersionUID
           
private  HashMap targetUserMap
           
private  HashMap userTargetMap
           
 
Constructor Summary
AuditReport()
           
 
Method Summary
 void addAuditEvent(AuditEvent audit_event, boolean only_latest)
          Adds an audit event to the report.
 Object[] getActiveObjects()
          Returns a list of target objects for which there was activity for the event type and interval of the audit period.
 Object[] getActiveUsers(ObjectReference audit_ref)
          Returns a list of "active users" for the audit report for the persistable object passed as argument.
 Object[] getAllActiveUsers()
          Returns the list of all "active users" for the audit report for the persistable object passed as argument.
 AuditPeriod getAuditPeriod()
          Returns the audit period.
protected  AuditEventType getEventType()
          Gets the value of the attribute: eventType.
protected  AuditPeriod getPeriod()
          Gets the value of the attribute: period.
protected  HashMap getTargetUserMap()
          Gets the value of the attribute: targetUserMap; Maps target references to audit event info objects.
 Object[] getUserActivity(WTPrincipalReference user_ref)
          Returns a list of audit event info objects, containing the target objects and the last time of the event for the audit report.
protected  HashMap getUserTargetMap()
          Gets the value of the attribute: userTargetMap.
 void readExternal(ObjectInput input)
          Reads the non-transient fields of this class from an external source.
private  boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source, which is not the current version.
protected  boolean readVersion(AuditReport thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
protected  void setEventType(AuditEventType a_EventType)
          Sets the value of the attribute: eventType.
protected  void setPeriod(AuditPeriod a_Period)
          Sets the value of the attribute: period.
protected  void setTargetUserMap(HashMap a_TargetUserMap)
          Sets the value of the attribute: targetUserMap; Maps target references to audit event info objects.
protected  void setUserTargetMap(HashMap a_UserTargetMap)
          Sets the value of the attribute: userTargetMap.
 String toString()
          Returns a string containing all audit info objects in the report.
 void writeExternal(ObjectOutput output)
          Writes the non-transient fields of this class to an external source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

period

private AuditPeriod period

eventType

private AuditEventType eventType

targetUserMap

private HashMap targetUserMap

userTargetMap

private HashMap userTargetMap

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

EXTERNALIZATION_VERSION_UID

public static final long EXTERNALIZATION_VERSION_UID
See Also:
Constant Field Values

OLD_FORMAT_VERSION_UID

protected static final long OLD_FORMAT_VERSION_UID
See Also:
Constant Field Values
Constructor Detail

AuditReport

public AuditReport()
Method Detail

writeExternal

public void writeExternal(ObjectOutput output)
                   throws IOException
Writes the non-transient fields of this class to an external source.

Supported API: false

Specified by:
writeExternal in interface Externalizable
Parameters:
output -
Throws:
IOException

readExternal

public void readExternal(ObjectInput input)
                  throws IOException,
                         ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Specified by:
readExternal in interface Externalizable
Parameters:
input -
Throws:
IOException
ClassNotFoundException

readVersion

protected boolean readVersion(AuditReport thisObject,
                              ObjectInput input,
                              long readSerialVersionUID,
                              boolean passThrough,
                              boolean superDone)
                       throws IOException,
                              ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Parameters:
thisObject -
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

readOldVersion

private boolean readOldVersion(ObjectInput input,
                               long readSerialVersionUID,
                               boolean passThrough,
                               boolean superDone)
                        throws IOException,
                               ClassNotFoundException
Reads the non-transient fields of this class from an external source, which is not the current version.

Parameters:
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

getPeriod

protected AuditPeriod getPeriod()
Gets the value of the attribute: period.

Supported API: false

Returns:
AuditPeriod

setPeriod

protected void setPeriod(AuditPeriod a_Period)
                  throws WTPropertyVetoException
Sets the value of the attribute: period.

Supported API: false

Parameters:
a_Period -
Throws:
WTPropertyVetoException

getEventType

protected AuditEventType getEventType()
Gets the value of the attribute: eventType.

Supported API: false

Returns:
AuditEventType

setEventType

protected void setEventType(AuditEventType a_EventType)
                     throws WTPropertyVetoException
Sets the value of the attribute: eventType.

Supported API: false

Parameters:
a_EventType -
Throws:
WTPropertyVetoException

getTargetUserMap

protected HashMap getTargetUserMap()
Gets the value of the attribute: targetUserMap; Maps target references to audit event info objects.

Supported API: false

Returns:
HashMap

setTargetUserMap

protected void setTargetUserMap(HashMap a_TargetUserMap)
                         throws WTPropertyVetoException
Sets the value of the attribute: targetUserMap; Maps target references to audit event info objects.

Supported API: false

Parameters:
a_TargetUserMap -
Throws:
WTPropertyVetoException

getUserTargetMap

protected HashMap getUserTargetMap()
Gets the value of the attribute: userTargetMap.

Supported API: false

Returns:
HashMap

setUserTargetMap

protected void setUserTargetMap(HashMap a_UserTargetMap)
                         throws WTPropertyVetoException
Sets the value of the attribute: userTargetMap.

Supported API: false

Parameters:
a_UserTargetMap -
Throws:
WTPropertyVetoException

getActiveUsers

public Object[] getActiveUsers(ObjectReference audit_ref)
Returns a list of "active users" for the audit report for the persistable object passed as argument. The list of active users is actually an array of audit event info objects, containing both the user and the last time the event occurred (the target reference is the same for all audit event info objects). If 'null' is passed as argument, active users for objects whose events have no associated persistable object (System logins, for instance).

Supported API: false

Parameters:
audit_ref -
Returns:
Object []
See Also:
AuditEventInfo

getAllActiveUsers

public Object[] getAllActiveUsers()
Returns the list of all "active users" for the audit report for the persistable object passed as argument. The list of active users is actually an array of audit event info objects, containing both the user and the last time the event occurred (the target reference is the same for all audit event info objects).

Supported API: false

Returns:
Object []
See Also:
AuditEventInfo

getActiveObjects

public Object[] getActiveObjects()
Returns a list of target objects for which there was activity for the event type and interval of the audit period. The list is in the form of an array of object references. Note that if there are events with no associated objects, one of the entries of the array is 'null.'

Supported API: false

Returns:
Object[]

getUserActivity

public Object[] getUserActivity(WTPrincipalReference user_ref)
Returns a list of audit event info objects, containing the target objects and the last time of the event for the audit report. The list is returned in the form of an array of objects. Of course the user reference for all info objects is the reference to the user passed as argument to the method.

Supported API: false

Parameters:
user_ref -
Returns:
Object[]
See Also:
AuditEventInfo

toString

public String toString()
Returns a string containing all audit info objects in the report.

Supported API: false

Returns:
String

getAuditPeriod

public AuditPeriod getAuditPeriod()
Returns the audit period.

Supported API: false

Returns:
AuditPeriod

addAuditEvent

public void addAuditEvent(AuditEvent audit_event,
                          boolean only_latest)
                   throws WTException
Adds an audit event to the report. If only latest is 'true' the event is only added if it is the latest event for the same user and target is added.

Supported API: false

Parameters:
audit_event -
only_latest -
Throws:
WTException