Package org.apache.sling.event.impl.jobs

# Class JobHandler

java.lang.Object
org.apache.sling.event.impl.jobs.JobHandler

public class JobHandler extends Object
This object adds actions to a `JobImpl`.

## Field Summary

Fields
Modifier and Type
Field
Description
`long`
`started`

## Constructor Summary

Constructors
Constructor
Description
`JobHandler(JobImpl job, org.apache.sling.event.jobs.consumer.JobExecutor consumer, JobManagerConfiguration configuration)`

## Method Summary

Modifier and Type
Method
Description
`void`
`addToRetryList()`
`boolean`
`equals(Object obj)`
`void`
`finished(org.apache.sling.event.jobs.Job.JobState state, boolean keepJobInHistory, Long duration)`
Finish a job.
`org.apache.sling.event.jobs.consumer.JobExecutor`
`getConsumer()`
`JobImpl`
`getJob()`
`int`
`getProgressLogMaxCount()`
`int`
`hashCode()`
`boolean`
`isStopped()`
`boolean`
`persistJobProperties(String... propNames)`
Update the property of a job in the resource tree
`void`
`reassign()`
Reassign to a new instance.
`boolean`
`removeFromRetryList()`
`boolean`
`reschedule()`
Reschedule the job Update the retry count and remove the started time.
`boolean`
`startProcessing(org.apache.sling.event.jobs.Queue queue)`
`void`
`stop()`
`String`
`toString()`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

## Field Details

### started

public volatile long started

## Constructor Details

### JobHandler

public JobHandler(JobImpl job, org.apache.sling.event.jobs.consumer.JobExecutor consumer, JobManagerConfiguration configuration)

## Method Details

### getJob

public JobImpl getJob()

### getProgressLogMaxCount

public int getProgressLogMaxCount()

### getConsumer

public org.apache.sling.event.jobs.consumer.JobExecutor getConsumer()

### startProcessing

public boolean startProcessing(org.apache.sling.event.jobs.Queue queue)

### reschedule

public boolean reschedule()
Reschedule the job Update the retry count and remove the started time.

Returns:
  `true` if rescheduling was successful, `false` otherwise.

### finished

public void finished(org.apache.sling.event.jobs.Job.JobState state, boolean keepJobInHistory, Long duration)
Finish a job.

Parameters:
  `state` - The state of the processing
  `keepJobInHistory` - whether to keep the job in the job history.
  `duration` - the duration of the processing.

### reassign

public void reassign()
Reassign to a new instance.

### persistJobProperties

public boolean persistJobProperties(String... propNames)
Update the property of a job in the resource tree

Parameters:
  `propNames` - the property names to update
Returns:
  `true` if the update was successful.

### isStopped

public boolean isStopped()

### stop

public void stop()

### addToRetryList

public void addToRetryList()

### removeFromRetryList

public boolean removeFromRetryList()

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`

### equals

public boolean equals(Object obj)

Overrides:
  `equals` in class `Object`

### toString

public String toString()

Overrides:
  `toString` in class `Object`