Class JobImpl

java.lang.Object
org.opencastproject.job.api.JobImpl
All Implemented Interfaces:
Job

public class JobImpl extends Object implements Job
  • Constructor Details

  • Method Details

    • getId

      public long getId()
      Description copied from interface: Job
      Gets the job identifier.
      Specified by:
      getId in interface Job
      Returns:
      the identifier
    • getCreator

      public String getCreator()
      Description copied from interface: Job
      Gets the username of the subject responsible for creating the job initially. This job will execute with this user's roles and permissions.
      Specified by:
      getCreator in interface Job
      Returns:
      the username that created the job
    • setCreator

      public void setCreator(String creator)
      Specified by:
      setCreator in interface Job
    • getOrganization

      public String getOrganization()
      Description copied from interface: Job
      Returns the identifier of the organization that the creator is associated with.
      Specified by:
      getOrganization in interface Job
      Returns:
      the organization
    • setOrganization

      public void setOrganization(String organization)
      Specified by:
      setOrganization in interface Job
    • getVersion

      public long getVersion()
      Description copied from interface: Job
      Gets the version of this job. Each time the job is updated, the version number is incremented. If a process attempts to save a job that has been updated in another thread or on another host while the job was in memory, an optimistic locking exception will be thrown.
      Specified by:
      getVersion in interface Job
      Returns:
      the version number of this job
    • getJobType

      public String getJobType()
      Description copied from interface: Job
      Gets the job type, which determines the type of service that runs the job.
      Specified by:
      getJobType in interface Job
      Returns:
      the job type
    • setJobType

      public void setJobType(String jobType)
      Specified by:
      setJobType in interface Job
    • getOperation

      public String getOperation()
      Description copied from interface: Job
      The operation type, which can be used by the service responsible for the job to determine the service method to execute.
      Specified by:
      getOperation in interface Job
      Returns:
      The operation
    • setOperation

      public void setOperation(String operation)
      Specified by:
      setOperation in interface Job
    • getArguments

      public List<String> getArguments()
      Description copied from interface: Job
      The arguments passed to the service and operation. Each argument must be serializable to a string.
      Specified by:
      getArguments in interface Job
      Returns:
      the arguments passed to the service operation
    • setArguments

      public void setArguments(List<String> arguments)
      Specified by:
      setArguments in interface Job
    • getStatus

      public Job.Status getStatus()
      Description copied from interface: Job
      Gets the receipt's current Job.Status
      Specified by:
      getStatus in interface Job
      Returns:
      the current status
    • setStatus

      public void setStatus(Job.Status status)
      Specified by:
      setStatus in interface Job
    • setStatus

      public void setStatus(Job.Status status, Job.FailureReason reason)
      Description copied from interface: Job
      Sets the receipt's current Job.Status along with the Job.FailureReason to indicate why - in the case of failure - the job failed.
      Specified by:
      setStatus in interface Job
      Parameters:
      status - the status to set
      reason - failure reason
    • getFailureReason

      public Job.FailureReason getFailureReason()
      Description copied from interface: Job
      In the case of failure, returns whether the failure had to do with data or with processing. Depending on the reason, processing services might be marked not to accept new jobs.
      Specified by:
      getFailureReason in interface Job
      Returns:
      the failure reason
    • getCreatedHost

      public String getCreatedHost()
      Description copied from interface: Job
      Gets the host that created this job.
      Specified by:
      getCreatedHost in interface Job
      Returns:
      the server that originally created the job
    • getProcessingHost

      public String getProcessingHost()
      Description copied from interface: Job
      Gets the host responsible for running this job.
      Specified by:
      getProcessingHost in interface Job
      Returns:
      the server running the job, or null if the job hasn't yet started
    • setProcessingHost

      public void setProcessingHost(String processingHost)
      Specified by:
      setProcessingHost in interface Job
    • getDateCreated

      public Date getDateCreated()
      Description copied from interface: Job
      The date this job was created.
      Specified by:
      getDateCreated in interface Job
      Returns:
      the date the job was created
    • setDateCreated

      public void setDateCreated(Date dateCreated)
      Specified by:
      setDateCreated in interface Job
    • getDateStarted

      public Date getDateStarted()
      Description copied from interface: Job
      The date this job was started. If the job was queued, this can be significantly later than the date created.
      Specified by:
      getDateStarted in interface Job
      Returns:
      the date the job was started
    • setDateStarted

      public void setDateStarted(Date dateStarted)
      Specified by:
      setDateStarted in interface Job
    • getDateCompleted

      public Date getDateCompleted()
      Description copied from interface: Job
      The date this job was completed
      Specified by:
      getDateCompleted in interface Job
      Returns:
      the date completed
    • setDateCompleted

      public void setDateCompleted(Date dateCompleted)
      Specified by:
      setDateCompleted in interface Job
    • getQueueTime

      public Long getQueueTime()
      Description copied from interface: Job
      The number of milliseconds that this job has waited in a queue before execution. This value will be null if the job has not yet started execution.
      Specified by:
      getQueueTime in interface Job
      Returns:
      the total run time
    • setQueueTime

      public void setQueueTime(Long queueTime)
      Specified by:
      setQueueTime in interface Job
    • getRunTime

      public Long getRunTime()
      Description copied from interface: Job
      The number of milliseconds that this job took to execute. This value will be null if the job has not yet finished execution.
      Specified by:
      getRunTime in interface Job
      Returns:
      the total run time
    • setRunTime

      public void setRunTime(Long runTime)
      Specified by:
      setRunTime in interface Job
    • getPayload

      public String getPayload()
      Description copied from interface: Job
      Gets the serialized output that was produced by this job, or null if nothing was produced, or if it has yet to be produced.
      Specified by:
      getPayload in interface Job
      Returns:
      the output of the job
    • setPayload

      public void setPayload(String payload)
      Specified by:
      setPayload in interface Job
    • getSignature

      public int getSignature()
      Specified by:
      getSignature in interface Job
      Returns:
    • getParentJobId

      public Long getParentJobId()
      Description copied from interface: Job
      Gets the parent job identifier, or null if there is no parent.
      Specified by:
      getParentJobId in interface Job
      Returns:
      the parent identifier
    • setParentJobId

      public void setParentJobId(Long parentJobId)
      Specified by:
      setParentJobId in interface Job
    • getRootJobId

      public Long getRootJobId()
      Description copied from interface: Job
      Gets the root job identifier, or null if this is the root job.
      Specified by:
      getRootJobId in interface Job
      Returns:
      the root job identifier
    • isDispatchable

      public boolean isDispatchable()
      Description copied from interface: Job
      Gets whether this job may be dispatched.
      Specified by:
      isDispatchable in interface Job
      Returns:
      whether the job can be queued for dispatch or not
    • setDispatchable

      public void setDispatchable(boolean dispatchable)
      Specified by:
      setDispatchable in interface Job
    • getUri

      public URI getUri()
      Description copied from interface: Job
      Gets the URI of this job, which can be used to check its status.
      Specified by:
      getUri in interface Job
      Returns:
      the job's URI
    • getJobLoad

      public Float getJobLoad()
      Description copied from interface: Job
      Gets the job's load. For example, a job which uses four cores would have a load of 4.0. This should be roughly the number of cores that this job occupies while running.
      Specified by:
      getJobLoad in interface Job
      Returns:
      the job's load
    • setJobLoad

      public void setJobLoad(Float load)
      Specified by:
      setJobLoad in interface Job
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object