wt.projmgmt.monitor
Class ProjMonitorServerHelper

java.lang.Object
  extended bywt.projmgmt.monitor.ProjMonitorServerHelper
All Implemented Interfaces:
Externalizable, Serializable

public class ProjMonitorServerHelper
extends Object
implements Externalizable

Helper class giving server access to ProjMonitorServiceSvr functionality. Contains also utility methods.

Supported API: false

Extendable: false

See Also:
wt.projmgmt.moinitor.ProjMonitorServiceSvr, Serialized Form

Field Summary
static int BOTH
          

Supported API: false
private static String CLASSNAME
           
static int DOWN
          

Supported API: false
static long EXTERNALIZATION_VERSION_UID
           
private static long MAX_DURATION
           
protected static long OLD_FORMAT_VERSION_UID
           
private static String RESOURCE
           
(package private) static long serialVersionUID
           
static ProjMonitorServiceSvr service
          

Supported API: false
static int UP
          

Supported API: false
private static boolean VERBOSE
           
 
Constructor Summary
ProjMonitorServerHelper()
           
 
Method Summary
static void checkDuration(TimeToElapse duration)
          Throws wt.util.ProjectManagementException if duration passed as argument is larger than a customizable limit.
static void checkEnabled(ExecutionObject exec_obj)
          Throws an exception if object is not enabled.
static void checkManagerAccess(ExecutionObject exec_obj, String attr_key)
          Throws an authorization exception if the current principal is not a project manager.
static void checkNotClosed(ExecutionObject exec_obj)
          Throws an exception if object's state is closed (COMPLETED or CANCELLED).
static void checkRunning(ExecutionObject exec_obj)
          Throws an exception if object's state is not RUNNING.
static Timestamp computeTimePastDeadline(ExecutionObject exec_obj)
          Auxiliary method to compute time before the object's deadline given the execution object.
static Timestamp computeTimeToDeadline(ExecutionObject exec_obj)
          Auxiliary method to compute time before the object's deadline given the execution object.
static Enumeration getComponents(ExecutionObject exec_obj)
          Returns components of execution object.
static QueryResult getHolders(ExecutionObject exec_obj)
          Returns an enumeration with the holders of the execution object (deliverable or node).
private static ObjectIdentifier getOid(Object obj)
           
private static String getOidString(Object obj)
           
private static Timestamp getTimeToStart(Object object)
          Returns time to start.
 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(ProjMonitorServerHelper thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
private static String showVector(Vector objs)
          Returns a String contained the list of persistables in the Vector.
 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

BOTH

public static final int BOTH


Supported API: false

See Also:
Constant Field Values

DOWN

public static final int DOWN


Supported API: false

See Also:
Constant Field Values

UP

public static final int UP


Supported API: false

See Also:
Constant Field Values

service

public static final ProjMonitorServiceSvr service


Supported API: false


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

VERBOSE

private static final boolean VERBOSE

MAX_DURATION

private static final long MAX_DURATION
Constructor Detail

ProjMonitorServerHelper

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

checkDuration

public static void checkDuration(TimeToElapse duration)
                          throws WTException
Throws wt.util.ProjectManagementException if duration passed as argument is larger than a customizable limit. The customizable limit is set as 'wt.calendar.delta' in 'wt.properties' in years. The default value is 10 years.

Supported API: false

Parameters:
duration -
Throws:
WTException

checkEnabled

public static void checkEnabled(ExecutionObject exec_obj)
                         throws WTException
Throws an exception if object is not enabled.

Supported API: false

Parameters:
exec_obj -
Throws:
WTException

checkManagerAccess

public static void checkManagerAccess(ExecutionObject exec_obj,
                                      String attr_key)
                               throws WTException
Throws an authorization exception if the current principal is not a project manager.

Supported API: false

Parameters:
exec_obj -
attr_key -
Throws:
WTException

checkNotClosed

public static void checkNotClosed(ExecutionObject exec_obj)
                           throws WTException
Throws an exception if object's state is closed (COMPLETED or CANCELLED).

Supported API: false

Parameters:
exec_obj -
Throws:
WTException

checkRunning

public static void checkRunning(ExecutionObject exec_obj)
                         throws WTException
Throws an exception if object's state is not RUNNING.

Supported API: false

Parameters:
exec_obj -
Throws:
WTException

computeTimePastDeadline

public static Timestamp computeTimePastDeadline(ExecutionObject exec_obj)
                                         throws WTException
Auxiliary method to compute time before the object's deadline given the execution object. Returns null if either deadline is null or time to elapse after deadline is set to 0.

Supported API: false

Parameters:
exec_obj -
Returns:
Timestamp
Throws:
WTException

computeTimeToDeadline

public static Timestamp computeTimeToDeadline(ExecutionObject exec_obj)
                                       throws WTException
Auxiliary method to compute time before the object's deadline given the execution object. Returns null if either deadline is null or time to elapse before deadline is set to 0.

Supported API: false

Parameters:
exec_obj -
Returns:
Timestamp
Throws:
WTException

getHolders

public static QueryResult getHolders(ExecutionObject exec_obj)
                              throws WTException
Returns an enumeration with the holders of the execution object (deliverable or node).

Supported API: false

Parameters:
exec_obj -
Returns:
QueryResult
Throws:
WTException

getComponents

public static Enumeration getComponents(ExecutionObject exec_obj)
                                 throws WTException
Returns components of execution object. The list of components depend on the class of the execution object in the following way.

Throws:
WTException

getOidString

private static String getOidString(Object obj)

showVector

private static String showVector(Vector objs)
Returns a String contained the list of persistables in the Vector.


getOid

private static ObjectIdentifier getOid(Object obj)

getTimeToStart

private static Timestamp getTimeToStart(Object object)
Returns time to start. Assumes argument is a WfExecutionObject.