Package org.apache.sling.event.impl.jobs
Class JobManagerImpl
- java.lang.Object
-
- org.apache.sling.event.impl.jobs.JobManagerImpl
-
-
Constructor Summary
Constructors Constructor Description JobManagerImpl()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidactivate(org.osgi.framework.BundleContext ctx, Map<String,Object> props)Activate this component.org.apache.sling.event.jobs.JobaddJob(String topic, Map<String,Object> properties)org.apache.sling.event.jobs.JobaddJob(String topic, Map<String,Object> properties, List<String> errors)Internal method to add a jobprotected static StringbuildBaseQuery(String queryRoot, String topic, org.apache.sling.event.jobs.JobManager.QueryType type, boolean isHistoryQuery)org.apache.sling.event.jobs.JobBuildercreateJob(String topic)protected voiddeactivate()Deactivate this component.Collection<org.apache.sling.event.jobs.Job>findJobs(org.apache.sling.event.jobs.JobManager.QueryType type, String topic, long limit, Map<String,Object>... templates)org.apache.sling.event.jobs.JobgetJob(String topic, Map<String,Object> template)org.apache.sling.event.jobs.JobgetJobById(String id)JobSchedulerImplgetJobScheduler()org.apache.sling.event.jobs.QueuegetQueue(String name)Iterable<org.apache.sling.event.jobs.Queue>getQueues()Collection<org.apache.sling.event.jobs.ScheduledJobInfo>getScheduledJobs()Collection<org.apache.sling.event.jobs.ScheduledJobInfo>getScheduledJobs(String topic, long limit, Map<String,Object>... templates)org.apache.sling.event.jobs.StatisticsgetStatistics()Return our internal statistics object.Iterable<org.apache.sling.event.jobs.TopicStatistics>getTopicStatistics()voidhandleEvent(org.osgi.service.event.Event event)booleanremoveJobById(String jobId)org.apache.sling.event.jobs.JobretryJobById(String jobId)voidrun()This method is invoked periodically by the scheduler.voidstopJobById(String jobId)
-
-
-
Method Detail
-
activate
protected void activate(org.osgi.framework.BundleContext ctx, Map<String,Object> props) throws org.apache.sling.api.resource.LoginExceptionActivate this component.- Parameters:
props- Configuration properties- Throws:
org.apache.sling.api.resource.LoginException
-
deactivate
protected void deactivate()
Deactivate this component.
-
run
public void run()
This method is invoked periodically by the scheduler. In the default configuration every minute- Specified by:
runin interfaceRunnable- See Also:
Runnable.run()
-
handleEvent
public void handleEvent(org.osgi.service.event.Event event)
- Specified by:
handleEventin interfaceorg.osgi.service.event.EventHandler- See Also:
EventHandler.handleEvent(org.osgi.service.event.Event)
-
getStatistics
public org.apache.sling.event.jobs.Statistics getStatistics()
Return our internal statistics object.- Specified by:
getStatisticsin interfaceorg.apache.sling.event.jobs.JobManager- See Also:
JobManager.getStatistics()
-
getTopicStatistics
public Iterable<org.apache.sling.event.jobs.TopicStatistics> getTopicStatistics()
- Specified by:
getTopicStatisticsin interfaceorg.apache.sling.event.jobs.JobManager- See Also:
JobManager.getTopicStatistics()
-
getQueue
public org.apache.sling.event.jobs.Queue getQueue(String name)
- Specified by:
getQueuein interfaceorg.apache.sling.event.jobs.JobManager- See Also:
JobManager.getQueue(java.lang.String)
-
getQueues
public Iterable<org.apache.sling.event.jobs.Queue> getQueues()
- Specified by:
getQueuesin interfaceorg.apache.sling.event.jobs.JobManager- See Also:
JobManager.getQueues()
-
addJob
public org.apache.sling.event.jobs.Job addJob(String topic, Map<String,Object> properties)
- Specified by:
addJobin interfaceorg.apache.sling.event.jobs.JobManager- See Also:
JobManager.addJob(java.lang.String, java.util.Map)
-
getJobById
public org.apache.sling.event.jobs.Job getJobById(String id)
- Specified by:
getJobByIdin interfaceorg.apache.sling.event.jobs.JobManager- See Also:
JobManager.getJobById(java.lang.String)
-
getJob
public org.apache.sling.event.jobs.Job getJob(String topic, Map<String,Object> template)
- Specified by:
getJobin interfaceorg.apache.sling.event.jobs.JobManager- See Also:
JobManager.getJob(java.lang.String, java.util.Map)
-
removeJobById
public boolean removeJobById(String jobId)
- Specified by:
removeJobByIdin interfaceorg.apache.sling.event.jobs.JobManager- See Also:
JobManager.removeJobById(java.lang.String)
-
findJobs
public Collection<org.apache.sling.event.jobs.Job> findJobs(org.apache.sling.event.jobs.JobManager.QueryType type, String topic, long limit, Map<String,Object>... templates)
- Specified by:
findJobsin interfaceorg.apache.sling.event.jobs.JobManager- See Also:
JobManager.findJobs(org.apache.sling.event.jobs.JobManager.QueryType, java.lang.String, long, java.util.Map[])
-
buildBaseQuery
protected static String buildBaseQuery(String queryRoot, String topic, org.apache.sling.event.jobs.JobManager.QueryType type, boolean isHistoryQuery)
-
stopJobById
public void stopJobById(String jobId)
- Specified by:
stopJobByIdin interfaceorg.apache.sling.event.jobs.JobManager- See Also:
JobManager.stopJobById(java.lang.String)
-
createJob
public org.apache.sling.event.jobs.JobBuilder createJob(String topic)
- Specified by:
createJobin interfaceorg.apache.sling.event.jobs.JobManager- See Also:
JobManager.createJob(java.lang.String)
-
getScheduledJobs
public Collection<org.apache.sling.event.jobs.ScheduledJobInfo> getScheduledJobs()
- Specified by:
getScheduledJobsin interfaceorg.apache.sling.event.jobs.JobManager- See Also:
JobManager.getScheduledJobs()
-
getScheduledJobs
public Collection<org.apache.sling.event.jobs.ScheduledJobInfo> getScheduledJobs(String topic, long limit, Map<String,Object>... templates)
- Specified by:
getScheduledJobsin interfaceorg.apache.sling.event.jobs.JobManager- See Also:
JobManager.getScheduledJobs()
-
addJob
public org.apache.sling.event.jobs.Job addJob(String topic, Map<String,Object> properties, List<String> errors)
Internal method to add a job
-
retryJobById
public org.apache.sling.event.jobs.Job retryJobById(String jobId)
- Specified by:
retryJobByIdin interfaceorg.apache.sling.event.jobs.JobManager- See Also:
JobManager.retryJobById(java.lang.String)
-
getJobScheduler
public JobSchedulerImpl getJobScheduler()
-
-