Class Scheduler


  • public class Scheduler
    extends Object
    Schedules requests to be queued. Synchronizes using redis to ensure only one instance is fired.
    Author:
    https://github.com/lbovet [Laurent Bovet]
    • Constructor Summary

      Constructors 
      Constructor Description
      Scheduler​(io.vertx.core.Vertx vertx, String redisquesAddress, io.vertx.redis.client.RedisAPI redisAPI, String name, String cronExpression, List<org.swisspush.gateleen.core.http.HttpRequest> requests, org.swisspush.gateleen.monitoring.MonitoringHandler monitoringHandler, int maxRandomOffset, boolean executeOnStartup, boolean executeOnReload)  
    • Constructor Detail

      • Scheduler

        public Scheduler​(io.vertx.core.Vertx vertx,
                         String redisquesAddress,
                         io.vertx.redis.client.RedisAPI redisAPI,
                         String name,
                         String cronExpression,
                         List<org.swisspush.gateleen.core.http.HttpRequest> requests,
                         org.swisspush.gateleen.monitoring.MonitoringHandler monitoringHandler,
                         int maxRandomOffset,
                         boolean executeOnStartup,
                         boolean executeOnReload)
                  throws ParseException
        Throws:
        ParseException
    • Method Detail

      • start

        public void start()
      • stop

        public void stop()
      • getName

        protected String getName()
        Returns the name of the scheduler.
        Returns:
        name
      • getRandomOffset

        protected long getRandomOffset()
        Returns the calculated random offset for this scheduler.
        Returns:
        randomOffset
      • requests

        protected List<org.swisspush.gateleen.core.http.HttpRequest> requests()
        Returns the list of requests to execute for this scheduler.
        Returns:
        requests