|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.sling.event.impl.jobs.JobImpl
public class JobImpl
This object encapsulates all information about a job.
Field Summary | |
---|---|
static String |
PROPERTY_BRIDGED_EVENT
Internal job property if this is an bridged event (event admin). |
static String |
PROPERTY_RESOURCE_PATH
Internal job property containing the resource path. |
Fields inherited from interface org.apache.sling.event.jobs.Job |
---|
PROPERTY_JOB_CREATED, PROPERTY_JOB_CREATED_INSTANCE, PROPERTY_JOB_PRIORITY, PROPERTY_JOB_QUEUE_NAME, PROPERTY_JOB_RETRIES, PROPERTY_JOB_RETRY_COUNT, PROPERTY_JOB_RETRY_DELAY, PROPERTY_JOB_STARTED_TIME, PROPERTY_JOB_TARGET_INSTANCE |
Constructor Summary | |
---|---|
JobImpl(String topic,
String name,
String jobId,
Map<String,Object> properties)
Create a new job instance |
Method Summary | ||
---|---|---|
Calendar |
getCreated()
This property is set by the job handling and contains a calendar object specifying the date and time when this job has been created. |
|
String |
getCreatedInstance()
This property is set by the job handling and contains the Sling instance ID of the instance where this job has been created. |
|
String |
getId()
Unique job ID. |
|
JobUtil.JobPriority |
getJobPriority()
This property is set by the job handling to define the priority of this job execution. |
|
String |
getName()
Optional job name |
|
int |
getNumberOfRetries()
The property to track the retry maximum retry count for jobs. |
|
Calendar |
getProcessingStarted()
This property is set by the job handling and contains a calendar object specifying the date and time when this job has been started. |
|
Map<String,Object> |
getProperties()
Get all properties |
|
Object |
getProperty(String name)
Get the value of a property. |
|
|
getProperty(String name,
Class<T> type)
Get a named property and convert it into the given type. |
|
|
getProperty(String name,
T defaultValue)
Get a named property and convert it into the given type. |
|
Set<String> |
getPropertyNames()
Get all property names. |
|
String |
getQueueName()
The name of the job queue processing this job. |
|
String |
getResourcePath()
Get the full resource path. |
|
int |
getRetryCount()
On first execution the value of this property is zero. |
|
String |
getTargetInstance()
This property is set by the job handling and contains the Sling instance ID of the instance where this job should be processed. |
|
String |
getTopic()
The job topic. |
|
boolean |
hasReadErrors()
Did we have read errors? |
|
boolean |
isBridgedEvent()
Is this a bridged event? |
|
void |
retry()
Update the information for a retry |
|
void |
setProperty(String name,
Object value)
|
|
String |
toString()
|
|
void |
updateQueueInfo(Queue queue)
Update information about the queue. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String PROPERTY_RESOURCE_PATH
public static final String PROPERTY_BRIDGED_EVENT
Constructor Detail |
---|
public JobImpl(String topic, String name, String jobId, Map<String,Object> properties)
topic
- The job topicname
- The unique job name (optional)jobId
- The unique (internal) job idproperties
- Non-null map of properties, at least containing PROPERTY_RESOURCE_PATH
Method Detail |
---|
public String getResourcePath()
public boolean isBridgedEvent()
public boolean hasReadErrors()
public Map<String,Object> getProperties()
public void retry()
public String getTopic()
Job
getTopic
in interface Job
Job.getTopic()
public String getName()
Job
getName
in interface Job
null
Job.getName()
public String getId()
Job
getId
in interface Job
Job.getId()
public Object getProperty(String name)
Job
getProperty
in interface Job
name
- The property name
null
Job.getProperty(java.lang.String)
public <T> T getProperty(String name, Class<T> type)
Job
null
in this
case.
getProperty
in interface Job
name
- The name of the propertytype
- The class of the type
null
if
non existing or can't be converted.Job.getProperty(java.lang.String, java.lang.Class)
public <T> T getProperty(String name, T defaultValue)
Job
getProperty
in interface Job
name
- The name of the propertydefaultValue
- The default value to use if the named property does
not exist or cannot be converted to the requested type. The
default value is also used to define the type to convert the
value to. If this is null
any existing property is
not converted.
Job.getProperty(java.lang.String, java.lang.Object)
public Set<String> getPropertyNames()
Job
getPropertyNames
in interface Job
Job.getPropertyNames()
public JobUtil.JobPriority getJobPriority()
Job
JobConsumer
and sets the priority of the thread accordingly.
For possible values see JobUtil.JobPriority
.
getJobPriority
in interface Job
public int getRetryCount()
Job
getRetryCount
in interface Job
public int getNumberOfRetries()
Job
getNumberOfRetries
in interface Job
public String getQueueName()
Job
getQueueName
in interface Job
null
public String getTargetInstance()
Job
getTargetInstance
in interface Job
null
public Calendar getProcessingStarted()
Job
getProcessingStarted
in interface Job
public Calendar getCreated()
Job
getCreated
in interface Job
public String getCreatedInstance()
Job
getCreatedInstance
in interface Job
public void updateQueueInfo(Queue queue)
public void setProperty(String name, Object value)
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |