org.apache.sling.event
Interface JobStatusProvider


public interface JobStatusProvider

This service provides the current job processing status.


Field Summary
static java.lang.String PROPERTY_EVENT_ID
          This is a unique identifer which can be used to cancel the job.
 
Method Summary
 void cancelJob(java.lang.String jobId)
          Cancel this job.
 void cancelJob(java.lang.String topic, java.lang.String jobId)
          Cancel this job.
 java.util.Collection<org.osgi.service.event.Event> getAllJobs(java.lang.String topic, java.util.Map<java.lang.String,java.lang.Object>... filterProps)
          Return all jobs either running or scheduled.
 java.util.Collection<org.osgi.service.event.Event> getCurrentJobs(java.lang.String topic)
          Return the jobs which are currently in processing.
 java.util.Collection<org.osgi.service.event.Event> getCurrentJobs(java.lang.String topic, java.util.Map<java.lang.String,java.lang.Object>... filterProps)
          Return the jobs which are currently in processing.
 java.util.Collection<org.osgi.service.event.Event> getScheduledJobs(java.lang.String topic)
          Return a list of currently schedulded jobs.
 java.util.Collection<org.osgi.service.event.Event> getScheduledJobs(java.lang.String topic, java.util.Map<java.lang.String,java.lang.Object>... filterProps)
          Return a list of currently schedulded jobs.
 java.util.Collection<org.osgi.service.event.Event> scheduledJobs(java.lang.String topic)
          Deprecated. Use getScheduledJobs(String) instead.
 void wakeUpJobQueue(java.lang.String jobQueueName)
          Wake up the named job queue.
 

Field Detail

PROPERTY_EVENT_ID

static final java.lang.String PROPERTY_EVENT_ID
This is a unique identifer which can be used to cancel the job.

See Also:
Constant Field Values
Method Detail

scheduledJobs

@Deprecated
java.util.Collection<org.osgi.service.event.Event> scheduledJobs(java.lang.String topic)
Deprecated. Use getScheduledJobs(String) instead.


getScheduledJobs

java.util.Collection<org.osgi.service.event.Event> getScheduledJobs(java.lang.String topic)
Return a list of currently schedulded jobs.

Parameters:
topic - Topic can be used as a filter, if it is non-null, only jobs with this topic will be returned.
Returns:
A non null collection.

getCurrentJobs

java.util.Collection<org.osgi.service.event.Event> getCurrentJobs(java.lang.String topic)
Return the jobs which are currently in processing. If there are several application nodes in the cluster, there could be more than one job in processing

Parameters:
topic - Topic can be used as a filter, if it is non-null, only jobs with this topic will be returned.
Returns:
A non null collection.

getScheduledJobs

java.util.Collection<org.osgi.service.event.Event> getScheduledJobs(java.lang.String topic,
                                                                    java.util.Map<java.lang.String,java.lang.Object>... filterProps)
Return a list of currently schedulded jobs.

Parameters:
topic - Topic can be used as a filter, if it is non-null, only jobs with this topic will be returned.
filterProps - A list of filter property maps. Each map acts like a template. The searched job must match the template (AND query). By providing several maps, different filters are possible (OR query).
Returns:
A non null collection.

getCurrentJobs

java.util.Collection<org.osgi.service.event.Event> getCurrentJobs(java.lang.String topic,
                                                                  java.util.Map<java.lang.String,java.lang.Object>... filterProps)
Return the jobs which are currently in processing. If there are several application nodes in the cluster, there could be more than one job in processing

Parameters:
topic - Topic can be used as a filter, if it is non-null, only jobs with this topic will be returned.
filterProps - A list of filter property maps. Each map acts like a template. The searched job must match the template (AND query). By providing several maps, different filters are possible (OR query).
Returns:
A non null collection.

getAllJobs

java.util.Collection<org.osgi.service.event.Event> getAllJobs(java.lang.String topic,
                                                              java.util.Map<java.lang.String,java.lang.Object>... filterProps)
Return all jobs either running or scheduled. This is actually a convenience method and collects the results from getScheduledJobs(String, Map...) and getCurrentJobs(String, Map...)

Parameters:
topic - Topic can be used as a filter, if it is non-null, only jobs with this topic will be returned.
filterProps - A list of filter property maps. Each map acts like a template. The searched job must match the template (AND query). By providing several maps, different filters are possible (OR query).
Returns:
A non null collection.

cancelJob

void cancelJob(java.lang.String jobId)
Cancel this job.

Parameters:
jobId - The unique identifer as found in the property PROPERTY_EVENT_ID.

cancelJob

void cancelJob(java.lang.String topic,
               java.lang.String jobId)
Cancel this job. This method can be used if the topic and the provided job id is known.

Parameters:
topic - The job topic as put into the property EventUtil.PROPERTY_JOB_TOPIC.
jobId - The unique identifer as put into the property EventUtil.PROPERTY_JOB_ID.

wakeUpJobQueue

void wakeUpJobQueue(java.lang.String jobQueueName)
Wake up the named job queue. If a job failed, the job queue waits (sleeps) for a configured time. By calling this method, the job queue can be woken up and force an immediate reprocessing.

Parameters:
jobQueueName - The name of the queue.


Copyright © 2007-2009. All Rights Reserved.