Interface JobContext

All Known Subinterfaces:
JobCompletionContext, JobInitContext, JobProcessContext

public interface JobContext
Contains contextual information about the current job.

Parent of JobInitContext, JobProcessContext and JobCompleteContext that can be passed to a Job.

  • Method Details

    • getJobId

      String getJobId()
      Retrieves the ID tracking this job.
      Returns:
      the job ID, as a String
    • getJobLogger

      JobLogger getJobLogger()
      Retrieves the job logger, used to log messages into the job log file.
      Returns:
      JobLogger object
    • getJobParameter

      <T> T getJobParameter(String name, JobParamValueType<T> valueType)
      Retrieves job parameters set on JobParameters when invoking a job through JobService.
      Type Parameters:
      T - type of object requested. Cannot be null.
      Parameters:
      name - the parameter name used when setting a job parameter. Cannot be null.
      valueType - The type of value returned from the job parameters. Cannot be null.
      Returns:
      the parameter value
    • getJobParameter

      <T extends JobParamValue> T getJobParameter(String name, Class<T> returnType)
      Retrieves job parameters set on JobParameters when invoking a job through JobService.
      Type Parameters:
      T - type of object requested. Cannot be null.
      Parameters:
      name - the parameter name used when setting a job parameter. Cannot be null.
      returnType - type of object requested. Cannot be null.
      Returns:
      the parameter value
    • getJobInitParameter

      <T> T getJobInitParameter(String name, JobValueType<T> valueType)
      Type Parameters:
      T - type of object requested. Cannot be null.
      Parameters:
      name - the parameter name used when setting the param in Job#init. Cannot be null.
      valueType - the type of value returned from the job parameters. Cannot be null.
      Returns:
      the object identified by the given name, or null if there was no value for the given name
    • getJobInitParameter

      <T extends JobValue> T getJobInitParameter(String name, Class<T> returnType)
      Retrieves job parameters that are set on Job.init(JobInitContext).
      Type Parameters:
      T - type of object requested. Cannot be null.
      Parameters:
      name - the parameter name used when setting the param in Job#init. Cannot be null.
      returnType - type of object requested. Cannot be null.
      Returns:
      the object identified by the given name, or null if there was no value for the given name
    • getJobName

      String getJobName()
      Retrieves the name of the job. If the job is an async job, this will return null.
      Returns:
      Job name
    • getJobOwner

      JobOwner getJobOwner()
      Retrieves the JobOwner of the job.
      Returns:
      JobOwner instance containing the owner's ID and type