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.
  • 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 logging
      topicResource - The topic resource
      handler - 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 logging
      topicResource - The topic resource
      handler - The callback