Package org.apache.sling.event.impl.jobs
Class JobTopicTraverser
java.lang.Object
org.apache.sling.event.impl.jobs.JobTopicTraverser
The job topic traverser is an utility class to traverse all jobs
of a specific topic in order of creation.
The traverser can be used with two different callbacks,
the resource callback is called with a resource object,
the job callback with a job object created from the
resource.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Callback called for each found job.static interface
Callback called for each found resource. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
traverse
(org.slf4j.Logger logger, Resource topicResource, JobTopicTraverser.JobCallback handler) Traverse the topic and call the callback for each found job.static void
traverse
(org.slf4j.Logger logger, Resource topicResource, JobTopicTraverser.ResourceCallback handler) Traverse the topic and call the callback for each found resource.
-
Constructor Details
-
JobTopicTraverser
public JobTopicTraverser()
-
-
Method Details
-
traverse
public static void traverse(org.slf4j.Logger logger, Resource topicResource, JobTopicTraverser.JobCallback handler) Traverse the topic and call the callback for each found job. Once the callback notifies to stop traversing by returning false, the current minute will be processed completely (to ensure correct ordering of jobs) and then the traversal stops.- Parameters:
logger
- The logger to use for debug loggingtopicResource
- The topic resourcehandler
- The callback
-
traverse
public static void traverse(org.slf4j.Logger logger, Resource topicResource, JobTopicTraverser.ResourceCallback handler) Traverse the topic and call the callback for each found resource. Once the callback notifies to stop traversing by returning false, the traversal stops.- Parameters:
logger
- The logger to use for debug loggingtopicResource
- The topic resourcehandler
- The callback
-