com.ibm.tws.objects.model
Class Job

java.lang.Object
  extended bycom.ibm.tws.objects.model.FlowNode
      extended bycom.ibm.tws.objects.model.Job
All Implemented Interfaces:
java.io.Serializable, TWSObject

public class Job
extends FlowNode

This subclass of FlowNode represents a job object, and includes a reference to JobDefinition, to navigate to the job definition from which it was created, and a list of InternalDependency objects, to model dependencies of this job from other jobs of the same job stream. It wraps a JobHeader object through FlowNode, and in turn the header wraps a JobKey through FlowNodeHeader. A job is externally identified by its name and by the job stream to which it belongs, as shown by JobKey.

The following syntax validation constraints must be met on Job objects in distributed environment:

name Always required
Alphanumeric characters
Starting with alphabetic character
'-' and '_' characters allowed
Blank spaces not allowed
Not longer than 40 characters
monitored Default value is false
repeatInterval An amount of time, expressed in milliseconds
Allowed range is from 0 to 362,340,000 (0-99h99m)
requiresConfirmation Default value is false
jobStreamKey Must reference an existing job stream
jobDefinitionKey Must reference an existing job definition
internalDependencies A list of InternalDependency objects
See InternalDependency for other constraints

Notice that a job's estimated duration is hosted by the normalElapsedTime field of the job definition: in order to change this value, the job definition must be set BEFORE calling the setEstimatedDuration() method, otherwise the value passed to this method will be lost.

About internal dependencies, notice that if you add twice the same dependency to the list, only the last instance added to the list is stored when creating or modifying the job. In other words, if multiple internal dependencies reference the same job, only the last one is saved.

Also notice that a job can be defined by a job definition that is associated to a workstation class only if the job stream is associated to the same workstation class.

The following syntax validation constraints must be met on Job objects in z/OS environment:

name Always required
Must be an integer number between 1 and 255
description Not longer than 24 characters
estimatedDuration Estimated duration in milliseconds
timeRestrictions See TimeRestrictions for other constraints
resourceDependencies A list of ResourceDependency objects
See ResourceDependency for other constraints
jobDefinition Must reference an existing job definition
See ZOSJobDefinition for other constraints
monitored Monitoring flag: default value is false
This flag is ignored if the version of Tivoli Workload Scheduler is prior to 8.1
repeatInterval N/A
requiresConfirmation N/A
jobStreamKey N/A
jobDefinitionKey N/A
internalDependencies N/A

See Also:
FlowNode, InternalDependency, TimeRestrictions, ResourceDependency, ZOSJobDefinition, Serialized Form

Field Summary
static java.lang.String COPYRIGHT
          Copyright.
 
Fields inherited from class com.ibm.tws.objects.model.FlowNode
DEFAULT_PRIORITY
 
Constructor Summary
Job()
          Creates an empty Job.
Job(JobHeader jobHeader)
          Creates a job with the specified header.
 
Method Summary
 boolean equals(java.lang.Object object)
          Returns true if all fields of this Job object are equal to those of the given one.
 Identifier getAbstractJobStreamId()
          Returns the identifier of the abstract job stream that includes the abstract job.
 long getEstimatedDuration()
          Returns the normal elapsed time of the job definition, or TypeUtility.NULL_OFFSET if no job definition is set.
 java.util.List getInternalDependencies()
          Returns a reference to the list of internal dependencies for this job.
 JobDefinition getJobDefinition()
          Returns the job definition on which this job is defined.
 Identifier getJobDefinitionId()
          Returns the identifier of the job definition on which this job is defined.
 JobDefinitionKey getJobDefinitionKey()
          Returns the key of the job definition on which this job is defined.
 Identifier getJobStreamId()
          Returns the identifier of the job stream that includes this job.
 JobStreamKey getJobStreamKey()
          Returns the key of the job stream that includes this job.
 LockData getLockData()
          Returns null, since this object has no lock data.
 ModifyData getModifyData()
          Returns null, since this object has no modification data.
 int getPosition()
          Returns the position of this job in the job list of the job stream.
 long getRepeatInterval()
          Returns the job repeat interval.
 int hashCode()
          Returns a hash code for this Job object.
 boolean requiresConfirmation()
          Returns true if this job requires confirmation.
 void setAbstractJobStreamId(Identifier identifier)
          Sets the identifier of the abstract job stream that includes the abstract job.
 void setEstimatedDuration(long value)
          Sets the normal elapsed time on the job definition, or does nothing if no job definition is set.
 void setJobDefinition(JobDefinition definition)
          Sets the job definition on which this job is defined.
 void setJobDefinitionId(Identifier identifier)
          Sets the identifier of the job definition on which this job is defined.
 void setJobDefinitionKey(JobDefinitionKey key)
          Sets the key of the job definition on which this job is defined.
 void setJobStreamId(Identifier identifier)
          Sets the identifier of the job stream that includes this job.
 void setJobStreamKey(JobStreamKey jstKey)
          Sets the key of the job stream that includes this job.
 void setPosition(int value)
          Sets the position of this job in the job list of the job stream.
 void setRepeatInterval(long value)
          Sets the job repeat interval.
 void setRequiresConfirmation(boolean value)
          Sets the property used to decide if this job requires confirmation.
 java.lang.String toString()
          Returns a string representation of this Job object.
 
Methods inherited from class com.ibm.tws.objects.model.FlowNode
getAbstractId, getComment, getDescription, getExternalDependencies, getFileDependencies, getHeader, getId, getInterNetworkDependencies, getKey, getName, getObjectHeader, getObjectKey, getPriority, getPromptDependencies, getResourceDependencies, getTimeRestrictions, getTimeZone, isMonitored, setAbstractId, setComment, setDescription, setHeader, setId, setKey, setMonitored, setName, setPriority, setTimeRestrictions, setTimeZone
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
Copyright.

Constructor Detail

Job

public Job()
Creates an empty Job.


Job

public Job(JobHeader jobHeader)
Creates a job with the specified header.

Parameters:
jobHeader - The job header.
Method Detail

getJobStreamKey

public JobStreamKey getJobStreamKey()
Returns the key of the job stream that includes this job.

Returns:
The key of the job stream that includes this job.

getModifyData

public ModifyData getModifyData()
Returns null, since this object has no modification data.

Returns:
Null, since this object has no modification data.

getLockData

public LockData getLockData()
Returns null, since this object has no lock data.

Returns:
Null, since this object has no lock data.

getEstimatedDuration

public long getEstimatedDuration()
Returns the normal elapsed time of the job definition, or TypeUtility.NULL_OFFSET if no job definition is set.

Returns:
The normal elapsed time of the job definition, or TypeUtility.NULL_OFFSET if no job definition is set.
See Also:
JobDefinition.getNormalElapsedTime()

getRepeatInterval

public long getRepeatInterval()
Returns the job repeat interval.

Returns:
The job repeat interval.

requiresConfirmation

public boolean requiresConfirmation()
Returns true if this job requires confirmation.

Returns:
True if this job requires confirmation.

getJobStreamId

public Identifier getJobStreamId()
Returns the identifier of the job stream that includes this job.

Returns:
The identifier of the job stream that includes this job.

getAbstractJobStreamId

public Identifier getAbstractJobStreamId()
Returns the identifier of the abstract job stream that includes the abstract job.

Returns:
The identifier of the abstract job stream that includes the abstract job.

getJobDefinitionId

public Identifier getJobDefinitionId()
Returns the identifier of the job definition on which this job is defined.

Returns:
The identifier of the job definition on which this job is defined.

getJobDefinitionKey

public JobDefinitionKey getJobDefinitionKey()
Returns the key of the job definition on which this job is defined.

Returns:
The key of the job definition on which this job is defined.

getJobDefinition

public JobDefinition getJobDefinition()
Returns the job definition on which this job is defined.

Returns:
The job definition on which this job is defined.

getPosition

public int getPosition()
Returns the position of this job in the job list of the job stream.

Returns:
The position of this job in the job list of the job stream.

getInternalDependencies

public java.util.List getInternalDependencies()
Returns a reference to the list of internal dependencies for this job.

Returns:
A reference to the list of internal dependencies for this job.

setJobStreamKey

public void setJobStreamKey(JobStreamKey jstKey)
Sets the key of the job stream that includes this job.

Parameters:
jstKey - The key of the job stream that includes this job.

setEstimatedDuration

public void setEstimatedDuration(long value)
Sets the normal elapsed time on the job definition, or does nothing if no job definition is set.

Parameters:
value - The normal elapsed time to be set on the job definition. This value is lost if no job definition is set.
See Also:
JobDefinition.setNormalElapsedTime(long)

setRepeatInterval

public void setRepeatInterval(long value)
Sets the job repeat interval.

Parameters:
value - The job repeat interval.

setRequiresConfirmation

public void setRequiresConfirmation(boolean value)
Sets the property used to decide if this job requires confirmation.

Parameters:
value - True if this job requires confirmation.

setJobStreamId

public void setJobStreamId(Identifier identifier)
Sets the identifier of the job stream that includes this job.

Parameters:
identifier - The identifier of the job stream that includes this job.

setAbstractJobStreamId

public void setAbstractJobStreamId(Identifier identifier)
Sets the identifier of the abstract job stream that includes the abstract job.

Parameters:
identifier - The identifier of the abstract job stream that includes the abstract job.

setJobDefinitionId

public void setJobDefinitionId(Identifier identifier)
Sets the identifier of the job definition on which this job is defined.

Parameters:
identifier - The identifier of the job definition on which this job is defined.

setJobDefinitionKey

public void setJobDefinitionKey(JobDefinitionKey key)
Sets the key of the job definition on which this job is defined.

Parameters:
key - The key of the job definition on which this job is defined.

setJobDefinition

public void setJobDefinition(JobDefinition definition)
Sets the job definition on which this job is defined.

Parameters:
definition - The job definition on which this job is defined.

setPosition

public void setPosition(int value)
Sets the position of this job in the job list of the job stream. For internal use only.

Parameters:
value - The position of this job in the job list of the job stream.

equals

public boolean equals(java.lang.Object object)
Returns true if all fields of this Job object are equal to those of the given one.

Overrides:
equals in class FlowNode
Parameters:
object - The object to be compared with this one.
Returns:
True if this object equals to the given one.

hashCode

public int hashCode()
Returns a hash code for this Job object.

Overrides:
hashCode in class FlowNode
Returns:
The object's hash code.

toString

public java.lang.String toString()
Returns a string representation of this Job object.

Overrides:
toString in class FlowNode
Returns:
A text string including all Job fields.


Copyright © 2005 IBM All Rights Reserved.