Class Job

java.lang.Object
com.netscape.cms.jobs.Job
All Implemented Interfaces:
Runnable
Direct Known Subclasses:
RequestInQueueJob

public abstract class Job extends Object implements Runnable
This abstract class is a base job for real job extensions for the Jobs Scheduler.
Version:
$Revision$, $Date$
  • Field Details

  • Constructor Details

    • Job

      protected Job()
  • Method Details

    • getCMSEngine

      public CMSEngine getCMSEngine()
    • setCMSEngine

      public void setCMSEngine(CMSEngine engine)
    • getConfigParams

      public abstract String[] getConfigParams()
      Returns a list of configuration parameter names. The list is passed to the configuration console so instances of this implementation can be configured through the console.
      Returns:
      String array of configuration parameter names.
    • isEnabled

      public boolean isEnabled()
      tells if the job is enabled
      Returns:
      a boolean value indicating whether the job is enabled or not
    • init

      public void init(JobsScheduler scheduler, String id, String implName, JobConfig config) throws EBaseException
      Initialize from the configuration file.
      Parameters:
      id - String name of this instance
      implName - string name of this implementation
      config - configuration store for this instance
      Throws:
      EBaseException - any initialization failure
    • getId

      public String getId()
      get instance id.
      Returns:
      a String identifier
    • setId

      public void setId(String id)
      set instance id.
      Parameters:
      id - String id of the instance
    • getJobCron

      public JobCron getJobCron()
      get cron string associated with this job
      Returns:
      a JobCron object that represents the schedule of this job
    • getImplName

      public String getImplName()
      gets the plugin name of this job.
      Returns:
      a String that is the name of this implementation
    • getConfigStore

      public JobConfig getConfigStore()
      Gets the configuration substore used by this job
      Returns:
      configuration store
    • getTemplateContent

      protected String getTemplateContent(String templatePath)
    • mailSummary

      protected void mailSummary(String content)
    • buildItemParams

      protected void buildItemParams(org.mozilla.jss.netscape.security.x509.X509CertImpl cert)
    • buildItemParams

      protected void buildItemParams(Request r)
    • buildItemParams

      protected void buildItemParams(String name, String val)
    • buildContentParams

      protected void buildContentParams(String name, String val)
    • stop

      public void stop()
      Request the job to stop gracefully. The job may not stop immediately.
    • isStopped

      public boolean isStopped()
      Check whether the job has been asked to stop. Long running jobs should call this method occasionally inside the run() method and exit gracefully if it returns true.