Class Job


  • public class Job
    extends Object
    A Job is a representation of the union between an action to be performed, data to be supplied, and a schedule upon which the action will be fired. The scheduling system is responsible for creating Jobs via IScheduler#createJob(String, Class, Map, JobTrigger). Jobs are likely persistent, at least for the life of a IScheduler instance. In other words, an IScheduler instance should never forget about a Job it has created, unless the Job has been removed via IScheduler#removeJob(Job).

    Note: once the scheduler engine processes a job run, it will create a new IJobResult, which will contain full historical information about job runs. Job will contain only minimal of such temporal information.

    Author:
    aphillips
    • Constructor Detail

      • Job

        public Job()
    • Method Detail

      • getJobTrigger

        public JobTrigger getJobTrigger()
        Returns:
        the trigger that determines when the job executes
      • getJobParams

        public Map<String,​Serializable> getJobParams()
        Returns:
        the map containing the parameters to be passed to the action executed by this job
      • getLastRun

        public Date getLastRun()
        Returns:
        the last time this job ran or null if the job has not run yet.
      • getNextRun

        public Date getNextRun()
        Returns:
        the next time the job is scheduled to run or null if the job will not run again.
      • getSchedulableClass

        public String getSchedulableClass()
        Returns:
        the class name of the IAction that will be executed by this job.
      • getJobId

        public String getJobId()
        Returns:
        the id that uniquely defines this job.
      • getJobName

        public String getJobName()
        Returns:
        the user defined name of this job.
      • getUserName

        public String getUserName()
        Returns:
        the user that scheduled this job
      • getGroupName

        public String getGroupName()
        Returns:
        the group name of this job
      • setJobTrigger

        public void setJobTrigger​(JobTrigger jobTrigger)
        Sets the trigger used to determine when this job runs.
        Parameters:
        jobTrigger - the job trigger
      • setJobParams

        public void setJobParams​(Map<String,​Serializable> jobParams)
        Sets the parameters that will be passed to the scheduled IAction when the job executes.
        Parameters:
        jobParams - the parameters to be passed to the IAction
      • setLastRun

        public void setLastRun​(Date lastRun)
        Sets the last time the job executed.
        Parameters:
        lastRun - the last time the job ran. null if the job has not run.
      • setNextRun

        public void setNextRun​(Date nextRun)
        Sets the next time the job will execute
        Parameters:
        nextRun - the next time the job will run. null if the job will not run again.
      • setSchedulableClass

        public void setSchedulableClass​(String schedulableClass)
        Sets the name of the IAction class that will run when the job is executed.
        Parameters:
        schedulableClass - the name of the IAction to run.
      • setJobId

        public void setJobId​(String jobId)
        Sets the id that uniquely defines this job.
        Parameters:
        jobId - the job id
      • setUserName

        public void setUserName​(String userName)
        Sets the name of the user that has scheduled this job
        Parameters:
        userName - the user name
      • setJobName

        public void setJobName​(String jobName)
        Sets the user defined name of this job.
        Parameters:
        jobName - the job name
      • getState

        public Job.JobState getState()
        Returns:
        the current job state
      • setState

        public void setState​(Job.JobState state)
        Sets the current state of this job
        Parameters:
        state - the job state
      • setGroupName

        public void setGroupName​(String groupName)
        Sets the group name of this job
        Parameters:
        groupName - the group name