Class AbstractTrigger<T extends Trigger>

    • Constructor Detail

      • AbstractTrigger

        protected AbstractTrigger​(java.lang.String name)

        Create a Trigger with the given name, and default group.

        Note that the setJobName(String)and setJobGroup(String)methods must be called before the Trigger can be placed into a Scheduler.

        Throws:
        java.lang.IllegalArgumentException - if name is null or empty, or the group is an empty string.
      • AbstractTrigger

        protected AbstractTrigger​(java.lang.String name,
                                  java.lang.String group)

        Create a Trigger with the given name, and group.

        Note that the setJobName(String)and setJobGroup(String)methods must be called before the Trigger can be placed into a Scheduler.

        Parameters:
        group - if null, Scheduler.DEFAULT_GROUP will be used.
        Throws:
        java.lang.IllegalArgumentException - if name is null or empty, or the group is an empty string.
      • AbstractTrigger

        protected AbstractTrigger​(java.lang.String name,
                                  java.lang.String group,
                                  java.lang.String jobName,
                                  java.lang.String jobGroup)

        Create a Trigger with the given name, and group.

        Parameters:
        group - if null, Scheduler.DEFAULT_GROUP will be used.
        Throws:
        java.lang.IllegalArgumentException - if name is null or empty, or the group is an empty string.
    • Method Detail

      • getName

        public java.lang.String getName()

        Get the name of this Trigger.

      • setName

        public void setName​(java.lang.String name)

        Set the name of this Trigger.

        Throws:
        java.lang.IllegalArgumentException - if name is null or empty.
      • getGroup

        public java.lang.String getGroup()

        Get the group of this Trigger.

      • setGroup

        public void setGroup​(java.lang.String group)

        Set the name of this Trigger.

        Parameters:
        group - if null, Scheduler.DEFAULT_GROUP will be used.
        Throws:
        java.lang.IllegalArgumentException - if group is an empty string.
      • getJobName

        public java.lang.String getJobName()

        Get the name of the associated JobDetail.

      • setJobName

        public void setJobName​(java.lang.String jobName)

        Set the name of the associated JobDetail.

        Throws:
        java.lang.IllegalArgumentException - if jobName is null or empty.
      • getJobGroup

        public java.lang.String getJobGroup()

        Get the name of the associated JobDetail's group.

      • setJobGroup

        public void setJobGroup​(java.lang.String jobGroup)

        Set the name of the associated JobDetail's group.

        Parameters:
        jobGroup - if null, Scheduler.DEFAULT_GROUP will be used.
        Throws:
        java.lang.IllegalArgumentException - if group is an empty string.
      • getFullName

        public java.lang.String getFullName()

        Returns the 'full name' of the Trigger in the format "group.name".

      • getFullJobName

        public java.lang.String getFullJobName()

        Returns the 'full name' of the Job that the Trigger points to, in the format "group.name".

      • getDescription

        public java.lang.String getDescription()

        Return the description given to the Trigger instance by its creator (if any).

        Specified by:
        getDescription in interface Trigger
        Returns:
        null if no description was set.
      • setDescription

        public void setDescription​(java.lang.String description)

        Set a description for the Trigger instance - may be useful for remembering/displaying the purpose of the trigger, though the description has no meaning to Quartz.

        Specified by:
        setDescription in interface MutableTrigger
      • setCalendarName

        public void setCalendarName​(java.lang.String calendarName)

        Associate the Calendar with the given name with this Trigger.

        Specified by:
        setCalendarName in interface MutableTrigger
        Parameters:
        calendarName - use null to dis-associate a Calendar.
      • getCalendarName

        public java.lang.String getCalendarName()

        Get the name of the Calendar associated with this Trigger.

        Specified by:
        getCalendarName in interface Trigger
        Returns:
        null if there is no associated Calendar.
      • getJobDataMap

        public JobDataMap getJobDataMap()

        Get the JobDataMap that is associated with the Trigger.

        Changes made to this map during job execution are not re-persisted, and in fact typically result in an IllegalStateException.

        Specified by:
        getJobDataMap in interface Trigger
      • getPriority

        public int getPriority()
        The priority of a Trigger acts as a tiebreaker such that if two Triggers have the same scheduled fire time, then the one with the higher priority will get first access to a worker thread.

        If not explicitly set, the default value is 5.

        Specified by:
        getPriority in interface Trigger
        See Also:
        Trigger.DEFAULT_PRIORITY
      • setPriority

        public void setPriority​(int priority)
        The priority of a Trigger acts as a tie breaker such that if two Triggers have the same scheduled fire time, then Quartz will do its best to give the one with the higher priority first access to a worker thread.

        If not explicitly set, the default value is 5.

        Specified by:
        setPriority in interface MutableTrigger
        See Also:
        Trigger.DEFAULT_PRIORITY
      • validateMisfireInstruction

        protected abstract boolean validateMisfireInstruction​(int candidateMisfireInstruction)
      • validate

        public void validate()
                      throws SchedulerException

        Validates whether the properties of the JobDetail are valid for submission into a Scheduler.

        Specified by:
        validate in interface OperableTrigger
        Throws:
        java.lang.IllegalStateException - if a required property (such as Name, Group, Class) is not set.
        SchedulerException
      • setFireInstanceId

        public void setFireInstanceId​(java.lang.String id)

        This method should not be used by the Quartz client.

        Usable by JobStore implementations, in order to facilitate 'recognizing' instances of fired Trigger s as their jobs complete execution.

        Specified by:
        setFireInstanceId in interface OperableTrigger
      • getFireInstanceId

        public java.lang.String getFireInstanceId()

        This method should not be used by the Quartz client.

        Specified by:
        getFireInstanceId in interface OperableTrigger
      • toString

        public java.lang.String toString()

        Return a simple string representation of this object.

        Overrides:
        toString in class java.lang.Object
      • compareTo

        public int compareTo​(Trigger other)

        Compare the next fire time of this Trigger to that of another by comparing their keys, or in other words, sorts them according to the natural (i.e. alphabetical) order of their keys.

        Specified by:
        compareTo in interface java.lang.Comparable<T extends Trigger>
        Specified by:
        compareTo in interface Trigger
      • equals

        public boolean equals​(java.lang.Object o)
        Trigger equality is based upon the equality of the TriggerKey.
        Specified by:
        equals in interface Trigger
        Overrides:
        equals in class java.lang.Object
        Returns:
        true if the key of this Trigger equals that of the given Trigger.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • clone

        public java.lang.Object clone()
        Specified by:
        clone in interface MutableTrigger
        Overrides:
        clone in class java.lang.Object