public class StdJDBCDelegate extends java.lang.Object implements StdJDBCConstants
This is meant to be an abstract base class for most, if not all,
implementations. Subclasses should override only those methods that need
special handling for the DBMS driver in question.
DriverDelegate
COUNT_MISFIRED_TRIGGERS_IN_STATES, DELETE_BLOB_TRIGGER, DELETE_CALENDAR, DELETE_CRON_TRIGGER, DELETE_FIRED_TRIGGER, DELETE_FIRED_TRIGGERS, DELETE_INSTANCES_FIRED_TRIGGERS, DELETE_JOB_DETAIL, DELETE_JOB_LISTENERS, DELETE_NO_RECOVERY_FIRED_TRIGGERS, DELETE_PAUSED_TRIGGER_GROUP, DELETE_PAUSED_TRIGGER_GROUPS, DELETE_SCHEDULER_STATE, DELETE_SIMPLE_TRIGGER, DELETE_TRIGGER, DELETE_TRIGGER_LISTENERS, DELETE_VOLATILE_FIRED_TRIGGERS, INSERT_BLOB_TRIGGER, INSERT_CALENDAR, INSERT_CRON_TRIGGER, INSERT_FIRED_TRIGGER, INSERT_JOB_DETAIL, INSERT_JOB_LISTENER, INSERT_PAUSED_TRIGGER_GROUP, INSERT_SCHEDULER_STATE, INSERT_SIMPLE_TRIGGER, INSERT_TRIGGER, INSERT_TRIGGER_LISTENER, SELECT_BLOB_TRIGGER, SELECT_CALENDAR, SELECT_CALENDAR_EXISTENCE, SELECT_CALENDARS, SELECT_CRON_TRIGGER, SELECT_FIRED_TRIGGER, SELECT_FIRED_TRIGGER_GROUP, SELECT_FIRED_TRIGGER_INSTANCE_NAMES, SELECT_FIRED_TRIGGERS, SELECT_FIRED_TRIGGERS_OF_JOB, SELECT_FIRED_TRIGGERS_OF_JOB_GROUP, SELECT_INSTANCES_FIRED_TRIGGERS, SELECT_INSTANCES_RECOVERABLE_FIRED_TRIGGERS, SELECT_JOB_DETAIL, SELECT_JOB_EXECUTION_COUNT, SELECT_JOB_EXISTENCE, SELECT_JOB_FOR_TRIGGER, SELECT_JOB_GROUPS, SELECT_JOB_LISTENERS, SELECT_JOB_STATEFUL, SELECT_JOBS_IN_GROUP, SELECT_MISFIRED_TRIGGERS, SELECT_MISFIRED_TRIGGERS_IN_GROUP_IN_STATE, SELECT_MISFIRED_TRIGGERS_IN_STATE, SELECT_MISFIRED_TRIGGERS_IN_STATES, SELECT_NEXT_FIRE_TIME, SELECT_NEXT_TRIGGER_TO_ACQUIRE, SELECT_NUM_CALENDARS, SELECT_NUM_JOBS, SELECT_NUM_TRIGGERS, SELECT_NUM_TRIGGERS_FOR_JOB, SELECT_NUM_TRIGGERS_IN_GROUP, SELECT_PAUSED_TRIGGER_GROUP, SELECT_PAUSED_TRIGGER_GROUPS, SELECT_REFERENCED_CALENDAR, SELECT_SCHEDULER_STATE, SELECT_SCHEDULER_STATES, SELECT_SIMPLE_TRIGGER, SELECT_STATEFUL_JOBS_OF_TRIGGER_GROUP, SELECT_TRIGGER, SELECT_TRIGGER_DATA, SELECT_TRIGGER_EXISTENCE, SELECT_TRIGGER_FOR_FIRE_TIME, SELECT_TRIGGER_GROUPS, SELECT_TRIGGER_LISTENERS, SELECT_TRIGGER_STATE, SELECT_TRIGGER_STATUS, SELECT_TRIGGERS_FOR_CALENDAR, SELECT_TRIGGERS_FOR_JOB, SELECT_TRIGGERS_IN_GROUP, SELECT_TRIGGERS_IN_STATE, SELECT_VOLATILE_JOBS, SELECT_VOLATILE_TRIGGERS, TABLE_PREFIX_SUBST, UPDATE_BLOB_TRIGGER, UPDATE_CALENDAR, UPDATE_CRON_TRIGGER, UPDATE_INSTANCES_FIRED_TRIGGER_STATE, UPDATE_JOB_DATA, UPDATE_JOB_DETAIL, UPDATE_JOB_TRIGGER_STATES, UPDATE_JOB_TRIGGER_STATES_FROM_OTHER_STATE, UPDATE_SCHEDULER_STATE, UPDATE_SIMPLE_TRIGGER, UPDATE_TRIGGER, UPDATE_TRIGGER_GROUP_STATE, UPDATE_TRIGGER_GROUP_STATE_FROM_STATE, UPDATE_TRIGGER_GROUP_STATE_FROM_STATES, UPDATE_TRIGGER_SKIP_DATA, UPDATE_TRIGGER_STATE, UPDATE_TRIGGER_STATE_FROM_OTHER_STATES_BEFORE_TIME, UPDATE_TRIGGER_STATE_FROM_STATE, UPDATE_TRIGGER_STATE_FROM_STATES, UPDATE_TRIGGER_STATES_FROM_OTHER_STATES
ALIAS_COL_NEXT_FIRE_TIME, ALL_GROUPS_PAUSED, COL_BLOB, COL_CALENDAR, COL_CALENDAR_NAME, COL_CHECKIN_INTERVAL, COL_CRON_EXPRESSION, COL_DESCRIPTION, COL_END_TIME, COL_ENTRY_ID, COL_ENTRY_STATE, COL_FIRED_TIME, COL_INSTANCE_NAME, COL_IS_DURABLE, COL_IS_STATEFUL, COL_IS_VOLATILE, COL_JOB_CLASS, COL_JOB_DATAMAP, COL_JOB_GROUP, COL_JOB_LISTENER, COL_JOB_NAME, COL_LAST_CHECKIN_TIME, COL_LOCK_NAME, COL_MISFIRE_INSTRUCTION, COL_NEXT_FIRE_TIME, COL_PREV_FIRE_TIME, COL_PRIORITY, COL_REPEAT_COUNT, COL_REPEAT_INTERVAL, COL_REQUESTS_RECOVERY, COL_START_TIME, COL_TIME_ZONE_ID, COL_TIMES_TRIGGERED, COL_TRIGGER_GROUP, COL_TRIGGER_LISTENER, COL_TRIGGER_NAME, COL_TRIGGER_STATE, COL_TRIGGER_TYPE, DEFAULT_TABLE_PREFIX, STATE_ACQUIRED, STATE_BLOCKED, STATE_COMPLETE, STATE_DELETED, STATE_ERROR, STATE_EXECUTING, STATE_MISFIRED, STATE_PAUSED, STATE_PAUSED_BLOCKED, STATE_WAITING, TABLE_BLOB_TRIGGERS, TABLE_CALENDARS, TABLE_CRON_TRIGGERS, TABLE_FIRED_TRIGGERS, TABLE_JOB_DETAILS, TABLE_JOB_LISTENERS, TABLE_LOCKS, TABLE_PAUSED_TRIGGERS, TABLE_SCHEDULER_STATE, TABLE_SIMPLE_TRIGGERS, TABLE_TRIGGER_LISTENERS, TABLE_TRIGGERS, TTYPE_BLOB, TTYPE_CRON, TTYPE_SIMPLE
Constructor and Description |
---|
StdJDBCDelegate(org.apache.commons.logging.Log logger,
java.lang.String tablePrefix,
java.lang.String instanceId)
Create new StdJDBCDelegate instance.
|
StdJDBCDelegate(org.apache.commons.logging.Log logger,
java.lang.String tablePrefix,
java.lang.String instanceId,
java.lang.Boolean useProperties)
Create new StdJDBCDelegate instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
calendarExists(java.sql.Connection conn,
java.lang.String calendarName)
Check whether or not a calendar exists.
|
boolean |
calendarIsReferenced(java.sql.Connection conn,
java.lang.String calendarName)
Check whether or not a calendar is referenced by any triggers.
|
int |
countMisfiredTriggersInStates(java.sql.Connection conn,
java.lang.String state1,
java.lang.String state2,
long ts)
Get the number of triggers in the given states that have
misfired - according to the given timestamp.
|
int |
deleteAllPausedTriggerGroups(java.sql.Connection conn) |
int |
deleteBlobTrigger(java.sql.Connection conn,
java.lang.String triggerName,
java.lang.String groupName)
Delete the cron trigger data for a trigger.
|
int |
deleteCalendar(java.sql.Connection conn,
java.lang.String calendarName)
Delete a calendar.
|
int |
deleteCronTrigger(java.sql.Connection conn,
java.lang.String triggerName,
java.lang.String groupName)
Delete the cron trigger data for a trigger.
|
int |
deleteFiredTrigger(java.sql.Connection conn,
java.lang.String entryId)
Delete a fired trigger.
|
int |
deleteFiredTriggers(java.sql.Connection conn)
Delete all fired triggers.
|
int |
deleteFiredTriggers(java.sql.Connection conn,
java.lang.String instanceId)
Delete all fired triggers of the given instance.
|
int |
deleteJobDetail(java.sql.Connection conn,
java.lang.String jobName,
java.lang.String groupName)
Delete the job detail record for the given job.
|
int |
deleteJobListeners(java.sql.Connection conn,
java.lang.String jobName,
java.lang.String groupName)
Delete all job listeners for the given job.
|
int |
deletePausedTriggerGroup(java.sql.Connection conn,
java.lang.String groupName) |
int |
deleteSchedulerState(java.sql.Connection conn,
java.lang.String instanceId)
Delete a scheduler-instance state record.
|
int |
deleteSimpleTrigger(java.sql.Connection conn,
java.lang.String triggerName,
java.lang.String groupName)
Delete the simple trigger data for a trigger.
|
int |
deleteTrigger(java.sql.Connection conn,
java.lang.String triggerName,
java.lang.String groupName)
Delete the base trigger data for a trigger.
|
int |
deleteTriggerListeners(java.sql.Connection conn,
java.lang.String triggerName,
java.lang.String groupName)
Delete all of the listeners associated with a given trigger.
|
int |
deleteVolatileFiredTriggers(java.sql.Connection conn)
Delete all volatile fired triggers.
|
int |
insertBlobTrigger(java.sql.Connection conn,
Trigger trigger)
Insert the blob trigger data.
|
int |
insertCalendar(java.sql.Connection conn,
java.lang.String calendarName,
Calendar calendar)
Insert a new calendar.
|
int |
insertCronTrigger(java.sql.Connection conn,
CronTrigger trigger)
Insert the cron trigger data.
|
int |
insertFiredTrigger(java.sql.Connection conn,
Trigger trigger,
java.lang.String state,
JobDetail job)
Insert a fired trigger.
|
int |
insertJobDetail(java.sql.Connection conn,
JobDetail job)
Insert the job detail record.
|
int |
insertJobListener(java.sql.Connection conn,
JobDetail job,
java.lang.String listener)
Associate a listener with a job.
|
int |
insertPausedTriggerGroup(java.sql.Connection conn,
java.lang.String groupName) |
int |
insertSchedulerState(java.sql.Connection conn,
java.lang.String instanceId,
long checkInTime,
long interval)
Insert a scheduler-instance state record.
|
int |
insertSimpleTrigger(java.sql.Connection conn,
SimpleTrigger trigger)
Insert the simple trigger data.
|
int |
insertTrigger(java.sql.Connection conn,
Trigger trigger,
java.lang.String state,
JobDetail jobDetail)
Insert the base trigger data.
|
int |
insertTriggerListener(java.sql.Connection conn,
Trigger trigger,
java.lang.String listener)
Associate a listener with the given trigger.
|
boolean |
isExistingTriggerGroup(java.sql.Connection conn,
java.lang.String groupName) |
boolean |
isJobStateful(java.sql.Connection conn,
java.lang.String jobName,
java.lang.String groupName)
Check whether or not the given job is stateful.
|
boolean |
isTriggerGroupPaused(java.sql.Connection conn,
java.lang.String groupName) |
boolean |
jobExists(java.sql.Connection conn,
java.lang.String jobName,
java.lang.String groupName)
Check whether or not the given job exists.
|
Calendar |
selectCalendar(java.sql.Connection conn,
java.lang.String calendarName)
Select a calendar.
|
java.lang.String[] |
selectCalendars(java.sql.Connection conn)
Select all of the stored calendars.
|
java.util.Set |
selectFiredTriggerInstanceNames(java.sql.Connection conn)
Select the distinct instance names of all fired-trigger records.
|
java.util.List |
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 is
null . |
java.util.List |
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 is
null . |
java.util.List |
selectInstancesFiredTriggerRecords(java.sql.Connection conn,
java.lang.String instanceName)
Select the states of all fired-trigger records for a given scheduler
instance.
|
JobDetail |
selectJobDetail(java.sql.Connection conn,
java.lang.String jobName,
java.lang.String groupName,
ClassLoadHelper loadHelper)
Select the JobDetail object for a given job name / group name.
|
int |
selectJobExecutionCount(java.sql.Connection conn,
java.lang.String jobName,
java.lang.String jobGroup)
Get the number instances of the identified job currently executing.
|
JobDetail |
selectJobForTrigger(java.sql.Connection conn,
java.lang.String triggerName,
java.lang.String groupName,
ClassLoadHelper loadHelper)
Select the job to which the trigger is associated.
|
java.lang.String[] |
selectJobGroups(java.sql.Connection conn)
Select all of the job group names that are stored.
|
java.lang.String[] |
selectJobListeners(java.sql.Connection conn,
java.lang.String jobName,
java.lang.String groupName)
Get all of the listeners for a given job.
|
java.lang.String[] |
selectJobsInGroup(java.sql.Connection conn,
java.lang.String groupName)
Select all of the jobs contained in a given group.
|
Key[] |
selectMisfiredTriggers(java.sql.Connection conn,
long ts)
Get the names of all of the triggers that have misfired.
|
Key[] |
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.
|
Key[] |
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.
|
boolean |
selectMisfiredTriggersInStates(java.sql.Connection conn,
java.lang.String state1,
java.lang.String state2,
long ts,
int count,
java.util.List resultList)
Get the names of all of the triggers in the given states that have
misfired - according to the given timestamp.
|
long |
selectNextFireTime(java.sql.Connection conn)
Deprecated.
Does not account for misfires.
|
int |
selectNumCalendars(java.sql.Connection conn)
Select the total number of calendars stored.
|
int |
selectNumJobs(java.sql.Connection conn)
Select the total number of jobs stored.
|
int |
selectNumTriggers(java.sql.Connection conn)
Select the total number of triggers stored.
|
int |
selectNumTriggersForJob(java.sql.Connection conn,
java.lang.String jobName,
java.lang.String groupName)
Select the number of triggers associated with a given job.
|
java.util.Set |
selectPausedTriggerGroups(java.sql.Connection conn) |
java.util.List |
selectSchedulerStateRecords(java.sql.Connection conn,
java.lang.String instanceId)
A List of all current
SchedulerStateRecords . |
java.util.List |
selectStatefulJobsOfTriggerGroup(java.sql.Connection conn,
java.lang.String groupName)
Select the stateful jobs which are referenced by triggers in the given
trigger group.
|
Trigger |
selectTrigger(java.sql.Connection conn,
java.lang.String triggerName,
java.lang.String groupName)
Select a trigger.
|
Key |
selectTriggerForFireTime(java.sql.Connection conn,
long fireTime)
Select the trigger that will be fired at the given fire time.
|
java.lang.String[] |
selectTriggerGroups(java.sql.Connection conn)
Select all of the trigger group names that are stored.
|
JobDataMap |
selectTriggerJobDataMap(java.sql.Connection conn,
java.lang.String triggerName,
java.lang.String groupName)
Select a trigger's JobDataMap.
|
java.lang.String[] |
selectTriggerListeners(java.sql.Connection conn,
java.lang.String triggerName,
java.lang.String groupName)
Select the listeners associated with a given trigger.
|
Key[] |
selectTriggerNamesForJob(java.sql.Connection conn,
java.lang.String jobName,
java.lang.String groupName)
Get the names of all of the triggers associated with the given job.
|
Trigger[] |
selectTriggersForCalendar(java.sql.Connection conn,
java.lang.String calName)
Select the triggers for a calendar
|
Trigger[] |
selectTriggersForJob(java.sql.Connection conn,
java.lang.String jobName,
java.lang.String groupName)
Select the triggers for a job
|
Trigger[] |
selectTriggersForRecoveringJobs(java.sql.Connection conn)
Select all of the triggers for jobs that are requesting recovery.
|
java.lang.String[] |
selectTriggersInGroup(java.sql.Connection conn,
java.lang.String groupName)
Select all of the triggers contained in a given group.
|
Key[] |
selectTriggersInState(java.sql.Connection conn,
java.lang.String state)
Select all of the triggers in a given state.
|
java.lang.String |
selectTriggerState(java.sql.Connection conn,
java.lang.String triggerName,
java.lang.String groupName)
Select a trigger' state value.
|
TriggerStatus |
selectTriggerStatus(java.sql.Connection conn,
java.lang.String triggerName,
java.lang.String groupName)
Select a trigger' status (state & next fire time).
|
java.util.List |
selectTriggerToAcquire(java.sql.Connection conn,
long noLaterThan,
long noEarlierThan)
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.
|
Key[] |
selectVolatileJobs(java.sql.Connection conn)
Get the names of all of the jobs that are volatile.
|
Key[] |
selectVolatileTriggers(java.sql.Connection conn)
Get the names of all of the triggers that are volatile.
|
boolean |
triggerExists(java.sql.Connection conn,
java.lang.String triggerName,
java.lang.String groupName)
Check whether or not a trigger exists.
|
int |
updateBlobTrigger(java.sql.Connection conn,
Trigger trigger)
Update the blob trigger data.
|
int |
updateCalendar(java.sql.Connection conn,
java.lang.String calendarName,
Calendar calendar)
Update a calendar.
|
int |
updateCronTrigger(java.sql.Connection conn,
CronTrigger trigger)
Update the cron trigger data.
|
int |
updateJobData(java.sql.Connection conn,
JobDetail job)
Update the job data map for the given job.
|
int |
updateJobDetail(java.sql.Connection conn,
JobDetail job)
Update the job detail record.
|
int |
updateSchedulerState(java.sql.Connection conn,
java.lang.String instanceId,
long checkInTime)
Update a scheduler-instance state record.
|
int |
updateSimpleTrigger(java.sql.Connection conn,
SimpleTrigger trigger)
Update the simple trigger data.
|
int |
updateTrigger(java.sql.Connection conn,
Trigger trigger,
java.lang.String state,
JobDetail jobDetail)
Update the base trigger data.
|
int |
updateTriggerGroupStateFromOtherState(java.sql.Connection conn,
java.lang.String groupName,
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.
|
int |
updateTriggerGroupStateFromOtherStates(java.sql.Connection conn,
java.lang.String groupName,
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.
|
int |
updateTriggerState(java.sql.Connection conn,
java.lang.String triggerName,
java.lang.String groupName,
java.lang.String state)
Update the state for a given trigger.
|
int |
updateTriggerStateFromOtherState(java.sql.Connection conn,
java.lang.String triggerName,
java.lang.String groupName,
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.
|
int |
updateTriggerStateFromOtherStates(java.sql.Connection conn,
java.lang.String triggerName,
java.lang.String groupName,
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.
|
int |
updateTriggerStateFromOtherStatesBeforeTime(java.sql.Connection conn,
java.lang.String newState,
java.lang.String oldState1,
java.lang.String oldState2,
long time)
Update the all triggers to the given new state, if they are in one of
the given old states AND its next fire time is before the given time.
|
int |
updateTriggerStatesForJob(java.sql.Connection conn,
java.lang.String jobName,
java.lang.String groupName,
java.lang.String state)
Update the states of all triggers associated with the given job.
|
int |
updateTriggerStatesForJobFromOtherState(java.sql.Connection conn,
java.lang.String jobName,
java.lang.String groupName,
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.
|
int |
updateTriggerStatesFromOtherStates(java.sql.Connection conn,
java.lang.String newState,
java.lang.String oldState1,
java.lang.String oldState2)
Insert the job detail record.
|
public StdJDBCDelegate(org.apache.commons.logging.Log logger, java.lang.String tablePrefix, java.lang.String instanceId)
Create new StdJDBCDelegate instance.
logger
- the logger to use during executiontablePrefix
- the prefix of all table namespublic StdJDBCDelegate(org.apache.commons.logging.Log logger, java.lang.String tablePrefix, java.lang.String instanceId, java.lang.Boolean useProperties)
Create new StdJDBCDelegate instance.
logger
- the logger to use during executiontablePrefix
- the prefix of all table namespublic int updateTriggerStatesFromOtherStates(java.sql.Connection conn, java.lang.String newState, java.lang.String oldState1, java.lang.String oldState2) throws java.sql.SQLException
Insert the job detail record.
conn
- the DB ConnectionnewState
- the new state for the triggersoldState1
- the first old state to updateoldState2
- the second old state to updatejava.sql.SQLException
public Key[] selectMisfiredTriggers(java.sql.Connection conn, long ts) throws java.sql.SQLException
Get the names of all of the triggers that have misfired.
conn
- the DB ConnectionKey
objectsjava.sql.SQLException
public Key[] selectTriggersInState(java.sql.Connection conn, java.lang.String state) throws java.sql.SQLException
Select all of the triggers in a given state.
conn
- the DB Connectionstate
- the state the triggers must be inKey
sjava.sql.SQLException
public Key[] 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.
conn
- the DB ConnectionKey
objectsjava.sql.SQLException
public boolean selectMisfiredTriggersInStates(java.sql.Connection conn, java.lang.String state1, java.lang.String state2, long ts, int count, java.util.List resultList) throws java.sql.SQLException
Get 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.
conn
- The DB Connectioncount
- The most misfired triggers to return, negative for allresultList
- Output parameter. A List of
Key
objects. Must not be null.java.sql.SQLException
public int countMisfiredTriggersInStates(java.sql.Connection conn, java.lang.String state1, java.lang.String state2, long ts) throws java.sql.SQLException
Get the number of triggers in the given states that have misfired - according to the given timestamp.
conn
- the DB Connectionjava.sql.SQLException
public Key[] 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.
conn
- the DB ConnectionKey
objectsjava.sql.SQLException
public Trigger[] 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_GROUP
In order to preserve the ordering of the triggers, the fire time will be
set from the COL_FIRED_TIME
column in the TABLE_FIRED_TRIGGERS
table. The caller is responsible for calling computeFirstFireTime
on each returned trigger. It is also up to the caller to insert the
returned triggers to ensure that they are fired.
conn
- the DB ConnectionTrigger
objectsjava.sql.SQLException
java.io.IOException
java.lang.ClassNotFoundException
public int deleteFiredTriggers(java.sql.Connection conn) throws java.sql.SQLException
Delete all fired triggers.
conn
- the DB Connectionjava.sql.SQLException
public int deleteFiredTriggers(java.sql.Connection conn, java.lang.String instanceId) throws java.sql.SQLException
Delete all fired triggers of the given instance.
conn
- the DB Connectionjava.sql.SQLException
public int insertJobDetail(java.sql.Connection conn, JobDetail job) throws java.io.IOException, java.sql.SQLException
Insert the job detail record.
conn
- the DB Connectionjob
- the job to insertjava.io.IOException
- if there were problems serializing the JobDataMapjava.sql.SQLException
public int updateJobDetail(java.sql.Connection conn, JobDetail job) throws java.io.IOException, java.sql.SQLException
Update the job detail record.
conn
- the DB Connectionjob
- the job to updatejava.io.IOException
- if there were problems serializing the JobDataMapjava.sql.SQLException
public Key[] selectTriggerNamesForJob(java.sql.Connection conn, java.lang.String jobName, java.lang.String groupName) throws java.sql.SQLException
Get the names of all of the triggers associated with the given job.
conn
- the DB ConnectionjobName
- the name of the jobgroupName
- the group containing the jobKey
objectsjava.sql.SQLException
public int deleteJobListeners(java.sql.Connection conn, java.lang.String jobName, java.lang.String groupName) throws java.sql.SQLException
Delete all job listeners for the given job.
conn
- the DB ConnectionjobName
- the name of the jobgroupName
- the group containing the jobjava.sql.SQLException
public int deleteJobDetail(java.sql.Connection conn, java.lang.String jobName, java.lang.String groupName) throws java.sql.SQLException
Delete the job detail record for the given job.
conn
- the DB ConnectionjobName
- the name of the jobgroupName
- the group containing the jobjava.sql.SQLException
public boolean isJobStateful(java.sql.Connection conn, java.lang.String jobName, java.lang.String groupName) throws java.sql.SQLException
Check whether or not the given job is stateful.
conn
- the DB ConnectionjobName
- the name of the jobgroupName
- the group containing the jobjava.sql.SQLException
public boolean jobExists(java.sql.Connection conn, java.lang.String jobName, java.lang.String groupName) throws java.sql.SQLException
Check whether or not the given job exists.
conn
- the DB ConnectionjobName
- the name of the jobgroupName
- the group containing the jobjava.sql.SQLException
public int updateJobData(java.sql.Connection conn, JobDetail job) throws java.io.IOException, java.sql.SQLException
Update the job data map for the given job.
conn
- the DB Connectionjob
- the job to updatejava.io.IOException
- if there were problems serializing the JobDataMapjava.sql.SQLException
public int insertJobListener(java.sql.Connection conn, JobDetail job, java.lang.String listener) throws java.sql.SQLException
Associate a listener with a job.
conn
- the DB Connectionjob
- the job to associate with the listenerlistener
- the listener to insertjava.sql.SQLException
public java.lang.String[] selectJobListeners(java.sql.Connection conn, java.lang.String jobName, java.lang.String groupName) throws java.sql.SQLException
Get all of the listeners for a given job.
conn
- the DB ConnectionjobName
- the job name whose listeners are wantedgroupName
- the group containing the jobString
listener namesjava.sql.SQLException
public JobDetail selectJobDetail(java.sql.Connection conn, java.lang.String jobName, java.lang.String groupName, ClassLoadHelper loadHelper) throws java.lang.ClassNotFoundException, java.io.IOException, java.sql.SQLException
Select the JobDetail object for a given job name / group name.
conn
- the DB ConnectionjobName
- the job name whose listeners are wantedgroupName
- the group containing the jobjava.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
public int selectNumJobs(java.sql.Connection conn) throws java.sql.SQLException
Select the total number of jobs stored.
conn
- the DB Connectionjava.sql.SQLException
public java.lang.String[] selectJobGroups(java.sql.Connection conn) throws java.sql.SQLException
Select all of the job group names that are stored.
conn
- the DB ConnectionString
group namesjava.sql.SQLException
public java.lang.String[] selectJobsInGroup(java.sql.Connection conn, java.lang.String groupName) throws java.sql.SQLException
Select all of the jobs contained in a given group.
conn
- the DB ConnectiongroupName
- the group containing the jobsString
job namesjava.sql.SQLException
public int insertTrigger(java.sql.Connection conn, Trigger trigger, java.lang.String state, JobDetail jobDetail) throws java.sql.SQLException, java.io.IOException
Insert the base trigger data.
conn
- the DB Connectiontrigger
- the trigger to insertstate
- the state that the trigger should be stored injava.sql.SQLException
java.io.IOException
public int insertSimpleTrigger(java.sql.Connection conn, SimpleTrigger trigger) throws java.sql.SQLException
Insert the simple trigger data.
conn
- the DB Connectiontrigger
- the trigger to insertjava.sql.SQLException
public int insertCronTrigger(java.sql.Connection conn, CronTrigger trigger) throws java.sql.SQLException
Insert the cron trigger data.
conn
- the DB Connectiontrigger
- the trigger to insertjava.sql.SQLException
public int insertBlobTrigger(java.sql.Connection conn, Trigger trigger) throws java.sql.SQLException, java.io.IOException
Insert the blob trigger data.
conn
- the DB Connectiontrigger
- the trigger to insertjava.sql.SQLException
java.io.IOException
public int updateTrigger(java.sql.Connection conn, Trigger trigger, java.lang.String state, JobDetail jobDetail) throws java.sql.SQLException, java.io.IOException
Update the base trigger data.
conn
- the DB Connectiontrigger
- the trigger to insertstate
- the state that the trigger should be stored injava.sql.SQLException
java.io.IOException
public int updateSimpleTrigger(java.sql.Connection conn, SimpleTrigger trigger) throws java.sql.SQLException
Update the simple trigger data.
conn
- the DB Connectiontrigger
- the trigger to insertjava.sql.SQLException
public int updateCronTrigger(java.sql.Connection conn, CronTrigger trigger) throws java.sql.SQLException
Update the cron trigger data.
conn
- the DB Connectiontrigger
- the trigger to insertjava.sql.SQLException
public int updateBlobTrigger(java.sql.Connection conn, Trigger trigger) throws java.sql.SQLException, java.io.IOException
Update the blob trigger data.
conn
- the DB Connectiontrigger
- the trigger to insertjava.sql.SQLException
java.io.IOException
public boolean triggerExists(java.sql.Connection conn, java.lang.String triggerName, java.lang.String groupName) throws java.sql.SQLException
Check whether or not a trigger exists.
conn
- the DB ConnectiontriggerName
- the name of the triggergroupName
- the group containing the triggerjava.sql.SQLException
public int updateTriggerState(java.sql.Connection conn, java.lang.String triggerName, java.lang.String groupName, java.lang.String state) throws java.sql.SQLException
Update the state for a given trigger.
conn
- the DB ConnectiontriggerName
- the name of the triggergroupName
- the group containing the triggerstate
- the new state for the triggerjava.sql.SQLException
public int updateTriggerStateFromOtherStates(java.sql.Connection conn, java.lang.String triggerName, java.lang.String groupName, java.lang.String newState, java.lang.String oldState1, java.lang.String oldState2, java.lang.String oldState3) throws java.sql.SQLException
Update the given trigger to the given new state, if it is one of the given old states.
conn
- the DB connectiontriggerName
- the name of the triggergroupName
- the group containing the triggernewState
- 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 injava.sql.SQLException
public int updateTriggerStateFromOtherStatesBeforeTime(java.sql.Connection conn, java.lang.String newState, java.lang.String oldState1, java.lang.String oldState2, long time) throws java.sql.SQLException
Update the all triggers to the given new state, if they are in one of the given old states AND its next fire time is before the given time.
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 intime
- the time before which the trigger's next fire time must bejava.sql.SQLException
public int updateTriggerGroupStateFromOtherStates(java.sql.Connection conn, java.lang.String groupName, java.lang.String newState, java.lang.String oldState1, java.lang.String oldState2, java.lang.String oldState3) throws java.sql.SQLException
Update all triggers in the given group to the given new state, if they are in one of the given old states.
conn
- the DB connectiongroupName
- the group containing the triggernewState
- 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 injava.sql.SQLException
public int updateTriggerStateFromOtherState(java.sql.Connection conn, java.lang.String triggerName, java.lang.String groupName, java.lang.String newState, java.lang.String oldState) throws java.sql.SQLException
Update the given trigger to the given new state, if it is in the given old state.
conn
- the DB connectiontriggerName
- the name of the triggergroupName
- the group containing the triggernewState
- the new state for the triggeroldState
- the old state the trigger must be injava.sql.SQLException
public int updateTriggerGroupStateFromOtherState(java.sql.Connection conn, java.lang.String groupName, java.lang.String newState, java.lang.String oldState) throws java.sql.SQLException
Update all of the triggers of the given group to the given new state, if they are in the given old state.
conn
- the DB connectiongroupName
- the group containing the triggersnewState
- the new state for the trigger groupoldState
- the old state the triggers must be injava.sql.SQLException
public int updateTriggerStatesForJob(java.sql.Connection conn, java.lang.String jobName, java.lang.String groupName, java.lang.String state) throws java.sql.SQLException
Update the states of all triggers associated with the given job.
conn
- the DB ConnectionjobName
- the name of the jobgroupName
- the group containing the jobstate
- the new state for the triggersjava.sql.SQLException
public int updateTriggerStatesForJobFromOtherState(java.sql.Connection conn, java.lang.String jobName, java.lang.String groupName, java.lang.String state, java.lang.String oldState) throws java.sql.SQLException
Update the states of any triggers associated with the given job, that are the given current state.
conn
- the DB ConnectionjobName
- the name of the jobgroupName
- the group containing the jobstate
- the new state for the triggersoldState
- the old state of the triggersjava.sql.SQLException
public int deleteTriggerListeners(java.sql.Connection conn, java.lang.String triggerName, java.lang.String groupName) throws java.sql.SQLException
Delete all of the listeners associated with a given trigger.
conn
- the DB ConnectiontriggerName
- the name of the trigger whose listeners will be deletedgroupName
- the name of the group containing the triggerjava.sql.SQLException
public int insertTriggerListener(java.sql.Connection conn, Trigger trigger, java.lang.String listener) throws java.sql.SQLException
Associate a listener with the given trigger.
conn
- the DB Connectiontrigger
- the triggerlistener
- the name of the listener to associate with the triggerjava.sql.SQLException
public java.lang.String[] selectTriggerListeners(java.sql.Connection conn, java.lang.String triggerName, java.lang.String groupName) throws java.sql.SQLException
Select the listeners associated with a given trigger.
conn
- the DB ConnectiontriggerName
- the name of the triggergroupName
- the group containing the triggerString
trigger listener namesjava.sql.SQLException
public int deleteSimpleTrigger(java.sql.Connection conn, java.lang.String triggerName, java.lang.String groupName) throws java.sql.SQLException
Delete the simple trigger data for a trigger.
conn
- the DB ConnectiontriggerName
- the name of the triggergroupName
- the group containing the triggerjava.sql.SQLException
public int deleteCronTrigger(java.sql.Connection conn, java.lang.String triggerName, java.lang.String groupName) throws java.sql.SQLException
Delete the cron trigger data for a trigger.
conn
- the DB ConnectiontriggerName
- the name of the triggergroupName
- the group containing the triggerjava.sql.SQLException
public int deleteBlobTrigger(java.sql.Connection conn, java.lang.String triggerName, java.lang.String groupName) throws java.sql.SQLException
Delete the cron trigger data for a trigger.
conn
- the DB ConnectiontriggerName
- the name of the triggergroupName
- the group containing the triggerjava.sql.SQLException
public int deleteTrigger(java.sql.Connection conn, java.lang.String triggerName, java.lang.String groupName) throws java.sql.SQLException
Delete the base trigger data for a trigger.
conn
- the DB ConnectiontriggerName
- the name of the triggergroupName
- the group containing the triggerjava.sql.SQLException
public int selectNumTriggersForJob(java.sql.Connection conn, java.lang.String jobName, java.lang.String groupName) throws java.sql.SQLException
Select the number of triggers associated with a given job.
conn
- the DB ConnectionjobName
- the name of the jobgroupName
- the group containing the jobjava.sql.SQLException
public JobDetail selectJobForTrigger(java.sql.Connection conn, java.lang.String triggerName, java.lang.String groupName, ClassLoadHelper loadHelper) throws java.lang.ClassNotFoundException, java.sql.SQLException
Select the job to which the trigger is associated.
conn
- the DB ConnectiontriggerName
- the name of the triggergroupName
- the group containing the triggerJobDetail
object
associated with the given triggerjava.sql.SQLException
java.lang.ClassNotFoundException
public Trigger[] selectTriggersForJob(java.sql.Connection conn, java.lang.String jobName, java.lang.String groupName) throws java.sql.SQLException, java.lang.ClassNotFoundException, java.io.IOException
Select the triggers for a job
conn
- the DB ConnectionjobName
- the name of the triggergroupName
- the group containing the trigger(@link org.quartz.Trigger)
objects
associated with a given job.java.sql.SQLException
java.lang.ClassNotFoundException
java.io.IOException
public Trigger[] selectTriggersForCalendar(java.sql.Connection conn, java.lang.String calName) throws java.sql.SQLException, java.lang.ClassNotFoundException, java.io.IOException
Select the triggers for a calendar
conn
- the DB ConnectioncalName
- the name of the calendar(@link org.quartz.Trigger)
objects
associated with the given calendar.java.sql.SQLException
java.lang.ClassNotFoundException
java.io.IOException
public java.util.List selectStatefulJobsOfTriggerGroup(java.sql.Connection conn, java.lang.String groupName) throws java.sql.SQLException
Select the stateful jobs which are referenced by triggers in the given trigger group.
conn
- the DB ConnectiongroupName
- the trigger groupjava.sql.SQLException
public Trigger selectTrigger(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.
conn
- the DB ConnectiontriggerName
- the name of the triggergroupName
- the group containing the triggerTrigger
objectjava.sql.SQLException
java.lang.ClassNotFoundException
java.io.IOException
public 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.
conn
- the DB ConnectiontriggerName
- the name of the triggergroupName
- the group containing the triggerJobDataMap
of the Trigger,
never null, but possibly empty.java.sql.SQLException
java.lang.ClassNotFoundException
java.io.IOException
public java.lang.String selectTriggerState(java.sql.Connection conn, java.lang.String triggerName, java.lang.String groupName) throws java.sql.SQLException
Select a trigger' state value.
conn
- the DB ConnectiontriggerName
- the name of the triggergroupName
- the group containing the triggerTrigger
objectjava.sql.SQLException
public TriggerStatus selectTriggerStatus(java.sql.Connection conn, java.lang.String triggerName, java.lang.String groupName) throws java.sql.SQLException
Select a trigger' status (state & next fire time).
conn
- the DB ConnectiontriggerName
- the name of the triggergroupName
- the group containing the triggerTriggerStatus
object, or nulljava.sql.SQLException
public int selectNumTriggers(java.sql.Connection conn) throws java.sql.SQLException
Select the total number of triggers stored.
conn
- the DB Connectionjava.sql.SQLException
public java.lang.String[] selectTriggerGroups(java.sql.Connection conn) throws java.sql.SQLException
Select all of the trigger group names that are stored.
conn
- the DB ConnectionString
group namesjava.sql.SQLException
public java.lang.String[] selectTriggersInGroup(java.sql.Connection conn, java.lang.String groupName) throws java.sql.SQLException
Select all of the triggers contained in a given group.
conn
- the DB ConnectiongroupName
- the group containing the triggersString
trigger namesjava.sql.SQLException
public int insertPausedTriggerGroup(java.sql.Connection conn, java.lang.String groupName) throws java.sql.SQLException
java.sql.SQLException
public int deletePausedTriggerGroup(java.sql.Connection conn, java.lang.String groupName) throws java.sql.SQLException
java.sql.SQLException
public int deleteAllPausedTriggerGroups(java.sql.Connection conn) throws java.sql.SQLException
java.sql.SQLException
public boolean isTriggerGroupPaused(java.sql.Connection conn, java.lang.String groupName) throws java.sql.SQLException
java.sql.SQLException
public boolean isExistingTriggerGroup(java.sql.Connection conn, java.lang.String groupName) throws java.sql.SQLException
java.sql.SQLException
public int insertCalendar(java.sql.Connection conn, java.lang.String calendarName, Calendar calendar) throws java.io.IOException, java.sql.SQLException
Insert a new calendar.
conn
- the DB ConnectioncalendarName
- the name for the new calendarcalendar
- the calendarjava.io.IOException
- if there were problems serializing the calendarjava.sql.SQLException
public int updateCalendar(java.sql.Connection conn, java.lang.String calendarName, Calendar calendar) throws java.io.IOException, java.sql.SQLException
Update a calendar.
conn
- the DB ConnectioncalendarName
- the name for the new calendarcalendar
- the calendarjava.io.IOException
- if there were problems serializing the calendarjava.sql.SQLException
public boolean calendarExists(java.sql.Connection conn, java.lang.String calendarName) throws java.sql.SQLException
Check whether or not a calendar exists.
conn
- the DB ConnectioncalendarName
- the name of the calendarjava.sql.SQLException
public Calendar selectCalendar(java.sql.Connection conn, java.lang.String calendarName) throws java.lang.ClassNotFoundException, java.io.IOException, java.sql.SQLException
Select a calendar.
conn
- the DB ConnectioncalendarName
- the name of the calendarjava.lang.ClassNotFoundException
- if a class found during deserialization cannot be found be
foundjava.io.IOException
- if there were problems deserializing the calendarjava.sql.SQLException
public boolean calendarIsReferenced(java.sql.Connection conn, java.lang.String calendarName) throws java.sql.SQLException
Check whether or not a calendar is referenced by any triggers.
conn
- the DB ConnectioncalendarName
- the name of the calendarjava.sql.SQLException
public int deleteCalendar(java.sql.Connection conn, java.lang.String calendarName) throws java.sql.SQLException
Delete a calendar.
conn
- the DB ConnectioncalendarName
- the name of the triggerjava.sql.SQLException
public int selectNumCalendars(java.sql.Connection conn) throws java.sql.SQLException
Select the total number of calendars stored.
conn
- the DB Connectionjava.sql.SQLException
public java.lang.String[] selectCalendars(java.sql.Connection conn) throws java.sql.SQLException
Select all of the stored calendars.
conn
- the DB ConnectionString
calendar namesjava.sql.SQLException
public long selectNextFireTime(java.sql.Connection conn) throws java.sql.SQLException
Select the next time that a trigger will be fired.
conn
- the DB Connectionjava.sql.SQLException
public Key selectTriggerForFireTime(java.sql.Connection conn, long fireTime) throws java.sql.SQLException
Select the trigger that will be fired at the given fire time.
conn
- the DB ConnectionfireTime
- the time that the trigger will be firedKey
representing the
trigger that will be fired at the given fire time, or null if no
trigger will be fired at that timejava.sql.SQLException
public java.util.List selectTriggerToAcquire(java.sql.Connection conn, long noLaterThan, long noEarlierThan) 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.
conn
- the DB ConnectionnoLaterThan
- highest value of getNextFireTime()
of the triggers (exclusive)noEarlierThan
- highest value of getNextFireTime()
of the triggers (inclusive)java.sql.SQLException
public int insertFiredTrigger(java.sql.Connection conn, Trigger trigger, java.lang.String state, JobDetail job) throws java.sql.SQLException
Insert a fired trigger.
conn
- the DB Connectiontrigger
- the triggerstate
- the state that the trigger should be stored injava.sql.SQLException
public java.util.List 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
.
java.sql.SQLException
public java.util.List 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
.
java.sql.SQLException
public java.util.List 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.
java.sql.SQLException
public java.util.Set selectFiredTriggerInstanceNames(java.sql.Connection conn) throws java.sql.SQLException
Select 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.)
java.sql.SQLException
public int deleteFiredTrigger(java.sql.Connection conn, java.lang.String entryId) throws java.sql.SQLException
Delete a fired trigger.
conn
- the DB ConnectionentryId
- the fired trigger entry to deletejava.sql.SQLException
public int selectJobExecutionCount(java.sql.Connection conn, java.lang.String jobName, java.lang.String jobGroup) throws java.sql.SQLException
Get the number instances of the identified job currently executing.
conn
- the DB Connectionjava.sql.SQLException
public int deleteVolatileFiredTriggers(java.sql.Connection conn) throws java.sql.SQLException
Delete all volatile fired triggers.
conn
- the DB Connectionjava.sql.SQLException
public int insertSchedulerState(java.sql.Connection conn, java.lang.String instanceId, long checkInTime, long interval) throws java.sql.SQLException
Insert a scheduler-instance state record.
conn
- the DB Connectionjava.sql.SQLException
public int deleteSchedulerState(java.sql.Connection conn, java.lang.String instanceId) throws java.sql.SQLException
Delete a scheduler-instance state record.
conn
- the DB Connectionjava.sql.SQLException
public int updateSchedulerState(java.sql.Connection conn, java.lang.String instanceId, long checkInTime) throws java.sql.SQLException
Update a scheduler-instance state record.
conn
- the DB Connectionjava.sql.SQLException
public java.util.List 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.
conn
- the DB Connectionjava.sql.SQLException
public Key[] selectVolatileTriggers(java.sql.Connection conn) throws java.sql.SQLException
Get the names of all of the triggers that are volatile.
conn
- the DB ConnectionKey
objectsjava.sql.SQLException
public Key[] selectVolatileJobs(java.sql.Connection conn) throws java.sql.SQLException
Get the names of all of the jobs that are volatile.
conn
- the DB ConnectionKey
objectsjava.sql.SQLException
public java.util.Set selectPausedTriggerGroups(java.sql.Connection conn) throws java.sql.SQLException
java.sql.SQLException
DriverDelegate.selectPausedTriggerGroups(java.sql.Connection)