wt.scheduler
Class ScheduleItem

java.lang.Object
  extended bywt.fc.WTObject
      extended bywt.enterprise.Simple
          extended bywt.scheduler.ScheduleItem
All Implemented Interfaces:
AccessControlled, BusinessInformation, Cloneable, DisplayIdentification, DomainAdministered, Externalizable, NetFactor, Notifiable, ObjectMappable, Persistable, Serializable

public class ScheduleItem
extends Simple
implements Cloneable, Externalizable

Use the newScheduleItem static factory method(s), not the ScheduleItem constructor, to construct instances of this class. Instances must be constructed using the static factory(s), in order to ensure proper initialization of the instance.



Supported API: false

Extendable: false

See Also:
Serialized Form

Field Summary
private  boolean cancelled
           
protected static String CANCELLED
          Label for the attribute.
private static String CLASSNAME
           
static long EXTERNALIZATION_VERSION_UID
           
static String IMMEDIATE_MODE
          Label for the attribute.
private  boolean immediateMode
           
static String ITEM_DESCRIPTION
          Label for the attribute; This is the user defined description for the scheudle item.
private static int ITEM_DESCRIPTION_UPPER_LIMIT
           
static String ITEM_NAME
          Label for the attribute; This is a user defined name for the schedule item.
private static int ITEM_NAME_UPPER_LIMIT
           
private  String itemDescription
           
private  String itemName
           
static String NEXT_TIME
          Label for the attribute.
private  Timestamp nextTime
           
protected static long OLD_FORMAT_VERSION_UID
           
private  long periodicity
           
static String PERIODICITY
          Label for the attribute; Period length in seconds.
static String PRINCIPAL_REF
          Label for the attribute.
private  WTPrincipalReference principalRef
           
protected static String QE_REFERENCE
          Label for the attribute; ObectReference of the QueueEntry object which is generated during the postCreate method

Supported API: false
private  ObjectReference qeReference
           
static String QUEUE_NAME
          Label for the attribute; Name of the ProcessQueue that this method is targeted for.
private static int QUEUE_NAME_UPPER_LIMIT
           
private  String queueName
           
private static String RESOURCE
           
protected static String RUN_COUNT
          Label for the attribute; Number of times the ScheduleItem has been run Users should use getCurrentRunCount to get this value.
private  long runCount
           
(package private) static long serialVersionUID
           
static String START_DATE
          Label for the attribute; At the moment, the meaning of this parameter is dependant on the schedule type.
private  Timestamp startDate
           
static String TARGET_CLASS
          Label for the attribute.
private static int TARGET_CLASS_UPPER_LIMIT
           
static String TARGET_METHOD
          Label for the attribute; This is the method to be scheduled It is a string of the form "ClassName.methodName" The method must be static, and any return value would be lost.
private static int TARGET_METHOD_UPPER_LIMIT
           
private  String targetClass
           
private  String targetMethod
           
static String TO_BE_RUN
          Label for the attribute; Number of times the schedule item is scheduled to be run.
private  long toBeRun
           
 
Fields inherited from class wt.enterprise.Simple
 
Fields inherited from class wt.fc.WTObject
CREATE_TIMESTAMP, MODIFY_TIMESTAMP
 
Fields inherited from interface wt.admin.DomainAdministered
DOMAIN_REF, INHERITED_DOMAIN
 
Fields inherited from interface wt.fc.BusinessInformation
BUSINESS_TYPE, IDENTITY
 
Fields inherited from interface wt.notify.Notifiable
EVENT_SET
 
Fields inherited from interface wt.fc.Persistable
IDENTITY, PERSIST_INFO, TYPE
 
Fields inherited from interface wt.identity.DisplayIdentification
DISPLAY_IDENTIFIER, DISPLAY_IDENTITY, DISPLAY_TYPE
 
Constructor Summary
ScheduleItem()
           
 
Method Summary
 Object clone()
          

Supported API: false
 void copyAttributesFrom(ScheduleItem other)
          Copies attribute values not relative to DB access from another Schedule Item.
Useful when copying values from another Schedule Item over an item already retrieved from the DB.
 boolean equals(Object obj)
          Indicates whether the given object is equal to this object from a persistence perspective, by comparing the two objects ObjectIdentifiers.
protected  SchedStatusInfo execute()
          Helper method for running scheduling methods.
private  MethodArgument[] getArgs()
          Get method arguments for target method
 String getConceptualClassname()
          Deprecated.  
 Timestamp getCurrentNextTime()
          Retrieves the next time the method will be executed.
 long getCurrentRunCount()
          Gets the current runcount for the schedule item.
 WTMessage getCurrentRunStatus()
          

Supported API: false
 boolean getIsCancelled()
          

Supported API: false
 String getItemDescription()
          Gets the value of the attribute: ITEM_DESCRIPTION.
 String getItemName()
          Gets the value of the attribute: ITEM_NAME.
protected  ScheduleHistory getLatestSchedHistory()
          

Supported API: false
 Timestamp getNextTime()
          Gets the value of the attribute: NEXT_TIME.
 long getPeriodicity()
          Gets the value of the attribute: PERIODICITY.
 WTPrincipalReference getPrincipalRef()
          Gets the value of the attribute: PRINCIPAL_REF.
protected  ObjectReference getQeReference()
          Gets the value of the attribute: QE_REFERENCE.
 String getQueueName()
          Gets the value of the attribute: QUEUE_NAME.
protected  long getRunCount()
          Gets the value of the attribute: RUN_COUNT.
 Timestamp getStartDate()
          Gets the value of the attribute: START_DATE.
 String getTargetClass()
          Gets the value of the attribute: TARGET_CLASS.
 String getTargetMethod()
          Gets the value of the attribute: TARGET_METHOD.
 long getToBeRun()
          Gets the value of the attribute: TO_BE_RUN.
 int hashCode()
          Returns a hash code for this object based upon its ObjectIdentifier.
protected  void initialize()
          

Supported API: false
protected  boolean isCancelled()
          Gets the value of the attribute: CANCELLED.
 boolean isImmediateMode()
          Gets the value of the attribute: IMMEDIATE_MODE.
static ScheduleItem newScheduleItem()
          

Supported API: false
 void readExternal(ObjectInput input)
          Reads the non-transient fields of this class from an external source.
 void readExternal(PersistentRetrieveIfc input)
          Used by Persistent Data Service to populate the persistent attributes of this class from a persistent store.
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(ScheduleItem thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
protected  void setCancelled(boolean a_Cancelled)
          Sets the value of the attribute: CANCELLED.
 void setImmediateMode(boolean a_ImmediateMode)
          Sets the value of the attribute: IMMEDIATE_MODE.
 void setItemDescription(String a_ItemDescription)
          Sets the value of the attribute: ITEM_DESCRIPTION.
 void setItemName(String a_ItemName)
          Sets the value of the attribute: ITEM_NAME.
 void setMethod(String className, String methodName)
          

Supported API: false
 void setNextTime(Timestamp a_NextTime)
          Sets the value of the attribute: NEXT_TIME.
 void setPeriodicity(long a_Periodicity)
          Sets the value of the attribute: PERIODICITY.
 void setPrincipalRef(WTPrincipalReference a_PrincipalRef)
          Sets the value of the attribute: PRINCIPAL_REF.
protected  void setQeReference(ObjectReference a_QeReference)
          Sets the value of the attribute: QE_REFERENCE.
 void setQueueName(String a_QueueName)
          Sets the value of the attribute: QUEUE_NAME.
protected  void setRunCount(long a_RunCount)
          Sets the value of the attribute: RUN_COUNT.
 void setStartDate(Timestamp a_StartDate)
          Sets the value of the attribute: START_DATE.
 void setTargetClass(String a_TargetClass)
          Sets the value of the attribute: TARGET_CLASS.
 void setTargetMethod(String a_TargetMethod)
          Sets the value of the attribute: TARGET_METHOD.
 void setToBeRun(long a_ToBeRun)
          Sets the value of the attribute: TO_BE_RUN.
 String toString()
          

Supported API: false
 void writeExternal(ObjectOutput output)
          Writes the non-transient fields of this class to an external source.
 void writeExternal(PersistentStoreIfc output)
          Used by Persistent Data Service to obtain the values of the persistent attributes of this class, so they can be written to a persistent store.
 
Methods inherited from class wt.enterprise.Simple
getBusinessType, getDomainRef, getEventSet, getIdentity, isInheritedDomain, readVersion, setDomainRef, setEventSet, setInheritedDomain
 
Methods inherited from class wt.fc.WTObject
checkAttributes, duplicate, finalize, getClassInfo, getCreateTimestamp, getDisplayIdentifier, getDisplayIdentity, getDisplayType, getModifyTimestamp, getPersistInfo, getType, readVersion, setPersistInfo
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface wt.fc.NetFactor
getClassInfo
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

QUEUE_NAME

public static final String QUEUE_NAME
Label for the attribute; Name of the ProcessQueue that this method is targeted for. If this is not specified, the scheduling service will use the default process queue.

Supported API: false

See Also:
Constant Field Values

QUEUE_NAME_UPPER_LIMIT

private static int QUEUE_NAME_UPPER_LIMIT

queueName

private String queueName

TARGET_CLASS

public static final String TARGET_CLASS
Label for the attribute.

Supported API: false

See Also:
Constant Field Values

TARGET_CLASS_UPPER_LIMIT

private static int TARGET_CLASS_UPPER_LIMIT

targetClass

private String targetClass

TARGET_METHOD

public static final String TARGET_METHOD
Label for the attribute; This is the method to be scheduled It is a string of the form "ClassName.methodName" The method must be static, and any return value would be lost.

Supported API: false

See Also:
Constant Field Values

TARGET_METHOD_UPPER_LIMIT

private static int TARGET_METHOD_UPPER_LIMIT

targetMethod

private String targetMethod

TO_BE_RUN

public static final String TO_BE_RUN
Label for the attribute; Number of times the schedule item is scheduled to be run. If this entry is negative, the ScheduleItem is run indefinately

Supported API: false

See Also:
Constant Field Values

toBeRun

private long toBeRun

PERIODICITY

public static final String PERIODICITY
Label for the attribute; Period length in seconds.

Supported API: false

See Also:
Constant Field Values

periodicity

private long periodicity

ITEM_NAME

public static final String ITEM_NAME
Label for the attribute; This is a user defined name for the schedule item. If a client developer specifies this name, it can be usefull for performing queries.

Supported API: false

See Also:
Constant Field Values

ITEM_NAME_UPPER_LIMIT

private static int ITEM_NAME_UPPER_LIMIT

itemName

private String itemName

ITEM_DESCRIPTION

public static final String ITEM_DESCRIPTION
Label for the attribute; This is the user defined description for the scheudle item. This attribute is for the convenience of client developers. Client writers. It is meant to be displayed in a text area.

Supported API: false

See Also:
Constant Field Values

ITEM_DESCRIPTION_UPPER_LIMIT

private static int ITEM_DESCRIPTION_UPPER_LIMIT

itemDescription

private String itemDescription

PRINCIPAL_REF

public static final String PRINCIPAL_REF
Label for the attribute.

Supported API: false

See Also:
Constant Field Values

principalRef

private WTPrincipalReference principalRef

IMMEDIATE_MODE

public static final String IMMEDIATE_MODE
Label for the attribute.

Supported API: false

See Also:
Constant Field Values

immediateMode

private boolean immediateMode

START_DATE

public static final String START_DATE
Label for the attribute; At the moment, the meaning of this parameter is dependant on the schedule type. I know this is evil, and will change it later.

Supported API: false

See Also:
Constant Field Values

startDate

private Timestamp startDate

RUN_COUNT

protected static final String RUN_COUNT
Label for the attribute; Number of times the ScheduleItem has been run Users should use getCurrentRunCount to get this value. Clients should not set this attribute.

Supported API: false

See Also:
Constant Field Values

runCount

private long runCount

NEXT_TIME

public static final String NEXT_TIME
Label for the attribute.

Supported API: false

See Also:
Constant Field Values

nextTime

private Timestamp nextTime

QE_REFERENCE

protected static final String QE_REFERENCE
Label for the attribute; ObectReference of the QueueEntry object which is generated during the postCreate method

Supported API: false

See Also:
Constant Field Values

qeReference

private ObjectReference qeReference

CANCELLED

protected static final String CANCELLED
Label for the attribute.

Supported API: false

See Also:
Constant Field Values

cancelled

private boolean cancelled

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

ScheduleItem

public ScheduleItem()
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
Overrides:
writeExternal in class Simple
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
Overrides:
readExternal in class Simple
Parameters:
input -
Throws:
IOException
ClassNotFoundException

readVersion

protected boolean readVersion(ScheduleItem 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

writeExternal

public void writeExternal(PersistentStoreIfc output)
                   throws SQLException,
                          DatastoreException
Used by Persistent Data Service to obtain the values of the persistent attributes of this class, so they can be written to a persistent store.

(Not intended for general use.)

Supported API: false

Specified by:
writeExternal in interface ObjectMappable
Overrides:
writeExternal in class Simple
Parameters:
output -
Throws:
SQLException
DatastoreException

readExternal

public void readExternal(PersistentRetrieveIfc input)
                  throws SQLException,
                         DatastoreException
Used by Persistent Data Service to populate the persistent attributes of this class from a persistent store.

(Not intended for general use.)

Supported API: false

Specified by:
readExternal in interface ObjectMappable
Overrides:
readExternal in class Simple
Parameters:
input -
Throws:
SQLException
DatastoreException

getConceptualClassname

public String getConceptualClassname()
Deprecated.  

Returns the conceptual (modeled) name for the class.

Supported API: false

Specified by:
getConceptualClassname in interface NetFactor
Returns:
String

getQueueName

public String getQueueName()
Gets the value of the attribute: QUEUE_NAME. Name of the ProcessQueue that this method is targeted for. If this is not specified, the scheduling service will use the default process queue.

Supported API: false

Returns:
String

setQueueName

public void setQueueName(String a_QueueName)
Sets the value of the attribute: QUEUE_NAME. Name of the ProcessQueue that this method is targeted for. If this is not specified, the scheduling service will use the default process queue.

Supported API: false

Parameters:
a_QueueName -

getTargetClass

public String getTargetClass()
Gets the value of the attribute: TARGET_CLASS.

Supported API: false

Returns:
String

setTargetClass

public void setTargetClass(String a_TargetClass)
Sets the value of the attribute: TARGET_CLASS.

Supported API: false

Parameters:
a_TargetClass -

getTargetMethod

public String getTargetMethod()
Gets the value of the attribute: TARGET_METHOD. This is the method to be scheduled It is a string of the form "ClassName.methodName" The method must be static, and any return value would be lost.

Supported API: false

Returns:
String

setTargetMethod

public void setTargetMethod(String a_TargetMethod)
Sets the value of the attribute: TARGET_METHOD. This is the method to be scheduled It is a string of the form "ClassName.methodName" The method must be static, and any return value would be lost.

Supported API: false

Parameters:
a_TargetMethod -

getToBeRun

public long getToBeRun()
Gets the value of the attribute: TO_BE_RUN. Number of times the schedule item is scheduled to be run. If this entry is negative, the ScheduleItem is run indefinately

Supported API: false

Returns:
long

setToBeRun

public void setToBeRun(long a_ToBeRun)
Sets the value of the attribute: TO_BE_RUN. Number of times the schedule item is scheduled to be run. If this entry is negative, the ScheduleItem is run indefinately

Supported API: false

Parameters:
a_ToBeRun -

getPeriodicity

public long getPeriodicity()
Gets the value of the attribute: PERIODICITY. Period length in seconds.

Supported API: false

Returns:
long

setPeriodicity

public void setPeriodicity(long a_Periodicity)
Sets the value of the attribute: PERIODICITY. Period length in seconds.

Supported API: false

Parameters:
a_Periodicity -

getItemName

public String getItemName()
Gets the value of the attribute: ITEM_NAME. This is a user defined name for the schedule item. If a client developer specifies this name, it can be usefull for performing queries.

Supported API: false

Returns:
String

setItemName

public void setItemName(String a_ItemName)
Sets the value of the attribute: ITEM_NAME. This is a user defined name for the schedule item. If a client developer specifies this name, it can be usefull for performing queries.

Supported API: false

Parameters:
a_ItemName -

getItemDescription

public String getItemDescription()
Gets the value of the attribute: ITEM_DESCRIPTION. This is the user defined description for the scheudle item. This attribute is for the convenience of client developers. Client writers. It is meant to be displayed in a text area.

Supported API: false

Returns:
String

setItemDescription

public void setItemDescription(String a_ItemDescription)
Sets the value of the attribute: ITEM_DESCRIPTION. This is the user defined description for the scheudle item. This attribute is for the convenience of client developers. Client writers. It is meant to be displayed in a text area.

Supported API: false

Parameters:
a_ItemDescription -

getPrincipalRef

public WTPrincipalReference getPrincipalRef()
Gets the value of the attribute: PRINCIPAL_REF.

Supported API: false

Returns:
WTPrincipalReference

setPrincipalRef

public void setPrincipalRef(WTPrincipalReference a_PrincipalRef)
Sets the value of the attribute: PRINCIPAL_REF.

Supported API: false

Parameters:
a_PrincipalRef -

isImmediateMode

public boolean isImmediateMode()
Gets the value of the attribute: IMMEDIATE_MODE.

Supported API: false

Returns:
boolean

setImmediateMode

public void setImmediateMode(boolean a_ImmediateMode)
Sets the value of the attribute: IMMEDIATE_MODE.

Supported API: false

Parameters:
a_ImmediateMode -

getStartDate

public Timestamp getStartDate()
Gets the value of the attribute: START_DATE. At the moment, the meaning of this parameter is dependant on the schedule type. I know this is evil, and will change it later.

Supported API: false

Returns:
Timestamp

setStartDate

public void setStartDate(Timestamp a_StartDate)
Sets the value of the attribute: START_DATE. At the moment, the meaning of this parameter is dependant on the schedule type. I know this is evil, and will change it later.

Supported API: false

Parameters:
a_StartDate -

getRunCount

protected long getRunCount()
Gets the value of the attribute: RUN_COUNT. Number of times the ScheduleItem has been run Users should use getCurrentRunCount to get this value. Clients should not set this attribute.

Supported API: false

Returns:
long

setRunCount

protected void setRunCount(long a_RunCount)
Sets the value of the attribute: RUN_COUNT. Number of times the ScheduleItem has been run Users should use getCurrentRunCount to get this value. Clients should not set this attribute.

Supported API: false

Parameters:
a_RunCount -

getNextTime

public Timestamp getNextTime()
Gets the value of the attribute: NEXT_TIME.

Supported API: false

Returns:
Timestamp

setNextTime

public void setNextTime(Timestamp a_NextTime)
Sets the value of the attribute: NEXT_TIME.

Supported API: false

Parameters:
a_NextTime -

getQeReference

protected ObjectReference getQeReference()
Gets the value of the attribute: QE_REFERENCE. ObectReference of the QueueEntry object which is generated during the postCreate method

Supported API: false

Returns:
ObjectReference

setQeReference

protected void setQeReference(ObjectReference a_QeReference)
Sets the value of the attribute: QE_REFERENCE. ObectReference of the QueueEntry object which is generated during the postCreate method

Supported API: false

Parameters:
a_QeReference -

isCancelled

protected boolean isCancelled()
Gets the value of the attribute: CANCELLED.

Supported API: false

Returns:
boolean

setCancelled

protected void setCancelled(boolean a_Cancelled)
Sets the value of the attribute: CANCELLED.

Supported API: false

Parameters:
a_Cancelled -

newScheduleItem

public static ScheduleItem newScheduleItem()
                                    throws WTException


Supported API: false

Returns:
ScheduleItem
Throws:
WTException

toString

public String toString()


Supported API: false

Overrides:
toString in class WTObject
Returns:
String

setMethod

public void setMethod(String className,
                      String methodName)
               throws IllegalArgumentException


Supported API: false

Parameters:
className -
methodName -
Throws:
IllegalArgumentException

getCurrentRunCount

public long getCurrentRunCount()
Gets the current runcount for the schedule item.

Supported API: false

Returns:
long

getCurrentNextTime

public Timestamp getCurrentNextTime()
Retrieves the next time the method will be executed. Clients should not attempt to set this value. If all runs have been completed this variable will state the last time the method was executed. (A client should check runCount and toBeRun to determine whether all runs have been completed).

Supported API: false

Returns:
Timestamp

clone

public Object clone()
             throws CloneNotSupportedException


Supported API: false

Returns:
Object
Throws:
CloneNotSupportedException

getCurrentRunStatus

public WTMessage getCurrentRunStatus()
                              throws WTException


Supported API: false

Returns:
WTMessage
Throws:
WTException

getIsCancelled

public boolean getIsCancelled()


Supported API: false

Returns:
boolean

initialize

protected void initialize()
                   throws WTException


Supported API: false

Overrides:
initialize in class Simple
Throws:
WTException

execute

protected SchedStatusInfo execute()
                           throws WTException
Helper method for running scheduling methods. Should not be called directly.

Supported API: false

Returns:
SchedStatusInfo
Throws:
WTException

getLatestSchedHistory

protected ScheduleHistory getLatestSchedHistory()
                                         throws WTException


Supported API: false

Returns:
ScheduleHistory
Throws:
WTException

equals

public boolean equals(Object obj)
Indicates whether the given object is equal to this object from a persistence perspective, by comparing the two objects ObjectIdentifiers. Changed or stale copies are still considered equal by this method. Delegates to PersistenceHelper.equals(Persistable,Object).

Warning: Certain core Windchill operations may depend upon equals being ObjectIdentifier-based. Changes to the default implementation should be done with care, if at all.

Supported API: false

Overrides:
equals in class Simple
Parameters:
obj -
Returns:
boolean

hashCode

public int hashCode()
Returns a hash code for this object based upon its ObjectIdentifier. Delegates to PersistenceHelper.hashCode(Persistable).

Warning: Certain core Windchill operations may depend upon hashCode being ObjectIdentifier-based. Changes to the default implementation should be done with care, if at all.

Supported API: false

Overrides:
hashCode in class Simple
Returns:
int

getArgs

private MethodArgument[] getArgs()
                          throws WTException
Get method arguments for target method

Throws:
WTException

copyAttributesFrom

public void copyAttributesFrom(ScheduleItem other)
Copies attribute values not relative to DB access from another Schedule Item.
Useful when copying values from another Schedule Item over an item already retrieved from the DB.

Parameters:
other - another ScheduleItem to copy values from.
Returns:
the same Schedule item with its values changed
Since:
Windchill R6 - build 35