wt.projmgmt.util
Class ProjMgmtAuditHelper

java.lang.Object
  extended bywt.projmgmt.util.ProjMgmtAuditHelper
All Implemented Interfaces:
Externalizable, Serializable

public class ProjMgmtAuditHelper
extends Object
implements Externalizable

This class encapsulates project management auditing functionality.

Supported API: false

Extendable: false

See Also:
Serialized Form

Field Summary
private static String CLASSNAME
           
static long EXTERNALIZATION_VERSION_UID
           
protected static long OLD_FORMAT_VERSION_UID
           
private static String RESOURCE
           
(package private) static long serialVersionUID
           
 
Constructor Summary
ProjMgmtAuditHelper()
           
 
Method Summary
static void addProjLogin(WTPrincipalReference user_ref, Project2 project)
          Adds a project login event for a user and a project.
static void addProjLogout(WTPrincipalReference user_ref, Project2 project)
          Adds the project logout event for a given user and project.
static void addSysLogin(WTPrincipalReference user_ref)
          Adds a system login event.
private static void collectSubprojects(WTContainer context, Vector sub_projects)
          Recursively gathers all subcontainers of a project in a vector passed as argument.
static Timestamp getLastProjLogin(WTPrincipalReference user_ref, Project2 project)
          Returns the time of the last user login to the project passed as argument.
static Timestamp getLastSysLogin(WTPrincipalReference user_ref)
          Returns the time of the last user system login.
static Object[] getProjLoginReport(WTContainer context, AuditPeriod period)
          Returns a list of the logins to project for all projects in the WTContainer that happened in a time interval.
static Object[] getSysLoginReport(AuditPeriod period)
          Returns a list of the system logins for all projects in the Organization that happened in a time interval.
 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(ProjMgmtAuditHelper thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
 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, toString, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

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

ProjMgmtAuditHelper

public ProjMgmtAuditHelper()
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(ProjMgmtAuditHelper 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

addSysLogin

public static void addSysLogin(WTPrincipalReference user_ref)
                        throws WTException
Adds a system login event.

Supported API: false

Parameters:
user_ref -
Throws:
WTException

addProjLogin

public static void addProjLogin(WTPrincipalReference user_ref,
                                Project2 project)
                         throws WTException
Adds a project login event for a user and a project.

Supported API: false

Parameters:
user_ref -
project -
Throws:
WTException

addProjLogout

public static void addProjLogout(WTPrincipalReference user_ref,
                                 Project2 project)
                          throws WTException
Adds the project logout event for a given user and project.

Supported API: false

Parameters:
user_ref -
project -
Throws:
WTException

getLastProjLogin

public static Timestamp getLastProjLogin(WTPrincipalReference user_ref,
                                         Project2 project)
                                  throws WTException
Returns the time of the last user login to the project passed as argument. If the user never logged in to the project, it returns 'null.'

Supported API: false

Parameters:
user_ref -
project -
Returns:
Timestamp
Throws:
WTException

getLastSysLogin

public static Timestamp getLastSysLogin(WTPrincipalReference user_ref)
                                 throws WTException
Returns the time of the last user system login. Returns 'null' if the user never logged in to the system.

Supported API: false

Parameters:
user_ref -
Returns:
Timestamp
Throws:
WTException

getProjLoginReport

public static Object[] getProjLoginReport(WTContainer context,
                                          AuditPeriod period)
                                   throws WTException
Returns a list of the logins to project for all projects in the WTContainer that happened in a time interval. For each user and project only the last event is returned. The list is returned in the form of an array of objects, where each object is an "audit event information" object (AuditEventInfo). Each AuditEventInfo object corresponds to a user audit event (for example a project login) and contains a reference to a project (that can be null), to a user and a timestamp.

Supported API: false

Parameters:
context -
period -
Returns:
Object []
Throws:
WTException
See Also:
AuditEventInfo

getSysLoginReport

public static Object[] getSysLoginReport(AuditPeriod period)
                                  throws WTException
Returns a list of the system logins for all projects in the Organization that happened in a time interval. For each user only the last event is returned. The list is returned in the form of an array of objects, where each object is an "audit event information" object (AuditEventInfo). Each AuditEventInfo object corresponds to a user audit event (for example a project login) and contains a reference to a project (that can be null), to a user and a timestamp.

Supported API: false

Parameters:
period -
Returns:
Object []
Throws:
WTException
See Also:
AuditEventInfo

collectSubprojects

private static void collectSubprojects(WTContainer context,
                                       Vector sub_projects)
                                throws WTException
Recursively gathers all subcontainers of a project in a vector passed as argument.

Throws:
WTException