Rational Developer for Power Systems Software
V7.6

com.ibm.etools.iseries.subsystems.qsys.jobs
Class JobTicket

java.lang.Object
  extended by com.ibm.etools.iseries.subsystems.qsys.jobs.JobTicket
Direct Known Subclasses:
JobTicket

public class JobTicket
extends Object

A JobTicket stores information about a job running on an iSeries system. It can be saved and restored from a persistent form stored with the project metadata. Each ticket is persisted in a separate file. A project may have several tickets that each track a batch jobs for the project.

JobTickets are created by a user immediately after a job is submitted and then given to a JobTicketManager to manage. These are typically used to track build jobs.


Field Summary
static String Copyright
           
protected static String JOBTICKET_DIRECTORY
           
static String TASK_BLANK
           
static String TASK_BUILD
           
static String TASK_COMPILE
           
 
Constructor Summary
JobTicket(IBMiConnection connection, IQSYSJob job, String task, IJobTicketSource ticketSource)
          Creates a new job ticket from its parameter parts.
JobTicket(IBMiConnection connection, String jobNumber, String jobUser, String jobName, String task, IJobTicketSource ticketSource)
          Creates a new job ticket from its parameter parts.
JobTicket(SubSystem jobSubSystem, IQSYSJob job)
          Creates a new job ticket from its parameter parts.
JobTicket(SubSystem jobSubSystem, IQSYSJob job, String task, IJobTicketSource ticketSource)
          Creates a new job ticket from its parameter parts.
JobTicket(SubSystem jobSubSystem, String jobNumber, String jobUser, String jobName, String task, IJobTicketSource ticketSource)
          Creates a new job ticket from its parameter parts.
 
Method Summary
protected  void clearMemento()
          Clear the memento for this job.
static JobTicket createFrom(File mementoFile)
          Loads a ticket for a project with a given name.
 boolean equals(Object object)
          Override of equals to return true if two job tickets have the same job name, user and number and are from the same remote host.
 IBMiConnection getConnection()
          Returns an IBMiConnection associated with this job.
 String getFileName()
          Returns the simple filename where this ticket should be stored.
 IQSYSJob getJob()
          Return the IQSYSJob this ticket uses.
 String getJobName()
          Returns the name of the job.
 String getJobNumber()
          Returns the number of the job.
 IJobTicketSource getJobTicketSource()
          Returns the job ticket source for this job.
 IPath getLocation()
          Returns the location where this ticket is stored.
 IMemento getMemento()
          Returns a memento for this ticket.
 String getQualifiedJobName()
          Returns the fully qualified job name of this job ticket.
 String getStatusString()
          Returns the status of the job.
 SubSystem getSubSystem()
          Returns the subsystem for the job.
 String getTask()
          Returns the task for this Job.
 String getTicketName()
          Returns the name of the job ticket.
 long getTimeStamp()
          Returns the timeStamp of the job.
 String getUserName()
          Returns the user under whose profile the job was submitted.
 boolean isDirty()
          Returns true if and only if the ticket has been changed since it was last saved.
 boolean isFinished()
          Check if this job is finished.
 boolean isJobQueued()
          Check if this job is waiting on a job queue.
 boolean isOutputQueued()
          Check if this job is waiting on an output queue.
 boolean isPersistJob()
          Check if this job is persisted when the workbench is shutdown.
 boolean isRunning()
          Check if this job is finished.
 void refresh()
          Refresh the job information for this ticket
 void save()
          Saves this ticket.
 void setJobTicketSource(IJobTicketSource ticketSource)
          Sets the job ticket source for this job.
 void setPersistJob(boolean persist)
          Set if this job is persisted when the workbench is shutdown.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Copyright

public static final String Copyright
See Also:
Constant Field Values

TASK_BLANK

public static final String TASK_BLANK
See Also:
Constant Field Values

TASK_BUILD

public static final String TASK_BUILD

TASK_COMPILE

public static final String TASK_COMPILE

JOBTICKET_DIRECTORY

protected static final String JOBTICKET_DIRECTORY
See Also:
Constant Field Values
Constructor Detail

JobTicket

public JobTicket(SubSystem jobSubSystem,
                 IQSYSJob job)
Creates a new job ticket from its parameter parts. Usually done by a submitter. After a job ticket is created it is usually added to a JobTicketManager that will refresh its status, persist it and dispose of it when it is no longer needed. A newly created ticket is assumed to be dirty so it will be written when requested.

Parameters:
jobSubSystem - the job subsystem with which this job is associated.
job - The ISeriesJob which represents this job on the iSeries.

JobTicket

public JobTicket(IBMiConnection connection,
                 IQSYSJob job,
                 String task,
                 IJobTicketSource ticketSource)
Creates a new job ticket from its parameter parts. Usually done by a submitter. After a job ticket is created it is usually added to a JobTicketManager that will refresh its status, persist it and dispose of it when it is no longer needed. A newly created ticket is assumed to be dirty so it will be written when requested.

Parameters:
connection - The connection associated with the job.
job - The IQSYSJob which represents this job on the iSeries.
task - The task this job is assigned, this is just an arbittrary string to display in the table to give the user some visual clue as to what this job is doing
ticketSource - The source for this job ticket, used to get contributions for popup menu and notify source of job status changes, can be null
status - the initial job status -- usually JobTicket.Queued.
tag - the tag used for this job submission.

JobTicket

public JobTicket(IBMiConnection connection,
                 String jobNumber,
                 String jobUser,
                 String jobName,
                 String task,
                 IJobTicketSource ticketSource)
Creates a new job ticket from its parameter parts. Usually done by a submitter. After a job ticket is created it is usually added to a JobTicketManager that will refresh its status, persist it and dispose of it when it is no longer needed. A newly created ticket is assumed to be dirty so it will be written when requested.

Parameters:
connection - The connection associated with the job.
jobNumber - The job number
jobUser - The user name for the job
jobName - The name of the job
task - The task this job is assigned, this is just an arbittrary string to display in the table to give the user some visual clue as to what this job is doing
ticketSource - The source for this job ticket, used to get contributions for popup menu and notify source of job status changes, can be null
status - the initial job status -- usually JobTicket.Queued.
tag - the tag used for this job submission.

JobTicket

public JobTicket(SubSystem jobSubSystem,
                 IQSYSJob job,
                 String task,
                 IJobTicketSource ticketSource)
Creates a new job ticket from its parameter parts. Usually done by a submitter. After a job ticket is created it is usually added to a JobTicketManager that will refresh its status, persist it and dispose of it when it is no longer needed. A newly created ticket is assumed to be dirty so it will be written when requested.

Parameters:
jobSubSystem - the job subsystem with which this job is associated.
job - The IQSYSJob which represents this job on the iSeries.
task - The task this job is assigned, this is just an arbittrary string to display in the table to give the user some visual clue as to what this job is doing
ticketSource - The source for this job ticket, used to get contributions for popup menu and notify source of job status changes, can be null
status - the initial job status -- usually JobTicket.Queued.
tag - the tag used for this job submission.

JobTicket

public JobTicket(SubSystem jobSubSystem,
                 String jobNumber,
                 String jobUser,
                 String jobName,
                 String task,
                 IJobTicketSource ticketSource)
Creates a new job ticket from its parameter parts. Usually done by a submitter. After a job ticket is created it is usually added to a JobTicketManager that will refresh its status, persist it and dispose of it when it is no longer needed. A newly created ticket is assumed to be dirty so it will be written when requested.

Parameters:
jobSubSystem - the job subsystem with which this job is associated.
jobNumber - The job number
jobUser - The user name for the job
jobName - The name of the job
task - The task this job is assigned, this is just an arbittrary string to display in the table to give the user some visual clue as to what this job is doing
ticketSource - The source for this job ticket, used to get contributions for popup menu and notify source of job status changes, can be null
status - the initial job status -- usually JobTicket.Queued.
tag - the tag used for this job submission.
Method Detail

createFrom

public static JobTicket createFrom(File mementoFile)
Loads a ticket for a project with a given name.


save

public void save()
Saves this ticket. Tickets are saved only if they are marked dirty. Save requests are usually made only by a JobTicketManager.


isDirty

public boolean isDirty()
Returns true if and only if the ticket has been changed since it was last saved.


getConnection

public IBMiConnection getConnection()
Returns an IBMiConnection associated with this job.


getTimeStamp

public long getTimeStamp()
Returns the timeStamp of the job.


getTicketName

public String getTicketName()
Returns the name of the job ticket. This is a manufactured name consisting of the project's name and the qualified job name.


getJob

public IQSYSJob getJob()
Return the IQSYSJob this ticket uses.


getJobName

public String getJobName()
Returns the name of the job.


getJobNumber

public String getJobNumber()
Returns the number of the job.


getSubSystem

public SubSystem getSubSystem()
Returns the subsystem for the job.


getStatusString

public String getStatusString()
Returns the status of the job.


getUserName

public String getUserName()
Returns the user under whose profile the job was submitted.


getMemento

public IMemento getMemento()
Returns a memento for this ticket. Used for persisting the ticket. Mementos are usually requested only by a JobTicketManager.


getQualifiedJobName

public String getQualifiedJobName()
Returns the fully qualified job name of this job ticket.


getTask

public String getTask()
Returns the task for this Job.


getJobTicketSource

public IJobTicketSource getJobTicketSource()
Returns the job ticket source for this job.


setJobTicketSource

public void setJobTicketSource(IJobTicketSource ticketSource)
Sets the job ticket source for this job.


getFileName

public String getFileName()
Returns the simple filename where this ticket should be stored. This is unique for each ticket.


getLocation

public IPath getLocation()
Returns the location where this ticket is stored. Returns null if there is no location for this ticket.


isFinished

public boolean isFinished()
Check if this job is finished.


isJobQueued

public boolean isJobQueued()
Check if this job is waiting on a job queue.


isOutputQueued

public boolean isOutputQueued()
Check if this job is waiting on an output queue.


isRunning

public boolean isRunning()
Check if this job is finished.


refresh

public void refresh()
Refresh the job information for this ticket


equals

public boolean equals(Object object)
Override of equals to return true if two job tickets have the same job name, user and number and are from the same remote host.

Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)

clearMemento

protected void clearMemento()
Clear the memento for this job.


isPersistJob

public boolean isPersistJob()
Check if this job is persisted when the workbench is shutdown.

Returns:
true if the job will be persisted, and false if it will not be persisted

setPersistJob

public void setPersistJob(boolean persist)
Set if this job is persisted when the workbench is shutdown.

Parameters:
persist - true if the job should be persisted.

Rational Developer for Power Systems Software
V7.6

Copyright 2011 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.