Package org.swisspush.gateleen.scheduler
Class Scheduler
- java.lang.Object
-
- org.swisspush.gateleen.scheduler.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, org.swisspush.gateleen.core.redis.RedisProvider redisProvider, String name, String cronExpression, List<org.swisspush.gateleen.core.http.HttpRequest> requests, org.swisspush.gateleen.monitoring.MonitoringHandler monitoringHandler, int maxRandomOffset, boolean executeOnStartup, boolean executeOnReload)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringgetName()Returns the name of the scheduler.protected longgetRandomOffset()Returns the calculated random offset for this scheduler.protected List<org.swisspush.gateleen.core.http.HttpRequest>requests()Returns the list of requests to execute for this scheduler.voidstart()voidstop()
-
-
-
Constructor Detail
-
Scheduler
public Scheduler(io.vertx.core.Vertx vertx, String redisquesAddress, org.swisspush.gateleen.core.redis.RedisProvider redisProvider, 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
-
-