wt.audit
Class AuditPeriod

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

public class AuditPeriod
extends Object
implements Externalizable

AuditPeriod represents the time interval for which auditing information is desired. This interval can be constructed with a start and an end date. However, it is possible to have intervals that have no start date, no end date or both.

An AuditPeriod object is composed of many "actvity periods" which are the smallest interval about which there is an interest about getting auditing information. For example, an activity period could be a day and an audit period a month or a week (7 days). The activity period is defined for the installation in the wt.properties file.

Supported API: false

Extendable: false

See Also:
Serialized Form

Field Summary
private static long ACTIVITY_PERIOD_SIZE
           
private static String CLASSNAME
           
private  long end
           
static long EXTERNALIZATION_VERSION_UID
           
protected static long OLD_FORMAT_VERSION_UID
           
private static String RESOURCE
           
(package private) static long serialVersionUID
           
private  long start
           
private static boolean VERBOSE
           
 
Constructor Summary
AuditPeriod()
          Null arg constructor.
AuditPeriod(Timestamp start_date, Timestamp end_date)
          Constructor that takes a start and an end date.
 
Method Summary
 boolean equals(Object object)
          Determines if the audit period is equal to the object passed as argument.
 Timestamp getEndDate()
          Retrieves the period's enddate.
 Timestamp getStartDate()
          Retrieves the period's start date.
 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(AuditPeriod thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
 void setEndDate(Timestamp end_date)
          Sets or changes the end date of an audit period.
 void setStartDate(Timestamp start_date)
          Sets or changes the start date of an audit period.
 String toString()
          Returns string representation of the audit period.
 void writeExternal(ObjectOutput output)
          Writes the non-transient fields of this class to an external source.
 
Methods inherited from class java.lang.Object
clone, 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

start

private long start

end

private long end

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

ACTIVITY_PERIOD_SIZE

private static final long ACTIVITY_PERIOD_SIZE

VERBOSE

private static final boolean VERBOSE
Constructor Detail

AuditPeriod

public AuditPeriod()
Null arg constructor. The period thus constructor is open in both ends.

Supported API: false


AuditPeriod

public AuditPeriod(Timestamp start_date,
                   Timestamp end_date)
            throws WTException
Constructor that takes a start and an end date. The period thus constructed is the shortest interval containing both dates. This is to say that the actual period start date is not necessarily the one passed as argument; similarly for the end date. An audit period must contain necessarily an integer number of activity periods.

Supported API: false

Parameters:
start_date -
end_date -
Throws:
WTException
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(AuditPeriod 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

setStartDate

public void setStartDate(Timestamp start_date)
                  throws WTException
Sets or changes the start date of an audit period. Because the audit period must contain an integer number of activity periods, the actual period's start date (the one returned by 'getStartDate') may not be exactly the one passed as argument to this method.

Passing null as argument resets the start date, making the period open ended at this side.

Supported API: false

Parameters:
start_date -
Throws:
WTException

setEndDate

public void setEndDate(Timestamp end_date)
                throws WTException
Sets or changes the end date of an audit period. Because the audit period must contain an integer number of activity periods, the actual period's end date (the one returned by 'getEndDate') may not be exactly the one passed as argument to this method.

Passing null as argument resets the end date, making the period open ended at this side.

Supported API: false

Parameters:
end_date -
Throws:
WTException

getStartDate

public Timestamp getStartDate()
Retrieves the period's start date. Because the audit period must contain an integer number of activity periods, the date returned by this method may not be the same as the one passed as argument in the period's constructor or the 'setStartDate' method.

This method returns null is the period is open ended at this side.

Supported API: false

Returns:
Timestamp

getEndDate

public Timestamp getEndDate()
Retrieves the period's enddate. Because the audit period must contain an integer number of activity periods, the date returned by this method may not be the same as the one passed as argument in the period's constructor or the 'setEndDate' method.

This method returns null is the period is open ended at this side.

Supported API: false

Returns:
Timestamp

toString

public String toString()
Returns string representation of the audit period.

Supported API: false

Returns:
String

equals

public boolean equals(Object object)
Determines if the audit period is equal to the object passed as argument. Returns 'true' if the object is also an audit period with the same start and end date.

Supported API: false

Parameters:
object -
Returns:
boolean