Interface DriverDelegate
-
- All Known Implementing Classes:
CacheDelegate,CUBRIDDelegate,DB2v6Delegate,DB2v7Delegate,DB2v8Delegate,GaussDBDelegate,HSQLDBDelegate,MSSQLDelegate,OracleDelegate,PointbaseDelegate,PostgreSQLDelegate,StdJDBCDelegate,SybaseDelegate,WebLogicDelegate,WebLogicOracleDelegate
public interface DriverDelegateThis is the base interface for all driver delegate classes.
This interface is very similar to the
interface except each method has an additionalJobStoreparameter.ConnectionUnless a database driver has some extremely-DB-specific requirements, any DriverDelegate implementation classes should extend the
class.StdJDBCDelegate- Author:
- Jeffrey Wescott, James House
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description booleancalendarExists(java.sql.Connection conn, java.lang.String calendarName)Check whether or not a calendar exists.booleancalendarIsReferenced(java.sql.Connection conn, java.lang.String calendarName)Check whether or not a calendar is referenced by any triggers.voidclearData(java.sql.Connection conn)intcountMisfiredTriggersInState(java.sql.Connection conn, java.lang.String state1, long ts)Get the number of triggers in the given state that have misfired - according to the given timestamp.intdeleteAllPausedTriggerGroups(java.sql.Connection conn)intdeleteCalendar(java.sql.Connection conn, java.lang.String calendarName)Delete a calendar.intdeleteFiredTrigger(java.sql.Connection conn, java.lang.String entryId)Delete a fired trigger.intdeleteFiredTriggers(java.sql.Connection conn)Delete all fired triggers.intdeleteFiredTriggers(java.sql.Connection conn, java.lang.String instanceId)Delete all fired triggers of the given instance.intdeleteJobDetail(java.sql.Connection conn, JobKey jobKey)Delete the job detail record for the given job.intdeletePausedTriggerGroup(java.sql.Connection conn, java.lang.String groupName)intdeletePausedTriggerGroup(java.sql.Connection conn, GroupMatcher<TriggerKey> matcher)intdeleteSchedulerState(java.sql.Connection conn, java.lang.String instanceId)Delete a scheduler-instance state record.intdeleteTrigger(java.sql.Connection conn, TriggerKey triggerKey)Delete the base trigger data for a trigger.booleanhasMisfiredTriggersInState(java.sql.Connection conn, java.lang.String state1, long ts, int count, java.util.List<TriggerKey> resultList)Get the names of all of the triggers in the given states that have misfired - according to the given timestamp.voidinitialize(org.slf4j.Logger logger, java.lang.String tablePrefix, java.lang.String schedName, java.lang.String instanceId, ClassLoadHelper classLoadHelper, boolean useProperties, java.lang.String initString)intinsertCalendar(java.sql.Connection conn, java.lang.String calendarName, Calendar calendar)Insert a new calendar.intinsertFiredTrigger(java.sql.Connection conn, OperableTrigger trigger, java.lang.String state, JobDetail jobDetail)Insert a fired trigger.intinsertJobDetail(java.sql.Connection conn, JobDetail job)Insert the job detail record.intinsertPausedTriggerGroup(java.sql.Connection conn, java.lang.String groupName)intinsertSchedulerState(java.sql.Connection conn, java.lang.String instanceId, long checkInTime, long interval)Insert a scheduler-instance state record.intinsertTrigger(java.sql.Connection conn, OperableTrigger trigger, java.lang.String state, JobDetail jobDetail)Insert the base trigger data.booleanisExistingTriggerGroup(java.sql.Connection conn, java.lang.String groupName)booleanisJobNonConcurrent(java.sql.Connection conn, JobKey jobKey)Check whether or not the given job disallows concurrent execution.booleanisTriggerGroupPaused(java.sql.Connection conn, java.lang.String groupName)booleanjobExists(java.sql.Connection conn, JobKey jobKey)Check whether or not the given job exists.CalendarselectCalendar(java.sql.Connection conn, java.lang.String calendarName)Select a calendar.java.util.List<java.lang.String>selectCalendars(java.sql.Connection conn)Select all of the stored calendars.java.util.Set<java.lang.String>selectFiredTriggerInstanceNames(java.sql.Connection conn)Select the distinct instance names of all fired-trigger records.java.util.List<FiredTriggerRecord>selectFiredTriggerRecords(java.sql.Connection conn, java.lang.String triggerName, java.lang.String groupName)Select the states of all fired-trigger records for a given trigger, or trigger group if trigger name isnull.java.util.List<FiredTriggerRecord>selectFiredTriggerRecordsByJob(java.sql.Connection conn, java.lang.String jobName, java.lang.String groupName)Select the states of all fired-trigger records for a given job, or job group if job name isnull.java.util.List<FiredTriggerRecord>selectInstancesFiredTriggerRecords(java.sql.Connection conn, java.lang.String instanceName)Select the states of all fired-trigger records for a given scheduler instance.JobDetailselectJobDetail(java.sql.Connection conn, JobKey jobKey, ClassLoadHelper loadHelper)Select the JobDetail object for a given job name / group name.intselectJobExecutionCount(java.sql.Connection conn, JobKey jobKey)Get the number instances of the identified job currently executing.JobDetailselectJobForTrigger(java.sql.Connection conn, ClassLoadHelper loadHelper, TriggerKey triggerKey)Select the job to which the trigger is associated.JobDetailselectJobForTrigger(java.sql.Connection conn, ClassLoadHelper loadHelper, TriggerKey triggerKey, boolean loadJobClass)Select the job to which the trigger is associated.java.util.List<java.lang.String>selectJobGroups(java.sql.Connection conn)Select all of the job group names that are stored.java.util.Set<JobKey>selectJobsInGroup(java.sql.Connection conn, GroupMatcher<JobKey> matcher)Select all of the jobs contained in a given group.java.util.List<TriggerKey>selectMisfiredTriggers(java.sql.Connection conn, long ts)Get the names of all of the triggers that have misfired - according to the given timestamp.java.util.List<TriggerKey>selectMisfiredTriggersInGroupInState(java.sql.Connection conn, java.lang.String groupName, java.lang.String state, long ts)Get the names of all of the triggers in the given group and state that have misfired - according to the given timestamp.java.util.List<TriggerKey>selectMisfiredTriggersInState(java.sql.Connection conn, java.lang.String state, long ts)Get the names of all of the triggers in the given state that have misfired - according to the given timestamp.longselectNextFireTime(java.sql.Connection conn)Deprecated.Does not account for misfires.intselectNumCalendars(java.sql.Connection conn)Select the total number of calendars stored.intselectNumJobs(java.sql.Connection conn)Select the total number of jobs stored.intselectNumTriggers(java.sql.Connection conn)Select the total number of triggers stored.intselectNumTriggersForJob(java.sql.Connection conn, JobKey jobKey)Select the number of triggers associated with a given job.java.util.Set<java.lang.String>selectPausedTriggerGroups(java.sql.Connection conn)java.util.List<SchedulerStateRecord>selectSchedulerStateRecords(java.sql.Connection conn, java.lang.String instanceId)A List of all currentSchedulerStateRecords.OperableTriggerselectTrigger(java.sql.Connection conn, TriggerKey triggerKey)Select a trigger.Key<?>selectTriggerForFireTime(java.sql.Connection conn, long fireTime)Select the trigger that will be fired at the given fire time.java.util.List<java.lang.String>selectTriggerGroups(java.sql.Connection conn)Select all of the trigger group names that are stored.java.util.List<java.lang.String>selectTriggerGroups(java.sql.Connection conn, GroupMatcher<TriggerKey> matcher)JobDataMapselectTriggerJobDataMap(java.sql.Connection conn, java.lang.String triggerName, java.lang.String groupName)Select a trigger's JobDataMap.java.util.List<TriggerKey>selectTriggerKeysForJob(java.sql.Connection conn, JobKey jobKey)Get the names of all of the triggers associated with the given job.java.util.List<OperableTrigger>selectTriggersForCalendar(java.sql.Connection conn, java.lang.String calName)Select the triggers for a calendarjava.util.List<OperableTrigger>selectTriggersForJob(java.sql.Connection conn, JobKey jobKey)Select the triggers for a jobjava.util.List<OperableTrigger>selectTriggersForRecoveringJobs(java.sql.Connection conn)Select all of the triggers for jobs that are requesting recovery.java.util.Set<TriggerKey>selectTriggersInGroup(java.sql.Connection conn, GroupMatcher<TriggerKey> matcher)Select all of the triggers contained in a given group.java.util.List<TriggerKey>selectTriggersInState(java.sql.Connection conn, java.lang.String state)Select all of the triggers in a given state.java.lang.StringselectTriggerState(java.sql.Connection conn, TriggerKey triggerKey)Select a trigger' state value.TriggerStatusselectTriggerStatus(java.sql.Connection conn, TriggerKey triggerKey)Select a trigger' status (state and next fire time).java.util.List<TriggerKey>selectTriggerToAcquire(java.sql.Connection conn, long noLaterThan, long noEarlierThan)Deprecated.- This remained for compatibility reason.java.util.List<TriggerKey>selectTriggerToAcquire(java.sql.Connection conn, long noLaterThan, long noEarlierThan, int maxCount)Select the next trigger which will fire to fire between the two given timestamps in ascending order of fire time, and then descending by priority.booleantriggerExists(java.sql.Connection conn, TriggerKey triggerKey)Check whether or not a trigger exists.intupdateCalendar(java.sql.Connection conn, java.lang.String calendarName, Calendar calendar)Update a calendar.intupdateFiredTrigger(java.sql.Connection conn, OperableTrigger trigger, java.lang.String state, JobDetail jobDetail)Update a fired trigger record.intupdateJobData(java.sql.Connection conn, JobDetail job)Update the job data map for the given job.intupdateJobDetail(java.sql.Connection conn, JobDetail job)Update the job detail record.intupdateSchedulerState(java.sql.Connection conn, java.lang.String instanceId, long checkInTime)Update a scheduler-instance state record.intupdateTrigger(java.sql.Connection conn, OperableTrigger trigger, java.lang.String state, JobDetail jobDetail)Update the base trigger data.intupdateTriggerGroupStateFromOtherState(java.sql.Connection conn, GroupMatcher<TriggerKey> matcher, java.lang.String newState, java.lang.String oldState)Update all of the triggers of the given group to the given new state, if they are in the given old state.intupdateTriggerGroupStateFromOtherStates(java.sql.Connection conn, GroupMatcher<TriggerKey> matcher, java.lang.String newState, java.lang.String oldState1, java.lang.String oldState2, java.lang.String oldState3)Update all triggers in the given group to the given new state, if they are in one of the given old states.intupdateTriggerState(java.sql.Connection conn, TriggerKey triggerKey, java.lang.String state)Update the state for a given trigger.intupdateTriggerStateFromOtherState(java.sql.Connection conn, TriggerKey triggerKey, java.lang.String newState, java.lang.String oldState)Update the given trigger to the given new state, if it is in the given old state.intupdateTriggerStateFromOtherStates(java.sql.Connection conn, TriggerKey triggerKey, java.lang.String newState, java.lang.String oldState1, java.lang.String oldState2, java.lang.String oldState3)Update the given trigger to the given new state, if it is one of the given old states.intupdateTriggerStatesForJob(java.sql.Connection conn, JobKey jobKey, java.lang.String state)Update the states of all triggers associated with the given job.intupdateTriggerStatesForJobFromOtherState(java.sql.Connection conn, JobKey jobKey, java.lang.String state, java.lang.String oldState)Update the states of any triggers associated with the given job, that are the given current state.intupdateTriggerStatesFromOtherStates(java.sql.Connection conn, java.lang.String newState, java.lang.String oldState1, java.lang.String oldState2)Update all triggers having one of the two given states, to the given new state.
-
-
-
Method Detail
-
initialize
void initialize(org.slf4j.Logger logger, java.lang.String tablePrefix, java.lang.String schedName, java.lang.String instanceId, ClassLoadHelper classLoadHelper, boolean useProperties, java.lang.String initString) throws NoSuchDelegateException- Parameters:
initString- of the format: settingName=settingValue|otherSettingName=otherSettingValue|...- Throws:
NoSuchDelegateException
-
updateTriggerStatesFromOtherStates
int updateTriggerStatesFromOtherStates(java.sql.Connection conn, java.lang.String newState, java.lang.String oldState1, java.lang.String oldState2) throws java.sql.SQLExceptionUpdate all triggers having one of the two given states, to the given new state.
- Parameters:
conn- the DB ConnectionnewState- the new state for the triggersoldState1- the first old state to updateoldState2- the second old state to update- Returns:
- number of rows updated
- Throws:
java.sql.SQLException
-
selectMisfiredTriggers
java.util.List<TriggerKey> selectMisfiredTriggers(java.sql.Connection conn, long ts) throws java.sql.SQLException
Get the names of all of the triggers that have misfired - according to the given timestamp.
- Parameters:
conn- the DB Connection- Returns:
- an array of
objectsKey - Throws:
java.sql.SQLException
-
selectMisfiredTriggersInState
java.util.List<TriggerKey> selectMisfiredTriggersInState(java.sql.Connection conn, java.lang.String state, long ts) throws java.sql.SQLException
Get the names of all of the triggers in the given state that have misfired - according to the given timestamp.
- Parameters:
conn- the DB Connection- Returns:
- an array of
objectsKey - Throws:
java.sql.SQLException
-
hasMisfiredTriggersInState
boolean hasMisfiredTriggersInState(java.sql.Connection conn, java.lang.String state1, long ts, int count, java.util.List<TriggerKey> resultList) throws java.sql.SQLExceptionGet the names of all of the triggers in the given states that have misfired - according to the given timestamp. No more than count will be returned.
- Parameters:
conn- the DB Connectioncount- the most misfired triggers to return, negative for allresultList- Output parameter. A List ofobjects. Must not be null.Key- Returns:
- Whether there are more misfired triggers left to find beyond the given count.
- Throws:
java.sql.SQLException
-
countMisfiredTriggersInState
int countMisfiredTriggersInState(java.sql.Connection conn, java.lang.String state1, long ts) throws java.sql.SQLExceptionGet the number of triggers in the given state that have misfired - according to the given timestamp.
- Parameters:
conn- the DB Connection- Throws:
java.sql.SQLException
-
selectMisfiredTriggersInGroupInState
java.util.List<TriggerKey> selectMisfiredTriggersInGroupInState(java.sql.Connection conn, java.lang.String groupName, java.lang.String state, long ts) throws java.sql.SQLException
Get the names of all of the triggers in the given group and state that have misfired - according to the given timestamp.
- Parameters:
conn- the DB Connection- Returns:
- an array of
objectsKey - Throws:
java.sql.SQLException
-
selectTriggersForRecoveringJobs
java.util.List<OperableTrigger> selectTriggersForRecoveringJobs(java.sql.Connection conn) throws java.sql.SQLException, java.io.IOException, java.lang.ClassNotFoundException
Select all of the triggers for jobs that are requesting recovery. The returned trigger objects will have unique "recoverXXX" trigger names and will be in the
trigger group.Scheduler.DEFAULT_RECOVERY_GROUPIn order to preserve the ordering of the triggers, the fire time will be set from the
COL_FIRED_TIMEcolumn in theTABLE_FIRED_TRIGGERStable. The caller is responsible for callingcomputeFirstFireTimeon each returned trigger. It is also up to the caller to insert the returned triggers to ensure that they are fired.- Parameters:
conn- the DB Connection- Returns:
- an array of
objectsTrigger - Throws:
java.sql.SQLExceptionjava.io.IOExceptionjava.lang.ClassNotFoundException
-
deleteFiredTriggers
int deleteFiredTriggers(java.sql.Connection conn) throws java.sql.SQLExceptionDelete all fired triggers.
- Parameters:
conn- the DB Connection- Returns:
- the number of rows deleted
- Throws:
java.sql.SQLException
-
deleteFiredTriggers
int deleteFiredTriggers(java.sql.Connection conn, java.lang.String instanceId) throws java.sql.SQLExceptionDelete all fired triggers of the given instance.
- Parameters:
conn- the DB Connection- Returns:
- the number of rows deleted
- Throws:
java.sql.SQLException
-
insertJobDetail
int insertJobDetail(java.sql.Connection conn, JobDetail job) throws java.io.IOException, java.sql.SQLExceptionInsert the job detail record.
- Parameters:
conn- the DB Connectionjob- the job to insert- Returns:
- number of rows inserted
- Throws:
java.io.IOException- if there were problems serializing the JobDataMapjava.sql.SQLException
-
updateJobDetail
int updateJobDetail(java.sql.Connection conn, JobDetail job) throws java.io.IOException, java.sql.SQLExceptionUpdate the job detail record.
- Parameters:
conn- the DB Connectionjob- the job to update- Returns:
- number of rows updated
- Throws:
java.io.IOException- if there were problems serializing the JobDataMapjava.sql.SQLException
-
selectTriggerKeysForJob
java.util.List<TriggerKey> selectTriggerKeysForJob(java.sql.Connection conn, JobKey jobKey) throws java.sql.SQLException
Get the names of all of the triggers associated with the given job.
- Parameters:
conn- the DB Connection- Returns:
- an array of
objectsKey - Throws:
java.sql.SQLException
-
deleteJobDetail
int deleteJobDetail(java.sql.Connection conn, JobKey jobKey) throws java.sql.SQLExceptionDelete the job detail record for the given job.
- Parameters:
conn- the DB Connection- Returns:
- the number of rows deleted
- Throws:
java.sql.SQLException
-
isJobNonConcurrent
boolean isJobNonConcurrent(java.sql.Connection conn, JobKey jobKey) throws java.sql.SQLExceptionCheck whether or not the given job disallows concurrent execution.
- Parameters:
conn- the DB Connection- Returns:
- true if the job exists and disallows concurrent execution, false otherwise
- Throws:
java.sql.SQLException
-
jobExists
boolean jobExists(java.sql.Connection conn, JobKey jobKey) throws java.sql.SQLExceptionCheck whether or not the given job exists.
- Parameters:
conn- the DB Connection- Returns:
- true if the job exists, false otherwise
- Throws:
java.sql.SQLException
-
updateJobData
int updateJobData(java.sql.Connection conn, JobDetail job) throws java.io.IOException, java.sql.SQLExceptionUpdate the job data map for the given job.
- Parameters:
conn- the DB Connectionjob- the job to update- Returns:
- the number of rows updated
- Throws:
java.io.IOException- if there were problems serializing the JobDataMapjava.sql.SQLException
-
selectJobDetail
JobDetail selectJobDetail(java.sql.Connection conn, JobKey jobKey, ClassLoadHelper loadHelper) throws java.lang.ClassNotFoundException, java.io.IOException, java.sql.SQLException
Select the JobDetail object for a given job name / group name.
- Parameters:
conn- the DB Connection- Returns:
- the populated JobDetail object
- Throws:
java.lang.ClassNotFoundException- if a class found during deserialization cannot be found or if the job class could not be foundjava.io.IOException- if deserialization causes an errorjava.sql.SQLException
-
selectNumJobs
int selectNumJobs(java.sql.Connection conn) throws java.sql.SQLExceptionSelect the total number of jobs stored.
- Parameters:
conn- the DB Connection- Returns:
- the total number of jobs stored
- Throws:
java.sql.SQLException
-
selectJobGroups
java.util.List<java.lang.String> selectJobGroups(java.sql.Connection conn) throws java.sql.SQLExceptionSelect all of the job group names that are stored.
- Parameters:
conn- the DB Connection- Returns:
- an array of
Stringgroup names - Throws:
java.sql.SQLException
-
selectJobsInGroup
java.util.Set<JobKey> selectJobsInGroup(java.sql.Connection conn, GroupMatcher<JobKey> matcher) throws java.sql.SQLException
Select all of the jobs contained in a given group.
- Parameters:
conn- the DB Connectionmatcher- the group matcher to evaluate against the known jobs- Returns:
- an array of
Stringjob names - Throws:
java.sql.SQLException
-
insertTrigger
int insertTrigger(java.sql.Connection conn, OperableTrigger trigger, java.lang.String state, JobDetail jobDetail) throws java.sql.SQLException, java.io.IOExceptionInsert the base trigger data.
- Parameters:
conn- the DB Connectiontrigger- the trigger to insertstate- the state that the trigger should be stored in- Returns:
- the number of rows inserted
- Throws:
java.sql.SQLExceptionjava.io.IOException
-
updateTrigger
int updateTrigger(java.sql.Connection conn, OperableTrigger trigger, java.lang.String state, JobDetail jobDetail) throws java.sql.SQLException, java.io.IOExceptionUpdate the base trigger data.
- Parameters:
conn- the DB Connectiontrigger- the trigger to insertstate- the state that the trigger should be stored in- Returns:
- the number of rows updated
- Throws:
java.sql.SQLExceptionjava.io.IOException
-
triggerExists
boolean triggerExists(java.sql.Connection conn, TriggerKey triggerKey) throws java.sql.SQLExceptionCheck whether or not a trigger exists.
- Parameters:
conn- the DB Connection- Returns:
- the number of rows updated
- Throws:
java.sql.SQLException
-
updateTriggerState
int updateTriggerState(java.sql.Connection conn, TriggerKey triggerKey, java.lang.String state) throws java.sql.SQLExceptionUpdate the state for a given trigger.
- Parameters:
conn- the DB Connectionstate- the new state for the trigger- Returns:
- the number of rows updated
- Throws:
java.sql.SQLException
-
updateTriggerStateFromOtherState
int updateTriggerStateFromOtherState(java.sql.Connection conn, TriggerKey triggerKey, java.lang.String newState, java.lang.String oldState) throws java.sql.SQLExceptionUpdate the given trigger to the given new state, if it is in the given old state.
- Parameters:
conn- the DB connectionnewState- the new state for the triggeroldState- the old state the trigger must be in- Returns:
- int the number of rows updated
- Throws:
java.sql.SQLException
-
updateTriggerStateFromOtherStates
int updateTriggerStateFromOtherStates(java.sql.Connection conn, TriggerKey triggerKey, java.lang.String newState, java.lang.String oldState1, java.lang.String oldState2, java.lang.String oldState3) throws java.sql.SQLExceptionUpdate the given trigger to the given new state, if it is one of the given old states.
- Parameters:
conn- the DB connectionnewState- the new state for the triggeroldState1- one of the old state the trigger must be inoldState2- one of the old state the trigger must be inoldState3- one of the old state the trigger must be in- Returns:
- int the number of rows updated
- Throws:
java.sql.SQLException
-
updateTriggerGroupStateFromOtherStates
int updateTriggerGroupStateFromOtherStates(java.sql.Connection conn, GroupMatcher<TriggerKey> matcher, java.lang.String newState, java.lang.String oldState1, java.lang.String oldState2, java.lang.String oldState3) throws java.sql.SQLExceptionUpdate all triggers in the given group to the given new state, if they are in one of the given old states.
- Parameters:
conn- the DB connectionmatcher- the group matcher to evaluate against the known triggersnewState- the new state for the triggeroldState1- one of the old state the trigger must be inoldState2- one of the old state the trigger must be inoldState3- one of the old state the trigger must be in- Returns:
- int the number of rows updated
- Throws:
java.sql.SQLException
-
updateTriggerGroupStateFromOtherState
int updateTriggerGroupStateFromOtherState(java.sql.Connection conn, GroupMatcher<TriggerKey> matcher, java.lang.String newState, java.lang.String oldState) throws java.sql.SQLExceptionUpdate all of the triggers of the given group to the given new state, if they are in the given old state.
- Parameters:
conn- the DB connectionmatcher- the matcher to evaluate against the known triggersnewState- the new state for the trigger groupoldState- the old state the triggers must be in- Returns:
- int the number of rows updated
- Throws:
java.sql.SQLException
-
updateTriggerStatesForJob
int updateTriggerStatesForJob(java.sql.Connection conn, JobKey jobKey, java.lang.String state) throws java.sql.SQLExceptionUpdate the states of all triggers associated with the given job.
- Parameters:
conn- the DB Connectionstate- the new state for the triggers- Returns:
- the number of rows updated
- Throws:
java.sql.SQLException
-
updateTriggerStatesForJobFromOtherState
int updateTriggerStatesForJobFromOtherState(java.sql.Connection conn, JobKey jobKey, java.lang.String state, java.lang.String oldState) throws java.sql.SQLExceptionUpdate the states of any triggers associated with the given job, that are the given current state.
- Parameters:
conn- the DB Connectionstate- the new state for the triggersoldState- the old state of the triggers- Returns:
- the number of rows updated
- Throws:
java.sql.SQLException
-
deleteTrigger
int deleteTrigger(java.sql.Connection conn, TriggerKey triggerKey) throws java.sql.SQLExceptionDelete the base trigger data for a trigger.
- Parameters:
conn- the DB Connection- Returns:
- the number of rows deleted
- Throws:
java.sql.SQLException
-
selectNumTriggersForJob
int selectNumTriggersForJob(java.sql.Connection conn, JobKey jobKey) throws java.sql.SQLExceptionSelect the number of triggers associated with a given job.
- Parameters:
conn- the DB Connection- Returns:
- the number of triggers for the given job
- Throws:
java.sql.SQLException
-
selectJobForTrigger
JobDetail selectJobForTrigger(java.sql.Connection conn, ClassLoadHelper loadHelper, TriggerKey triggerKey) throws java.lang.ClassNotFoundException, java.sql.SQLException
Select the job to which the trigger is associated.
- Parameters:
conn- the DB Connection- Returns:
- the
object associated with the given triggerJobDetail - Throws:
java.lang.ClassNotFoundExceptionjava.sql.SQLException
-
selectJobForTrigger
JobDetail selectJobForTrigger(java.sql.Connection conn, ClassLoadHelper loadHelper, TriggerKey triggerKey, boolean loadJobClass) throws java.lang.ClassNotFoundException, java.sql.SQLException
Select the job to which the trigger is associated. Allow option to load actual job class or not. When case of remove, we do not need to load the class, which in many cases, it's no longer exists.
- Throws:
java.lang.ClassNotFoundExceptionjava.sql.SQLException
-
selectTriggersForJob
java.util.List<OperableTrigger> selectTriggersForJob(java.sql.Connection conn, JobKey jobKey) throws java.sql.SQLException, java.lang.ClassNotFoundException, java.io.IOException, JobPersistenceException
Select the triggers for a job
- Parameters:
conn- the DB Connection- Returns:
- an array of
(@link org.quartz.Trigger)objects associated with a given job. - Throws:
java.sql.SQLExceptionJobPersistenceExceptionjava.lang.ClassNotFoundExceptionjava.io.IOException
-
selectTriggersForCalendar
java.util.List<OperableTrigger> selectTriggersForCalendar(java.sql.Connection conn, java.lang.String calName) throws java.sql.SQLException, java.lang.ClassNotFoundException, java.io.IOException, JobPersistenceException
Select the triggers for a calendar
- Parameters:
conn- the DB ConnectioncalName- the name of the calendar- Returns:
- an array of
(@link org.quartz.Trigger)objects associated with the given calendar. - Throws:
java.sql.SQLExceptionJobPersistenceExceptionjava.lang.ClassNotFoundExceptionjava.io.IOException
-
selectTrigger
OperableTrigger selectTrigger(java.sql.Connection conn, TriggerKey triggerKey) throws java.sql.SQLException, java.lang.ClassNotFoundException, java.io.IOException, JobPersistenceException
Select a trigger.
- Parameters:
conn- the DB Connection- Returns:
- the
objectTrigger - Throws:
JobPersistenceExceptionjava.sql.SQLExceptionjava.lang.ClassNotFoundExceptionjava.io.IOException
-
selectTriggerJobDataMap
JobDataMap selectTriggerJobDataMap(java.sql.Connection conn, java.lang.String triggerName, java.lang.String groupName) throws java.sql.SQLException, java.lang.ClassNotFoundException, java.io.IOException
Select a trigger's JobDataMap.
- Parameters:
conn- the DB ConnectiontriggerName- the name of the triggergroupName- the group containing the trigger- Returns:
- the
of the Trigger, never null, but possibly empty.JobDataMap - Throws:
java.sql.SQLExceptionjava.lang.ClassNotFoundExceptionjava.io.IOException
-
selectTriggerState
java.lang.String selectTriggerState(java.sql.Connection conn, TriggerKey triggerKey) throws java.sql.SQLExceptionSelect a trigger' state value.
- Parameters:
conn- the DB Connection- Returns:
- the
objectTrigger - Throws:
java.sql.SQLException
-
selectTriggerStatus
TriggerStatus selectTriggerStatus(java.sql.Connection conn, TriggerKey triggerKey) throws java.sql.SQLException
Select a trigger' status (state and next fire time).
- Parameters:
conn- the DB Connection- Returns:
- a
TriggerStatusobject, or null - Throws:
java.sql.SQLException
-
selectNumTriggers
int selectNumTriggers(java.sql.Connection conn) throws java.sql.SQLExceptionSelect the total number of triggers stored.
- Parameters:
conn- the DB Connection- Returns:
- the total number of triggers stored
- Throws:
java.sql.SQLException
-
selectTriggerGroups
java.util.List<java.lang.String> selectTriggerGroups(java.sql.Connection conn) throws java.sql.SQLExceptionSelect all of the trigger group names that are stored.
- Parameters:
conn- the DB Connection- Returns:
- an array of
Stringgroup names - Throws:
java.sql.SQLException
-
selectTriggerGroups
java.util.List<java.lang.String> selectTriggerGroups(java.sql.Connection conn, GroupMatcher<TriggerKey> matcher) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
selectTriggersInGroup
java.util.Set<TriggerKey> selectTriggersInGroup(java.sql.Connection conn, GroupMatcher<TriggerKey> matcher) throws java.sql.SQLException
Select all of the triggers contained in a given group.
- Parameters:
conn- the DB Connectionmatcher- to evaluate against known triggers- Returns:
- a Set of
TriggerKeys - Throws:
java.sql.SQLException
-
selectTriggersInState
java.util.List<TriggerKey> selectTriggersInState(java.sql.Connection conn, java.lang.String state) throws java.sql.SQLException
Select all of the triggers in a given state.
- Parameters:
conn- the DB Connectionstate- the state the triggers must be in- Returns:
- an array of trigger
Keys - Throws:
java.sql.SQLException
-
insertPausedTriggerGroup
int insertPausedTriggerGroup(java.sql.Connection conn, java.lang.String groupName) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
deletePausedTriggerGroup
int deletePausedTriggerGroup(java.sql.Connection conn, java.lang.String groupName) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
deletePausedTriggerGroup
int deletePausedTriggerGroup(java.sql.Connection conn, GroupMatcher<TriggerKey> matcher) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
deleteAllPausedTriggerGroups
int deleteAllPausedTriggerGroups(java.sql.Connection conn) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
isTriggerGroupPaused
boolean isTriggerGroupPaused(java.sql.Connection conn, java.lang.String groupName) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
selectPausedTriggerGroups
java.util.Set<java.lang.String> selectPausedTriggerGroups(java.sql.Connection conn) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
isExistingTriggerGroup
boolean isExistingTriggerGroup(java.sql.Connection conn, java.lang.String groupName) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
insertCalendar
int insertCalendar(java.sql.Connection conn, java.lang.String calendarName, Calendar calendar) throws java.io.IOException, java.sql.SQLExceptionInsert a new calendar.
- Parameters:
conn- the DB ConnectioncalendarName- the name for the new calendarcalendar- the calendar- Returns:
- the number of rows inserted
- Throws:
java.io.IOException- if there were problems serializing the calendarjava.sql.SQLException
-
updateCalendar
int updateCalendar(java.sql.Connection conn, java.lang.String calendarName, Calendar calendar) throws java.io.IOException, java.sql.SQLExceptionUpdate a calendar.
- Parameters:
conn- the DB ConnectioncalendarName- the name for the new calendarcalendar- the calendar- Returns:
- the number of rows updated
- Throws:
java.io.IOException- if there were problems serializing the calendarjava.sql.SQLException
-
calendarExists
boolean calendarExists(java.sql.Connection conn, java.lang.String calendarName) throws java.sql.SQLExceptionCheck whether or not a calendar exists.
- Parameters:
conn- the DB ConnectioncalendarName- the name of the calendar- Returns:
- true if the trigger exists, false otherwise
- Throws:
java.sql.SQLException
-
selectCalendar
Calendar selectCalendar(java.sql.Connection conn, java.lang.String calendarName) throws java.lang.ClassNotFoundException, java.io.IOException, java.sql.SQLException
Select a calendar.
- Parameters:
conn- the DB ConnectioncalendarName- the name of the calendar- Returns:
- the Calendar
- Throws:
java.lang.ClassNotFoundException- if a class found during deserialization cannot be found be foundjava.io.IOException- if there were problems deserializing the calendarjava.sql.SQLException
-
calendarIsReferenced
boolean calendarIsReferenced(java.sql.Connection conn, java.lang.String calendarName) throws java.sql.SQLExceptionCheck whether or not a calendar is referenced by any triggers.
- Parameters:
conn- the DB ConnectioncalendarName- the name of the calendar- Returns:
- true if any triggers reference the calendar, false otherwise
- Throws:
java.sql.SQLException
-
deleteCalendar
int deleteCalendar(java.sql.Connection conn, java.lang.String calendarName) throws java.sql.SQLExceptionDelete a calendar.
- Parameters:
conn- the DB ConnectioncalendarName- the name of the trigger- Returns:
- the number of rows deleted
- Throws:
java.sql.SQLException
-
selectNumCalendars
int selectNumCalendars(java.sql.Connection conn) throws java.sql.SQLExceptionSelect the total number of calendars stored.
- Parameters:
conn- the DB Connection- Returns:
- the total number of calendars stored
- Throws:
java.sql.SQLException
-
selectCalendars
java.util.List<java.lang.String> selectCalendars(java.sql.Connection conn) throws java.sql.SQLExceptionSelect all of the stored calendars.
- Parameters:
conn- the DB Connection- Returns:
- an array of
Stringcalendar names - Throws:
java.sql.SQLException
-
selectNextFireTime
@Deprecated long selectNextFireTime(java.sql.Connection conn) throws java.sql.SQLExceptionDeprecated.Does not account for misfires.Select the next time that a trigger will be fired.
- Parameters:
conn- the DB Connection- Returns:
- the next fire time, or 0 if no trigger will be fired
- Throws:
java.sql.SQLException
-
selectTriggerForFireTime
Key<?> selectTriggerForFireTime(java.sql.Connection conn, long fireTime) throws java.sql.SQLException
Select the trigger that will be fired at the given fire time.
- Parameters:
conn- the DB ConnectionfireTime- the time that the trigger will be fired- Returns:
- a
representing the trigger that will be fired at the given fire time, or null if no trigger will be fired at that timeKey - Throws:
java.sql.SQLException
-
selectTriggerToAcquire
@Deprecated java.util.List<TriggerKey> selectTriggerToAcquire(java.sql.Connection conn, long noLaterThan, long noEarlierThan) throws java.sql.SQLException
Deprecated.- This remained for compatibility reason. UseselectTriggerToAcquire(Connection, long, long, int)instead.Select the next trigger which will fire to fire between the two given timestamps in ascending order of fire time, and then descending by priority.
- Parameters:
conn- the DB ConnectionnoLaterThan- highest value ofgetNextFireTime()of the triggers (exclusive)noEarlierThan- lowest value ofgetNextFireTime()of the triggers (inclusive)- Returns:
- A (never null, possibly empty) list of the identifiers (Key objects) of the next triggers to be fired.
- Throws:
java.sql.SQLException
-
selectTriggerToAcquire
java.util.List<TriggerKey> selectTriggerToAcquire(java.sql.Connection conn, long noLaterThan, long noEarlierThan, int maxCount) throws java.sql.SQLException
Select the next trigger which will fire to fire between the two given timestamps in ascending order of fire time, and then descending by priority.
- Parameters:
conn- the DB ConnectionnoLaterThan- highest value ofgetNextFireTime()of the triggers (exclusive)noEarlierThan- highest value ofgetNextFireTime()of the triggers (inclusive)maxCount- maximum number of trigger keys allow to acquired in the returning list.- Returns:
- A (never null, possibly empty) list of the identifiers (Key objects) of the next triggers to be fired.
- Throws:
java.sql.SQLException
-
insertFiredTrigger
int insertFiredTrigger(java.sql.Connection conn, OperableTrigger trigger, java.lang.String state, JobDetail jobDetail) throws java.sql.SQLExceptionInsert a fired trigger.
- Parameters:
conn- the DB Connectiontrigger- the triggerstate- the state that the trigger should be stored in- Returns:
- the number of rows inserted
- Throws:
java.sql.SQLException
-
updateFiredTrigger
int updateFiredTrigger(java.sql.Connection conn, OperableTrigger trigger, java.lang.String state, JobDetail jobDetail) throws java.sql.SQLExceptionUpdate a fired trigger record. Will update the fields "firing instance", "fire time", and "state".
- Parameters:
conn- the DB Connectiontrigger- the triggerstate- the state that the trigger should be stored in- Returns:
- the number of rows inserted
- Throws:
java.sql.SQLException
-
selectFiredTriggerRecords
java.util.List<FiredTriggerRecord> selectFiredTriggerRecords(java.sql.Connection conn, java.lang.String triggerName, java.lang.String groupName) throws java.sql.SQLException
Select the states of all fired-trigger records for a given trigger, or trigger group if trigger name is
null.- Returns:
- a List of FiredTriggerRecord objects.
- Throws:
java.sql.SQLException
-
selectFiredTriggerRecordsByJob
java.util.List<FiredTriggerRecord> selectFiredTriggerRecordsByJob(java.sql.Connection conn, java.lang.String jobName, java.lang.String groupName) throws java.sql.SQLException
Select the states of all fired-trigger records for a given job, or job group if job name is
null.- Returns:
- a List of FiredTriggerRecord objects.
- Throws:
java.sql.SQLException
-
selectInstancesFiredTriggerRecords
java.util.List<FiredTriggerRecord> selectInstancesFiredTriggerRecords(java.sql.Connection conn, java.lang.String instanceName) throws java.sql.SQLException
Select the states of all fired-trigger records for a given scheduler instance.
- Returns:
- a List of FiredTriggerRecord objects.
- Throws:
java.sql.SQLException
-
selectFiredTriggerInstanceNames
java.util.Set<java.lang.String> selectFiredTriggerInstanceNames(java.sql.Connection conn) throws java.sql.SQLExceptionSelect the distinct instance names of all fired-trigger records.
This is useful when trying to identify orphaned fired triggers (a fired trigger without a scheduler state record.)
- Returns:
- a Set of String objects.
- Throws:
java.sql.SQLException
-
deleteFiredTrigger
int deleteFiredTrigger(java.sql.Connection conn, java.lang.String entryId) throws java.sql.SQLExceptionDelete a fired trigger.
- Parameters:
conn- the DB ConnectionentryId- the fired trigger entry to delete- Returns:
- the number of rows deleted
- Throws:
java.sql.SQLException
-
selectJobExecutionCount
int selectJobExecutionCount(java.sql.Connection conn, JobKey jobKey) throws java.sql.SQLExceptionGet the number instances of the identified job currently executing.
- Parameters:
conn- the DB Connection- Returns:
- the number instances of the identified job currently executing.
- Throws:
java.sql.SQLException
-
insertSchedulerState
int insertSchedulerState(java.sql.Connection conn, java.lang.String instanceId, long checkInTime, long interval) throws java.sql.SQLExceptionInsert a scheduler-instance state record.
- Parameters:
conn- the DB Connection- Returns:
- the number of inserted rows.
- Throws:
java.sql.SQLException
-
deleteSchedulerState
int deleteSchedulerState(java.sql.Connection conn, java.lang.String instanceId) throws java.sql.SQLExceptionDelete a scheduler-instance state record.
- Parameters:
conn- the DB Connection- Returns:
- the number of deleted rows.
- Throws:
java.sql.SQLException
-
updateSchedulerState
int updateSchedulerState(java.sql.Connection conn, java.lang.String instanceId, long checkInTime) throws java.sql.SQLExceptionUpdate a scheduler-instance state record.
- Parameters:
conn- the DB Connection- Returns:
- the number of updated rows.
- Throws:
java.sql.SQLException
-
selectSchedulerStateRecords
java.util.List<SchedulerStateRecord> selectSchedulerStateRecords(java.sql.Connection conn, java.lang.String instanceId) throws java.sql.SQLException
A List of all current
SchedulerStateRecords.If instanceId is not null, then only the record for the identified instance will be returned.
- Parameters:
conn- the DB Connection- Throws:
java.sql.SQLException
-
clearData
void clearData(java.sql.Connection conn) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
-