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

# Class JobTopicTraverser

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

public class JobTopicTraverser extends Object
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

Nested Classes
Modifier and Type
Class
Description
`static interface`
`JobTopicTraverser.JobCallback`
Callback called for each found job.
`static interface`
`JobTopicTraverser.ResourceCallback`
Callback called for each found resource.

## Constructor Summary

Constructors
Constructor
Description
`JobTopicTraverser()`

## Method Summary

Modifier and Type
Method
Description
`static void`
`traverse(org.slf4j.Logger logger, org.apache.sling.api.resource.Resource topicResource, JobTopicTraverser.JobCallback handler)`
Traverse the topic and call the callback for each found job.
`static void`
`traverse(org.slf4j.Logger logger, org.apache.sling.api.resource.Resource topicResource, JobTopicTraverser.ResourceCallback handler)`
Traverse the topic and call the callback for each found resource.

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

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### JobTopicTraverser

public JobTopicTraverser()

## Method Details

### traverse

public static void traverse(org.slf4j.Logger logger, org.apache.sling.api.resource.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 logging
  `topicResource` - The topic resource
  `handler` - The callback

### traverse

public static void traverse(org.slf4j.Logger logger, org.apache.sling.api.resource.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 logging
  `topicResource` - The topic resource
  `handler` - The callback