Package org.apache.sling.event.impl.jobs
Class JobImpl
java.lang.Object
org.apache.sling.event.impl.jobs.JobImpl
- All Implemented Interfaces:
Comparable<JobImpl>
,org.apache.sling.event.jobs.Job
This object encapsulates all information about a job.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.apache.sling.event.jobs.Job
org.apache.sling.event.jobs.Job.JobState
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Internal job property containing optional delay override.static final String
This property contains the finished state of a job once it's marked as finished.static final String
Internal job property specifying when the job was put into the queue.static final String
Internal job property containing the resource path.Fields inherited from interface org.apache.sling.event.jobs.Job
PROPERTY_FINISHED_DATE, PROPERTY_JOB_CREATED, PROPERTY_JOB_CREATED_INSTANCE, PROPERTY_JOB_DESCRIPTION, PROPERTY_JOB_PROGRESS_ETA, PROPERTY_JOB_PROGRESS_LOG, PROPERTY_JOB_PROGRESS_STEP, PROPERTY_JOB_PROGRESS_STEPS, PROPERTY_JOB_QUEUE_NAME, PROPERTY_JOB_RETRIES, PROPERTY_JOB_RETRY_COUNT, PROPERTY_JOB_RETRY_DELAY, PROPERTY_JOB_STARTED_TIME, PROPERTY_JOB_TARGET_INSTANCE, PROPERTY_JOB_TITLE, PROPERTY_RESULT_MESSAGE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
boolean
int
getId()
org.apache.sling.event.jobs.Job.JobState
int
String[]
int
Get all propertiesgetProperty
(String name) <T> T
getProperty
(String name, Class<T> type) <T> T
getProperty
(String name, T defaultValue) Get the full resource path.int
getTopic()
int
hashCode()
boolean
Did we have read errors?boolean
Is the error recoverable?String[]
prepare
(org.apache.sling.event.jobs.Queue queue) Prepare a new job executionvoid
retry()
Update the information for a retryString[]
setProgress
(int step) void
setProperty
(String name, Object value) String[]
startProgress
(int steps, long eta) toString()
update
(long eta) void
updateQueueInfo
(org.apache.sling.event.jobs.Queue queue) Update information about the queue.
-
Field Details
-
PROPERTY_RESOURCE_PATH
Internal job property containing the resource path.- See Also:
-
PROPERTY_DELAY_OVERRIDE
Internal job property containing optional delay override.- See Also:
-
PROPERTY_JOB_QUEUED
Internal job property specifying when the job was put into the queue.- See Also:
-
PROPERTY_FINISHED_STATE
This property contains the finished state of a job once it's marked as finished. The value is either "CANCELLED" or "SUCCEEDED". This property is read-only and can't be specified when the job is created.- See Also:
-
-
Constructor Details
-
JobImpl
Create a new job instance- Parameters:
topic
- The job topicjobId
- The unique (internal) job idproperties
- Non-null map of properties, at least containingPROPERTY_RESOURCE_PATH
-
-
Method Details
-
getResourcePath
Get the full resource path. -
hasReadErrors
public boolean hasReadErrors()Did we have read errors? -
getReadErrorType
-
isReadErrorRecoverable
public boolean isReadErrorRecoverable()Is the error recoverable? -
getProperties
Get all properties -
retry
public void retry()Update the information for a retry -
getTopic
- Specified by:
getTopic
in interfaceorg.apache.sling.event.jobs.Job
- See Also:
-
Job.getTopic()
-
getId
- Specified by:
getId
in interfaceorg.apache.sling.event.jobs.Job
- See Also:
-
Job.getId()
-
getProperty
- Specified by:
getProperty
in interfaceorg.apache.sling.event.jobs.Job
- See Also:
-
Job.getProperty(java.lang.String)
-
getProperty
- Specified by:
getProperty
in interfaceorg.apache.sling.event.jobs.Job
- See Also:
-
Job.getProperty(java.lang.String, java.lang.Class)
-
getProperty
- Specified by:
getProperty
in interfaceorg.apache.sling.event.jobs.Job
- See Also:
-
Job.getProperty(java.lang.String, java.lang.Object)
-
getPropertyNames
- Specified by:
getPropertyNames
in interfaceorg.apache.sling.event.jobs.Job
- See Also:
-
Job.getPropertyNames()
-
getRetryCount
public int getRetryCount()- Specified by:
getRetryCount
in interfaceorg.apache.sling.event.jobs.Job
-
getNumberOfRetries
public int getNumberOfRetries()- Specified by:
getNumberOfRetries
in interfaceorg.apache.sling.event.jobs.Job
-
getQueueName
- Specified by:
getQueueName
in interfaceorg.apache.sling.event.jobs.Job
-
getTargetInstance
- Specified by:
getTargetInstance
in interfaceorg.apache.sling.event.jobs.Job
-
getProcessingStarted
- Specified by:
getProcessingStarted
in interfaceorg.apache.sling.event.jobs.Job
-
getCreated
- Specified by:
getCreated
in interfaceorg.apache.sling.event.jobs.Job
-
getCreatedInstance
- Specified by:
getCreatedInstance
in interfaceorg.apache.sling.event.jobs.Job
-
updateQueueInfo
public void updateQueueInfo(org.apache.sling.event.jobs.Queue queue) Update information about the queue. -
setProperty
-
prepare
Prepare a new job execution -
startProgress
-
setProgress
-
update
-
log
-
getJobState
public org.apache.sling.event.jobs.Job.JobState getJobState()- Specified by:
getJobState
in interfaceorg.apache.sling.event.jobs.Job
-
getFinishedDate
- Specified by:
getFinishedDate
in interfaceorg.apache.sling.event.jobs.Job
- See Also:
-
Job.getFinishedDate()
-
getResultMessage
- Specified by:
getResultMessage
in interfaceorg.apache.sling.event.jobs.Job
- See Also:
-
Job.getResultMessage()
-
getProgressLog
- Specified by:
getProgressLog
in interfaceorg.apache.sling.event.jobs.Job
- See Also:
-
Job.getProgressLog()
-
getProgressStepCount
public int getProgressStepCount()- Specified by:
getProgressStepCount
in interfaceorg.apache.sling.event.jobs.Job
- See Also:
-
Job.getProgressStepCount()
-
getFinishedProgressStep
public int getFinishedProgressStep()- Specified by:
getFinishedProgressStep
in interfaceorg.apache.sling.event.jobs.Job
- See Also:
-
Job.getFinishedProgressStep()
-
getProgressETA
- Specified by:
getProgressETA
in interfaceorg.apache.sling.event.jobs.Job
- See Also:
-
Job.getProgressETA()
-
compareTo
- Specified by:
compareTo
in interfaceComparable<JobImpl>
-
hashCode
public int hashCode() -
equals
-
toString
-