Package org.opencastproject.job.api
Class JobImpl
java.lang.Object
org.opencastproject.job.api.JobImpl
- All Implemented Interfaces:
Job
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.opencastproject.job.api.Job
Job.FailureReason, Job.Status -
Constructor Summary
ConstructorsConstructorDescriptionJobImpl()JobImpl(long id) JobImpl(long id, String creator, String organization, long version, String jobType, String operation, List<String> arguments, Job.Status status, String createdHost, String processingHost, Date dateCreated, Date dateStarted, Date dateCompleted, Long queueTime, Long runTime, String payload, Long parentJobId, Long rootJobId, boolean dispatchable, URI uri, Float load) -
Method Summary
Modifier and TypeMethodDescriptionbooleanThe arguments passed to the service and operation.Gets the host that created this job.Gets the username of the subject responsible for creating the job initially.The date this job was completedThe date this job was created.The date this job was started.In the case of failure, returns whether the failure had to do with data or with processing.longgetId()Gets the job identifier.Gets the job's load.Gets the job type, which determines the type of service that runs the job.The operation type, which can be used by the service responsible for the job to determine the service method to execute.Returns the identifier of the organization that the creator is associated with.Gets the parent job identifier, or null if there is no parent.Gets the serialized output that was produced by this job, or null if nothing was produced, or if it has yet to be produced.Gets the host responsible for running this job.The number of milliseconds that this job has waited in a queue before execution.Gets the root job identifier, or null if this is the root job.The number of milliseconds that this job took to execute.intGets the receipt's currentJob.StatusgetUri()Gets the URI of this job, which can be used to check its status.longGets the version of this job.inthashCode()booleanGets whether this job may be dispatched.voidsetArguments(List<String> arguments) voidsetCreator(String creator) voidsetDateCompleted(Date dateCompleted) voidsetDateCreated(Date dateCreated) voidsetDateStarted(Date dateStarted) voidsetDispatchable(boolean dispatchable) voidsetJobLoad(Float load) voidsetJobType(String jobType) voidsetOperation(String operation) voidsetOrganization(String organization) voidsetParentJobId(Long parentJobId) voidsetPayload(String payload) voidsetProcessingHost(String processingHost) voidsetQueueTime(Long queueTime) voidsetRunTime(Long runTime) voidsetStatus(Job.Status status) voidsetStatus(Job.Status status, Job.FailureReason reason) Sets the receipt's currentJob.Statusalong with theJob.FailureReasonto indicate why - in the case of failure - the job failed.toString()
-
Constructor Details
-
JobImpl
public JobImpl() -
JobImpl
public JobImpl(long id) -
JobImpl
public JobImpl(long id, String creator, String organization, long version, String jobType, String operation, List<String> arguments, Job.Status status, String createdHost, String processingHost, Date dateCreated, Date dateStarted, Date dateCompleted, Long queueTime, Long runTime, String payload, Long parentJobId, Long rootJobId, boolean dispatchable, URI uri, Float load)
-
-
Method Details
-
getId
public long getId()Description copied from interface:JobGets the job identifier. -
getCreator
Description copied from interface:JobGets the username of the subject responsible for creating the job initially. This job will execute with this user's roles and permissions.- Specified by:
getCreatorin interfaceJob- Returns:
- the username that created the job
-
setCreator
- Specified by:
setCreatorin interfaceJob
-
getOrganization
Description copied from interface:JobReturns the identifier of the organization that the creator is associated with.- Specified by:
getOrganizationin interfaceJob- Returns:
- the organization
-
setOrganization
- Specified by:
setOrganizationin interfaceJob
-
getVersion
public long getVersion()Description copied from interface:JobGets 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:
getVersionin interfaceJob- Returns:
- the version number of this job
-
getJobType
Description copied from interface:JobGets the job type, which determines the type of service that runs the job.- Specified by:
getJobTypein interfaceJob- Returns:
- the job type
-
setJobType
- Specified by:
setJobTypein interfaceJob
-
getOperation
Description copied from interface:JobThe operation type, which can be used by the service responsible for the job to determine the service method to execute.- Specified by:
getOperationin interfaceJob- Returns:
- The operation
-
setOperation
- Specified by:
setOperationin interfaceJob
-
getArguments
Description copied from interface:JobThe arguments passed to the service and operation. Each argument must be serializable to a string.- Specified by:
getArgumentsin interfaceJob- Returns:
- the arguments passed to the service operation
-
setArguments
- Specified by:
setArgumentsin interfaceJob
-
getStatus
Description copied from interface:JobGets the receipt's currentJob.Status -
setStatus
-
setStatus
Description copied from interface:JobSets the receipt's currentJob.Statusalong with theJob.FailureReasonto indicate why - in the case of failure - the job failed. -
getFailureReason
Description copied from interface:JobIn 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:
getFailureReasonin interfaceJob- Returns:
- the failure reason
-
getCreatedHost
Description copied from interface:JobGets the host that created this job.- Specified by:
getCreatedHostin interfaceJob- Returns:
- the server that originally created the job
-
getProcessingHost
Description copied from interface:JobGets the host responsible for running this job.- Specified by:
getProcessingHostin interfaceJob- Returns:
- the server running the job, or null if the job hasn't yet started
-
setProcessingHost
- Specified by:
setProcessingHostin interfaceJob
-
getDateCreated
Description copied from interface:JobThe date this job was created.- Specified by:
getDateCreatedin interfaceJob- Returns:
- the date the job was created
-
setDateCreated
- Specified by:
setDateCreatedin interfaceJob
-
getDateStarted
Description copied from interface:JobThe date this job was started. If the job was queued, this can be significantly later than the date created.- Specified by:
getDateStartedin interfaceJob- Returns:
- the date the job was started
-
setDateStarted
- Specified by:
setDateStartedin interfaceJob
-
getDateCompleted
Description copied from interface:JobThe date this job was completed- Specified by:
getDateCompletedin interfaceJob- Returns:
- the date completed
-
setDateCompleted
- Specified by:
setDateCompletedin interfaceJob
-
getQueueTime
Description copied from interface:JobThe 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:
getQueueTimein interfaceJob- Returns:
- the total run time
-
setQueueTime
- Specified by:
setQueueTimein interfaceJob
-
getRunTime
Description copied from interface:JobThe number of milliseconds that this job took to execute. This value will be null if the job has not yet finished execution.- Specified by:
getRunTimein interfaceJob- Returns:
- the total run time
-
setRunTime
- Specified by:
setRunTimein interfaceJob
-
getPayload
Description copied from interface:JobGets 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:
getPayloadin interfaceJob- Returns:
- the output of the job
-
setPayload
- Specified by:
setPayloadin interfaceJob
-
getSignature
public int getSignature()- Specified by:
getSignaturein interfaceJob- Returns:
-
getParentJobId
Description copied from interface:JobGets the parent job identifier, or null if there is no parent.- Specified by:
getParentJobIdin interfaceJob- Returns:
- the parent identifier
-
setParentJobId
- Specified by:
setParentJobIdin interfaceJob
-
getRootJobId
Description copied from interface:JobGets the root job identifier, or null if this is the root job.- Specified by:
getRootJobIdin interfaceJob- Returns:
- the root job identifier
-
isDispatchable
public boolean isDispatchable()Description copied from interface:JobGets whether this job may be dispatched.- Specified by:
isDispatchablein interfaceJob- Returns:
- whether the job can be queued for dispatch or not
-
setDispatchable
public void setDispatchable(boolean dispatchable) - Specified by:
setDispatchablein interfaceJob
-
getUri
Description copied from interface:JobGets the URI of this job, which can be used to check its status. -
getJobLoad
Description copied from interface:JobGets 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:
getJobLoadin interfaceJob- Returns:
- the job's load
-
setJobLoad
- Specified by:
setJobLoadin interfaceJob
-
equals
-
hashCode
public int hashCode() -
toString
-