org.apache.turbine.services.schedule

## Interface JobEntry

- All Superinterfaces:
    Comparable<JobEntry>
  All Known Implementing Classes:
    AbstractJobEntry, BaseJobEntryTorque, JobEntryNonPersistent, JobEntryQuartz, JobEntryTorque

      public interface JobEntry
      extends Comparable<JobEntry>

  This is a interface for a scheduled job. It does not specify how to configure when to run, that is left to subclasses. See the JobEntryTorque for an example of a JobEntry backed by Torque objects.
  Version:
    $Id: JobEntry.java 1773378 2016-12-09 13:19:59Z tv $
  Author:
    Eric Pugh, Dave Bryson, Quinton McCombs

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `calcRunTime()` Calculate how long before the next runtime.
    `int` | `getJobId()` Get the value of jobId.
    `String` | `getNextRunAsString()` Get the next runtime for this job as a String.
    `Date` | `getNextRunDate()` Gets the next runtime as a date
    `long` | `getNextRuntime()` Get the next runtime for this job as a long.
    `String` | `getTask()` Get the Task
    `boolean` | `isActive()` Check to see if job is currently active/running
    `boolean` | `isNew()` Check to see if job is new
    `void` | `setActive(boolean isActive)` Sets whether the job is running.
    `void` | `setJobId(int v)` Set the value of jobId.
    `void` | `setTask(String v)` Set the value of Task

    - ### Methods inherited from interface java.lang.Comparable

      `compareTo`

- - ### Method Detail

    - #### setActive

          void setActive(boolean isActive)

      Sets whether the job is running.
      Parameters:
        `isActive` - Whether the job is running.

    - #### isActive

          boolean isActive()

      Check to see if job is currently active/running
      Returns:
        true if job is currently being run by the worker thread, otherwise false

    - #### isNew

          boolean isNew()

      Check to see if job is new
      Returns:
        true if job is not yet saved, otherwise false

    - #### getJobId

          int getJobId()

      Get the value of jobId.
      Returns:
        int

    - #### setJobId

          void setJobId(int v)

      Set the value of jobId.
      Parameters:
        `v` - new value

    - #### getTask

          String getTask()

      Get the Task
      Returns:
        String

    - #### setTask

          void setTask(String v)

      Set the value of Task
      Parameters:
        `v` - new value

    - #### getNextRuntime

          long getNextRuntime()

      Get the next runtime for this job as a long.
      Returns:
        The next run time as a long.

    - #### getNextRunDate

          Date getNextRunDate()

      Gets the next runtime as a date
      Returns:
        Next run date

    - #### getNextRunAsString

          String getNextRunAsString()

      Get the next runtime for this job as a String.
      Returns:
        The next run time as a String.

    - #### calcRunTime

          void calcRunTime()
                           throws TurbineException

      Calculate how long before the next runtime.
      The runtime determines it's position in the job queue. Here's the logic:
      1. Create a date the represents when this job is to run.
      2. If this date has expired, them "roll" appropriate date fields forward to the next date.
      3. Calculate the diff in time between the current time and the next run time.
      Throws:
        `TurbineException` - a generic exception.

Copyright © 2000–2018 The Apache Software Foundation. All rights reserved.