Class SchedulerConstants

java.lang.Object
net.solarnetwork.central.scheduler.SchedulerConstants

public final class SchedulerConstants extends Object
Constants for the Scheduler API.

The scheduler works by sending OSGi EventAdmin events. Post a TOPIC_JOB_REQUEST event to schedule a job. The job will run at the time specified by the JOB_DATE property, triggering a new event using the topic specified by the request JOB_TOPIC property.

When the job executes, it will expect an acknowledgment event to be posted, either TOPIC_JOB_COMPLETE or TOPIC_JOB_FAILURE, so the job can tell if the work was executed or not. The job will wait at most JOB_MAX_WAIT milliseconds (using a default value if this is not specified on the job request), after which it will time out.

  • Field Details

    • TOPIC_JOB_REQUEST

      public static final String TOPIC_JOB_REQUEST
      Topic for a job request notification.
      See Also:
    • TOPIC_JOB_COMPLETE

      public static final String TOPIC_JOB_COMPLETE
      Topic for a job complete notification.
      See Also:
    • TOPIC_JOB_FAILURE

      public static final String TOPIC_JOB_FAILURE
      Topic for a job failure notification.
      See Also:
    • TOPIC_SCHEDULER_READY

      public static final String TOPIC_SCHEDULER_READY
      Topic of event sent when scheduler ready.
      See Also:
    • JOB_ID

      public static final String JOB_ID
      A unique ID for the job.
      See Also:
    • JOB_GROUP

      public static final String JOB_GROUP
      An optional group to schedule the job with.
      See Also:
    • JOB_TOPIC

      public static final String JOB_TOPIC
      The OSGi Event topic to use for the job notification.
      See Also:
    • JOB_DATE

      public static final String JOB_DATE
      A Long that represents the exact date to run the job at.
      See Also:
    • JOB_PROPERTIES

      public static final String JOB_PROPERTIES
      A java.util.Map of properties to associate with the job.
      See Also:
    • JOB_EXCEPTION

      public static final String JOB_EXCEPTION
      A Throwable to associate with a (failed) job.
      See Also:
    • JOB_MAX_WAIT

      public static final String JOB_MAX_WAIT
      A Long representing the maximum number of milliseconds to wait for the job to complete.
      See Also:
    • JOB_CRON_EXPRESSION

      public static final String JOB_CRON_EXPRESSION
      A cron expression to run the job with, instead of a specific date.
      See Also: