|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.quartz.impl.jdbcjobstore.StdJDBCDelegate
public class StdJDBCDelegate
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
| Field Summary | |
|---|---|
protected ClassLoadHelper |
classLoadHelper
|
protected String |
instanceId
|
protected org.slf4j.Logger |
logger
|
protected String |
schedName
|
protected String |
tablePrefix
|
protected List<TriggerPersistenceDelegate> |
triggerPersistenceDelegates
|
protected boolean |
useProperties
|
| Constructor Summary | |
|---|---|
StdJDBCDelegate()
Create new StdJDBCDelegate instance. |
|
| Method Summary | |
|---|---|
protected void |
addDefaultTriggerPersistenceDelegates()
|
void |
addTriggerPersistenceDelegate(TriggerPersistenceDelegate delegate)
|
boolean |
calendarExists(Connection conn,
String calendarName)
Check whether or not a calendar exists. |
boolean |
calendarIsReferenced(Connection conn,
String calendarName)
Check whether or not a calendar is referenced by any triggers. |
protected boolean |
canUseProperties()
|
void |
clearData(Connection conn)
Clear (delete!) all scheduling data - all Jobs, Triggers
Calendars. |
protected static void |
closeResultSet(ResultSet rs)
Cleanup helper method that closes the given ResultSet
while ignoring any errors. |
protected static void |
closeStatement(Statement statement)
Cleanup helper method that closes the given Statement
while ignoring any errors. |
protected Map<?,?> |
convertFromProperty(Properties properties)
convert the JobDataMap into a list of properties |
protected Properties |
convertToProperty(Map<?,?> data)
convert the JobDataMap into a list of properties |
int |
countMisfiredTriggersInState(Connection conn,
String state1,
long ts)
Get the number of triggers in the given states that have misfired - according to the given timestamp. |
int |
deleteAllPausedTriggerGroups(Connection conn)
|
int |
deleteBlobTrigger(Connection conn,
TriggerKey triggerKey)
Delete the cron trigger data for a trigger. |
int |
deleteCalendar(Connection conn,
String calendarName)
Delete a calendar. |
int |
deleteFiredTrigger(Connection conn,
String entryId)
Delete a fired trigger. |
int |
deleteFiredTriggers(Connection conn)
Delete all fired triggers. |
int |
deleteFiredTriggers(Connection conn,
String theInstanceId)
Delete all fired triggers of the given instance. |
int |
deleteJobDetail(Connection conn,
JobKey jobKey)
Delete the job detail record for the given job. |
int |
deletePausedTriggerGroup(Connection conn,
GroupMatcher<TriggerKey> matcher)
|
int |
deletePausedTriggerGroup(Connection conn,
String groupName)
|
int |
deleteSchedulerState(Connection conn,
String theInstanceId)
Delete a scheduler-instance state record. |
int |
deleteTrigger(Connection conn,
TriggerKey triggerKey)
Delete the base trigger data for a trigger. |
protected void |
deleteTriggerExtension(Connection conn,
TriggerKey triggerKey)
|
TriggerPersistenceDelegate |
findTriggerPersistenceDelegate(OperableTrigger trigger)
|
TriggerPersistenceDelegate |
findTriggerPersistenceDelegate(String discriminator)
|
protected boolean |
getBoolean(ResultSet rs,
int columnIndex)
Retrieves the value of the designated column index in the current row as a boolean. |
protected boolean |
getBoolean(ResultSet rs,
String columnName)
Retrieves the value of the designated column in the current row as a boolean. |
protected Object |
getJobDataFromBlob(ResultSet rs,
String colName)
This method should be overridden by any delegate subclasses that need special handling for BLOBs for job details. |
protected Object |
getKeyOfNonSerializableValue(Map<?,?> data)
Find the key of the first non-serializable value in the given Map. |
protected Object |
getObjectFromBlob(ResultSet rs,
String colName)
This method should be overridden by any delegate subclasses that need special handling for BLOBs. |
protected String |
getSchedulerNameLiteral()
|
boolean |
hasMisfiredTriggersInState(Connection conn,
String state1,
long ts,
int count,
List<TriggerKey> resultList)
Get the names of all of the triggers in the given state that have misfired - according to the given timestamp. |
void |
initialize(org.slf4j.Logger logger,
String tablePrefix,
String schedName,
String instanceId,
ClassLoadHelper classLoadHelper,
boolean useProperties,
String initString)
|
int |
insertBlobTrigger(Connection conn,
OperableTrigger trigger)
Insert the blob trigger data. |
int |
insertCalendar(Connection conn,
String calendarName,
Calendar calendar)
Insert a new calendar. |
int |
insertFiredTrigger(Connection conn,
OperableTrigger trigger,
String state,
JobDetail job)
Insert a fired trigger. |
int |
insertJobDetail(Connection conn,
JobDetail job)
Insert the job detail record. |
int |
insertPausedTriggerGroup(Connection conn,
String groupName)
|
int |
insertSchedulerState(Connection conn,
String theInstanceId,
long checkInTime,
long interval)
Insert a scheduler-instance state record. |
int |
insertTrigger(Connection conn,
OperableTrigger trigger,
String state,
JobDetail jobDetail)
Insert the base trigger data. |
boolean |
isExistingTriggerGroup(Connection conn,
String groupName)
|
boolean |
isJobNonConcurrent(Connection conn,
JobKey jobKey)
Check whether or not the given job is stateful. |
protected boolean |
isMatcherEquals(GroupMatcher<?> matcher)
|
boolean |
isTriggerGroupPaused(Connection conn,
String groupName)
|
boolean |
jobExists(Connection conn,
JobKey jobKey)
Check whether or not the given job exists. |
protected String |
rtp(String query)
Replace the table prefix in a query by replacing any occurrences of "{0}" with the table prefix. |
Calendar |
selectCalendar(Connection conn,
String calendarName)
Select a calendar. |
List<String> |
selectCalendars(Connection conn)
Select all of the stored calendars. |
Set<String> |
selectFiredTriggerInstanceNames(Connection conn)
Select the distinct instance names of all fired-trigger records. |
List<FiredTriggerRecord> |
selectFiredTriggerRecords(Connection conn,
String triggerName,
String groupName)
Select the states of all fired-trigger records for a given trigger, or trigger group if trigger name is null. |
List<FiredTriggerRecord> |
selectFiredTriggerRecordsByJob(Connection conn,
String jobName,
String groupName)
Select the states of all fired-trigger records for a given job, or job group if job name is null. |
List<FiredTriggerRecord> |
selectInstancesFiredTriggerRecords(Connection conn,
String instanceName)
Select the states of all fired-trigger records for a given scheduler instance. |
JobDetail |
selectJobDetail(Connection conn,
JobKey jobKey,
ClassLoadHelper loadHelper)
Select the JobDetail object for a given job name / group name. |
int |
selectJobExecutionCount(Connection conn,
JobKey jobKey)
Get the number instances of the identified job currently executing. |
JobDetail |
selectJobForTrigger(Connection conn,
ClassLoadHelper loadHelper,
TriggerKey triggerKey)
Select the job to which the trigger is associated. |
JobDetail |
selectJobForTrigger(Connection conn,
ClassLoadHelper loadHelper,
TriggerKey triggerKey,
boolean loadJobClass)
Select the job to which the trigger is associated. |
List<String> |
selectJobGroups(Connection conn)
Select all of the job group names that are stored. |
Set<JobKey> |
selectJobsInGroup(Connection conn,
GroupMatcher<JobKey> matcher)
Select all of the jobs contained in a given group. |
List<TriggerKey> |
selectMisfiredTriggers(Connection conn,
long ts)
Get the names of all of the triggers that have misfired. |
List<TriggerKey> |
selectMisfiredTriggersInGroupInState(Connection conn,
String groupName,
String state,
long ts)
Get the names of all of the triggers in the given group and state that have misfired. |
List<TriggerKey> |
selectMisfiredTriggersInState(Connection conn,
String state,
long ts)
Get the names of all of the triggers in the given state that have misfired - according to the given timestamp. |
long |
selectNextFireTime(Connection conn)
Deprecated. Does not account for misfires. |
int |
selectNumCalendars(Connection conn)
Select the total number of calendars stored. |
int |
selectNumJobs(Connection conn)
Select the total number of jobs stored. |
int |
selectNumTriggers(Connection conn)
Select the total number of triggers stored. |
int |
selectNumTriggersForJob(Connection conn,
JobKey jobKey)
Select the number of triggers associated with a given job. |
Set<String> |
selectPausedTriggerGroups(Connection conn)
|
List<SchedulerStateRecord> |
selectSchedulerStateRecords(Connection conn,
String theInstanceId)
A List of all current SchedulerStateRecords. |
OperableTrigger |
selectTrigger(Connection conn,
TriggerKey triggerKey)
Select a trigger. |
TriggerKey |
selectTriggerForFireTime(Connection conn,
long fireTime)
Select the trigger that will be fired at the given fire time. |
List<String> |
selectTriggerGroups(Connection conn)
Select all of the trigger group names that are stored. |
List<String> |
selectTriggerGroups(Connection conn,
GroupMatcher<TriggerKey> matcher)
|
JobDataMap |
selectTriggerJobDataMap(Connection conn,
String triggerName,
String groupName)
Select a trigger's JobDataMap. |
List<TriggerKey> |
selectTriggerKeysForJob(Connection conn,
JobKey jobKey)
Get the names of all of the triggers associated with the given job. |
List<OperableTrigger> |
selectTriggersForCalendar(Connection conn,
String calName)
Select the triggers for a calendar |
List<OperableTrigger> |
selectTriggersForJob(Connection conn,
JobKey jobKey)
Select the triggers for a job |
List<OperableTrigger> |
selectTriggersForRecoveringJobs(Connection conn)
Select all of the triggers for jobs that are requesting recovery. |
Set<TriggerKey> |
selectTriggersInGroup(Connection conn,
GroupMatcher<TriggerKey> matcher)
Select all of the triggers contained in a given group. |
List<TriggerKey> |
selectTriggersInState(Connection conn,
String state)
Select all of the triggers in a given state. |
String |
selectTriggerState(Connection conn,
TriggerKey triggerKey)
Select a trigger' state value. |
TriggerStatus |
selectTriggerStatus(Connection conn,
TriggerKey triggerKey)
Select a trigger' status (state & next fire time). |
List<TriggerKey> |
selectTriggerToAcquire(Connection conn,
long noLaterThan,
long noEarlierThan)
Deprecated. - This remained for compatibility reason. Use selectTriggerToAcquire(Connection, long, long, int) instead. |
List<TriggerKey> |
selectTriggerToAcquire(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. |
protected ByteArrayOutputStream |
serializeJobData(JobDataMap data)
Remove the transient data from and then create a serialized java.util.ByteArrayOutputStream
version of a . |
protected ByteArrayOutputStream |
serializeObject(Object obj)
Create a serialized java.util.ByteArrayOutputStream
version of an Object. |
protected void |
setBoolean(PreparedStatement ps,
int index,
boolean val)
Sets the designated parameter to the given Java boolean value. |
protected void |
setBytes(PreparedStatement ps,
int index,
ByteArrayOutputStream baos)
Sets the designated parameter to the byte array of the given ByteArrayOutputStream. |
protected String |
toSqlEqualsClause(GroupMatcher<?> matcher)
|
protected String |
toSqlLikeClause(GroupMatcher<?> matcher)
|
boolean |
triggerExists(Connection conn,
TriggerKey triggerKey)
Check whether or not a trigger exists. |
int |
updateBlobTrigger(Connection conn,
OperableTrigger trigger)
Update the blob trigger data. |
int |
updateCalendar(Connection conn,
String calendarName,
Calendar calendar)
Update a calendar. |
int |
updateFiredTrigger(Connection conn,
OperableTrigger trigger,
String state,
JobDetail job)
Update a fired trigger. |
int |
updateJobData(Connection conn,
JobDetail job)
Update the job data map for the given job. |
int |
updateJobDetail(Connection conn,
JobDetail job)
Update the job detail record. |
int |
updateSchedulerState(Connection conn,
String theInstanceId,
long checkInTime)
Update a scheduler-instance state record. |
int |
updateTrigger(Connection conn,
OperableTrigger trigger,
String state,
JobDetail jobDetail)
Update the base trigger data. |
int |
updateTriggerGroupStateFromOtherState(Connection conn,
GroupMatcher<TriggerKey> matcher,
String newState,
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(Connection conn,
GroupMatcher<TriggerKey> matcher,
String newState,
String oldState1,
String oldState2,
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(Connection conn,
TriggerKey triggerKey,
String state)
Update the state for a given trigger. |
int |
updateTriggerStateFromOtherState(Connection conn,
TriggerKey triggerKey,
String newState,
String oldState)
Update the given trigger to the given new state, if it is in the given old state. |
int |
updateTriggerStateFromOtherStates(Connection conn,
TriggerKey triggerKey,
String newState,
String oldState1,
String oldState2,
String oldState3)
Update the given trigger to the given new state, if it is one of the given old states. |
int |
updateTriggerStatesForJob(Connection conn,
JobKey jobKey,
String state)
Update the states of all triggers associated with the given job. |
int |
updateTriggerStatesForJobFromOtherState(Connection conn,
JobKey jobKey,
String state,
String oldState)
Update the states of any triggers associated with the given job, that are the given current state. |
int |
updateTriggerStatesFromOtherStates(Connection conn,
String newState,
String oldState1,
String oldState2)
Insert the job detail record. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected org.slf4j.Logger logger
protected String tablePrefix
protected String instanceId
protected String schedName
protected boolean useProperties
protected ClassLoadHelper classLoadHelper
protected List<TriggerPersistenceDelegate> triggerPersistenceDelegates
| Constructor Detail |
|---|
public StdJDBCDelegate()
Create new StdJDBCDelegate instance.
| Method Detail |
|---|
public void initialize(org.slf4j.Logger logger,
String tablePrefix,
String schedName,
String instanceId,
ClassLoadHelper classLoadHelper,
boolean useProperties,
String initString)
throws NoSuchDelegateException
initialize in interface DriverDelegateinitString - of the format: settingName=settingValue|otherSettingName=otherSettingValue|...
NoSuchDelegateExceptionprotected void addDefaultTriggerPersistenceDelegates()
protected boolean canUseProperties()
public void addTriggerPersistenceDelegate(TriggerPersistenceDelegate delegate)
public TriggerPersistenceDelegate findTriggerPersistenceDelegate(OperableTrigger trigger)
public TriggerPersistenceDelegate findTriggerPersistenceDelegate(String discriminator)
public int updateTriggerStatesFromOtherStates(Connection conn,
String newState,
String oldState1,
String oldState2)
throws SQLException
Insert the job detail record.
updateTriggerStatesFromOtherStates in interface DriverDelegateconn - the DB ConnectionnewState - the new state for the triggersoldState1 - the first old state to updateoldState2 - the second old state to update
SQLException
public List<TriggerKey> selectMisfiredTriggers(Connection conn,
long ts)
throws SQLException
Get the names of all of the triggers that have misfired.
selectMisfiredTriggers in interface DriverDelegateconn - the DB Connection
Key objects
SQLException
public List<TriggerKey> selectTriggersInState(Connection conn,
String state)
throws SQLException
Select all of the triggers in a given state.
selectTriggersInState in interface DriverDelegateconn - the DB Connectionstate - the state the triggers must be in
Key s
SQLException
public List<TriggerKey> selectMisfiredTriggersInState(Connection conn,
String state,
long ts)
throws SQLException
DriverDelegateGet the names of all of the triggers in the given state that have misfired - according to the given timestamp.
selectMisfiredTriggersInState in interface DriverDelegateconn - the DB Connection
Key objects
SQLException
public boolean hasMisfiredTriggersInState(Connection conn,
String state1,
long ts,
int count,
List<TriggerKey> resultList)
throws SQLException
Get the names of all of the triggers in the given state that have misfired - according to the given timestamp. No more than count will be returned.
hasMisfiredTriggersInState in interface DriverDelegateconn - The DB Connectioncount - The most misfired triggers to return, negative for allresultList - Output parameter. A List of
Key objects. Must not be null.
SQLException
public int countMisfiredTriggersInState(Connection conn,
String state1,
long ts)
throws SQLException
Get the number of triggers in the given states that have misfired - according to the given timestamp.
countMisfiredTriggersInState in interface DriverDelegateconn - the DB Connection
SQLException
public List<TriggerKey> selectMisfiredTriggersInGroupInState(Connection conn,
String groupName,
String state,
long ts)
throws SQLException
Get the names of all of the triggers in the given group and state that have misfired.
selectMisfiredTriggersInGroupInState in interface DriverDelegateconn - the DB Connection
Key objects
SQLException
public List<OperableTrigger> selectTriggersForRecoveringJobs(Connection conn)
throws SQLException,
IOException,
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.
selectTriggersForRecoveringJobs in interface DriverDelegateconn - the DB Connection
Trigger objects
SQLException
IOException
ClassNotFoundException
public int deleteFiredTriggers(Connection conn)
throws SQLException
Delete all fired triggers.
deleteFiredTriggers in interface DriverDelegateconn - the DB Connection
SQLException
public int deleteFiredTriggers(Connection conn,
String theInstanceId)
throws SQLException
DriverDelegateDelete all fired triggers of the given instance.
deleteFiredTriggers in interface DriverDelegateconn - the DB Connection
SQLException
public void clearData(Connection conn)
throws SQLException
Jobs, Triggers
Calendars.
clearData in interface DriverDelegateJobPersistenceException
SQLException
public int insertJobDetail(Connection conn,
JobDetail job)
throws IOException,
SQLException
Insert the job detail record.
insertJobDetail in interface DriverDelegateconn - the DB Connectionjob - the job to insert
IOException - if there were problems serializing the JobDataMap
SQLException
public int updateJobDetail(Connection conn,
JobDetail job)
throws IOException,
SQLException
Update the job detail record.
updateJobDetail in interface DriverDelegateconn - the DB Connectionjob - the job to update
IOException - if there were problems serializing the JobDataMap
SQLException
public List<TriggerKey> selectTriggerKeysForJob(Connection conn,
JobKey jobKey)
throws SQLException
Get the names of all of the triggers associated with the given job.
selectTriggerKeysForJob in interface DriverDelegateconn - the DB Connection
Key objects
SQLException
public int deleteJobDetail(Connection conn,
JobKey jobKey)
throws SQLException
Delete the job detail record for the given job.
deleteJobDetail in interface DriverDelegateconn - the DB Connection
SQLException
public boolean isJobNonConcurrent(Connection conn,
JobKey jobKey)
throws SQLException
Check whether or not the given job is stateful.
isJobNonConcurrent in interface DriverDelegateconn - the DB Connection
SQLException
public boolean jobExists(Connection conn,
JobKey jobKey)
throws SQLException
Check whether or not the given job exists.
jobExists in interface DriverDelegateconn - the DB Connection
SQLException
public int updateJobData(Connection conn,
JobDetail job)
throws IOException,
SQLException
Update the job data map for the given job.
updateJobData in interface DriverDelegateconn - the DB Connectionjob - the job to update
IOException - if there were problems serializing the JobDataMap
SQLException
public JobDetail selectJobDetail(Connection conn,
JobKey jobKey,
ClassLoadHelper loadHelper)
throws ClassNotFoundException,
IOException,
SQLException
Select the JobDetail object for a given job name / group name.
selectJobDetail in interface DriverDelegateconn - the DB Connection
ClassNotFoundException - if a class found during deserialization cannot be found or if
the job class could not be found
IOException - if deserialization causes an error
SQLException
public int selectNumJobs(Connection conn)
throws SQLException
Select the total number of jobs stored.
selectNumJobs in interface DriverDelegateconn - the DB Connection
SQLException
public List<String> selectJobGroups(Connection conn)
throws SQLException
Select all of the job group names that are stored.
selectJobGroups in interface DriverDelegateconn - the DB Connection
String group names
SQLException
public Set<JobKey> selectJobsInGroup(Connection conn,
GroupMatcher<JobKey> matcher)
throws SQLException
Select all of the jobs contained in a given group.
selectJobsInGroup in interface DriverDelegateconn - the DB Connectionmatcher - the groupMatcher to evaluate the jobs against
String job names
SQLExceptionprotected boolean isMatcherEquals(GroupMatcher<?> matcher)
protected String toSqlEqualsClause(GroupMatcher<?> matcher)
protected String toSqlLikeClause(GroupMatcher<?> matcher)
public int insertTrigger(Connection conn,
OperableTrigger trigger,
String state,
JobDetail jobDetail)
throws SQLException,
IOException
Insert the base trigger data.
insertTrigger in interface DriverDelegateconn - the DB Connectiontrigger - the trigger to insertstate - the state that the trigger should be stored in
SQLException
IOException
public int insertBlobTrigger(Connection conn,
OperableTrigger trigger)
throws SQLException,
IOException
Insert the blob trigger data.
conn - the DB Connectiontrigger - the trigger to insert
SQLException
IOException
public int updateTrigger(Connection conn,
OperableTrigger trigger,
String state,
JobDetail jobDetail)
throws SQLException,
IOException
Update the base trigger data.
updateTrigger in interface DriverDelegateconn - the DB Connectiontrigger - the trigger to insertstate - the state that the trigger should be stored in
SQLException
IOException
public int updateBlobTrigger(Connection conn,
OperableTrigger trigger)
throws SQLException,
IOException
Update the blob trigger data.
conn - the DB Connectiontrigger - the trigger to insert
SQLException
IOException
public boolean triggerExists(Connection conn,
TriggerKey triggerKey)
throws SQLException
Check whether or not a trigger exists.
triggerExists in interface DriverDelegateconn - the DB Connection
SQLException
public int updateTriggerState(Connection conn,
TriggerKey triggerKey,
String state)
throws SQLException
Update the state for a given trigger.
updateTriggerState in interface DriverDelegateconn - the DB Connectionstate - the new state for the trigger
SQLException
public int updateTriggerStateFromOtherStates(Connection conn,
TriggerKey triggerKey,
String newState,
String oldState1,
String oldState2,
String oldState3)
throws SQLException
Update the given trigger to the given new state, if it is one of the given old states.
updateTriggerStateFromOtherStates in interface DriverDelegateconn - 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
SQLException
public int updateTriggerGroupStateFromOtherStates(Connection conn,
GroupMatcher<TriggerKey> matcher,
String newState,
String oldState1,
String oldState2,
String oldState3)
throws SQLException
Update all triggers in the given group to the given new state, if they are in one of the given old states.
updateTriggerGroupStateFromOtherStates in interface DriverDelegateconn - the DB connectionmatcher - the groupMatcher to evaluate the triggers againstnewState - 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
SQLException
public int updateTriggerStateFromOtherState(Connection conn,
TriggerKey triggerKey,
String newState,
String oldState)
throws SQLException
Update the given trigger to the given new state, if it is in the given old state.
updateTriggerStateFromOtherState in interface DriverDelegateconn - the DB connectionnewState - the new state for the triggeroldState - the old state the trigger must be in
SQLException
public int updateTriggerGroupStateFromOtherState(Connection conn,
GroupMatcher<TriggerKey> matcher,
String newState,
String oldState)
throws SQLException
Update all of the triggers of the given group to the given new state, if they are in the given old state.
updateTriggerGroupStateFromOtherState in interface DriverDelegateconn - the DB connectionmatcher - the groupMatcher to evaluate the triggers againstnewState - the new state for the trigger groupoldState - the old state the triggers must be in
SQLException
public int updateTriggerStatesForJob(Connection conn,
JobKey jobKey,
String state)
throws SQLException
Update the states of all triggers associated with the given job.
updateTriggerStatesForJob in interface DriverDelegateconn - the DB Connectionstate - the new state for the triggers
SQLException
public int updateTriggerStatesForJobFromOtherState(Connection conn,
JobKey jobKey,
String state,
String oldState)
throws SQLException
DriverDelegateUpdate the states of any triggers associated with the given job, that are the given current state.
updateTriggerStatesForJobFromOtherState in interface DriverDelegateconn - the DB Connectionstate - the new state for the triggersoldState - the old state of the triggers
SQLException
public int deleteBlobTrigger(Connection conn,
TriggerKey triggerKey)
throws SQLException
Delete the cron trigger data for a trigger.
conn - the DB Connection
SQLException
public int deleteTrigger(Connection conn,
TriggerKey triggerKey)
throws SQLException
Delete the base trigger data for a trigger.
deleteTrigger in interface DriverDelegateconn - the DB Connection
SQLException
protected void deleteTriggerExtension(Connection conn,
TriggerKey triggerKey)
throws SQLException
SQLException
public int selectNumTriggersForJob(Connection conn,
JobKey jobKey)
throws SQLException
Select the number of triggers associated with a given job.
selectNumTriggersForJob in interface DriverDelegateconn - the DB Connection
SQLException
public JobDetail selectJobForTrigger(Connection conn,
ClassLoadHelper loadHelper,
TriggerKey triggerKey)
throws ClassNotFoundException,
SQLException
Select the job to which the trigger is associated.
selectJobForTrigger in interface DriverDelegateconn - the DB Connection
JobDetail object
associated with the given trigger
SQLException
ClassNotFoundException
public JobDetail selectJobForTrigger(Connection conn,
ClassLoadHelper loadHelper,
TriggerKey triggerKey,
boolean loadJobClass)
throws ClassNotFoundException,
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.
selectJobForTrigger in interface DriverDelegateconn - the DB Connection
JobDetail object
associated with the given trigger
SQLException
ClassNotFoundException
public List<OperableTrigger> selectTriggersForJob(Connection conn,
JobKey jobKey)
throws SQLException,
ClassNotFoundException,
IOException,
JobPersistenceException
Select the triggers for a job
selectTriggersForJob in interface DriverDelegateconn - the DB Connection
(@link org.quartz.Trigger) objects
associated with a given job.
SQLException
JobPersistenceException
ClassNotFoundException
IOException
public List<OperableTrigger> selectTriggersForCalendar(Connection conn,
String calName)
throws SQLException,
ClassNotFoundException,
IOException,
JobPersistenceException
DriverDelegateSelect the triggers for a calendar
selectTriggersForCalendar in interface DriverDelegateconn - the DB ConnectioncalName - the name of the calendar
(@link org.quartz.Trigger) objects
associated with the given calendar.
SQLException
JobPersistenceException
ClassNotFoundException
IOException
public OperableTrigger selectTrigger(Connection conn,
TriggerKey triggerKey)
throws SQLException,
ClassNotFoundException,
IOException,
JobPersistenceException
Select a trigger.
selectTrigger in interface DriverDelegateconn - the DB Connection
Trigger object
JobPersistenceException
SQLException
ClassNotFoundException
IOException
public JobDataMap selectTriggerJobDataMap(Connection conn,
String triggerName,
String groupName)
throws SQLException,
ClassNotFoundException,
IOException
Select a trigger's JobDataMap.
selectTriggerJobDataMap in interface DriverDelegateconn - the DB ConnectiontriggerName - the name of the triggergroupName - the group containing the trigger
JobDataMap of the Trigger,
never null, but possibly empty.
SQLException
ClassNotFoundException
IOException
public String selectTriggerState(Connection conn,
TriggerKey triggerKey)
throws SQLException
Select a trigger' state value.
selectTriggerState in interface DriverDelegateconn - the DB Connection
Trigger object
SQLException
public TriggerStatus selectTriggerStatus(Connection conn,
TriggerKey triggerKey)
throws SQLException
Select a trigger' status (state & next fire time).
selectTriggerStatus in interface DriverDelegateconn - the DB Connection
TriggerStatus object, or null
SQLException
public int selectNumTriggers(Connection conn)
throws SQLException
Select the total number of triggers stored.
selectNumTriggers in interface DriverDelegateconn - the DB Connection
SQLException
public List<String> selectTriggerGroups(Connection conn)
throws SQLException
Select all of the trigger group names that are stored.
selectTriggerGroups in interface DriverDelegateconn - the DB Connection
String group names
SQLException
public List<String> selectTriggerGroups(Connection conn,
GroupMatcher<TriggerKey> matcher)
throws SQLException
selectTriggerGroups in interface DriverDelegateSQLException
public Set<TriggerKey> selectTriggersInGroup(Connection conn,
GroupMatcher<TriggerKey> matcher)
throws SQLException
Select all of the triggers contained in a given group.
selectTriggersInGroup in interface DriverDelegateconn - the DB Connectionmatcher - to evaluate against known triggers
TriggerKeys
SQLException
public int insertPausedTriggerGroup(Connection conn,
String groupName)
throws SQLException
insertPausedTriggerGroup in interface DriverDelegateSQLException
public int deletePausedTriggerGroup(Connection conn,
String groupName)
throws SQLException
deletePausedTriggerGroup in interface DriverDelegateSQLException
public int deletePausedTriggerGroup(Connection conn,
GroupMatcher<TriggerKey> matcher)
throws SQLException
deletePausedTriggerGroup in interface DriverDelegateSQLException
public int deleteAllPausedTriggerGroups(Connection conn)
throws SQLException
deleteAllPausedTriggerGroups in interface DriverDelegateSQLException
public boolean isTriggerGroupPaused(Connection conn,
String groupName)
throws SQLException
isTriggerGroupPaused in interface DriverDelegateSQLException
public boolean isExistingTriggerGroup(Connection conn,
String groupName)
throws SQLException
isExistingTriggerGroup in interface DriverDelegateSQLException
public int insertCalendar(Connection conn,
String calendarName,
Calendar calendar)
throws IOException,
SQLException
Insert a new calendar.
insertCalendar in interface DriverDelegateconn - the DB ConnectioncalendarName - the name for the new calendarcalendar - the calendar
IOException - if there were problems serializing the calendar
SQLException
public int updateCalendar(Connection conn,
String calendarName,
Calendar calendar)
throws IOException,
SQLException
Update a calendar.
updateCalendar in interface DriverDelegateconn - the DB ConnectioncalendarName - the name for the new calendarcalendar - the calendar
IOException - if there were problems serializing the calendar
SQLException
public boolean calendarExists(Connection conn,
String calendarName)
throws SQLException
Check whether or not a calendar exists.
calendarExists in interface DriverDelegateconn - the DB ConnectioncalendarName - the name of the calendar
SQLException
public Calendar selectCalendar(Connection conn,
String calendarName)
throws ClassNotFoundException,
IOException,
SQLException
Select a calendar.
selectCalendar in interface DriverDelegateconn - the DB ConnectioncalendarName - the name of the calendar
ClassNotFoundException - if a class found during deserialization cannot be found be
found
IOException - if there were problems deserializing the calendar
SQLException
public boolean calendarIsReferenced(Connection conn,
String calendarName)
throws SQLException
Check whether or not a calendar is referenced by any triggers.
calendarIsReferenced in interface DriverDelegateconn - the DB ConnectioncalendarName - the name of the calendar
SQLException
public int deleteCalendar(Connection conn,
String calendarName)
throws SQLException
Delete a calendar.
deleteCalendar in interface DriverDelegateconn - the DB ConnectioncalendarName - the name of the trigger
SQLException
public int selectNumCalendars(Connection conn)
throws SQLException
Select the total number of calendars stored.
selectNumCalendars in interface DriverDelegateconn - the DB Connection
SQLException
public List<String> selectCalendars(Connection conn)
throws SQLException
Select all of the stored calendars.
selectCalendars in interface DriverDelegateconn - the DB Connection
String calendar names
SQLException
public long selectNextFireTime(Connection conn)
throws SQLException
Select the next time that a trigger will be fired.
selectNextFireTime in interface DriverDelegateconn - the DB Connection
SQLException
public TriggerKey selectTriggerForFireTime(Connection conn,
long fireTime)
throws SQLException
Select the trigger that will be fired at the given fire time.
selectTriggerForFireTime in interface DriverDelegateconn - the DB ConnectionfireTime - the time that the trigger will be fired
Key representing the
trigger that will be fired at the given fire time, or null if no
trigger will be fired at that time
SQLException
public List<TriggerKey> selectTriggerToAcquire(Connection conn,
long noLaterThan,
long noEarlierThan)
throws SQLException
selectTriggerToAcquire(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.
selectTriggerToAcquire in interface DriverDelegateconn - the DB ConnectionnoLaterThan - highest value of getNextFireTime() of the triggers (exclusive)noEarlierThan - highest value of getNextFireTime() of the triggers (inclusive)
SQLException
public List<TriggerKey> selectTriggerToAcquire(Connection conn,
long noLaterThan,
long noEarlierThan,
int maxCount)
throws 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.
selectTriggerToAcquire in interface DriverDelegateconn - the DB ConnectionnoLaterThan - highest value of getNextFireTime() of the triggers (exclusive)noEarlierThan - highest value of getNextFireTime() of the triggers (inclusive)maxCount - maximum number of trigger keys allow to acquired in the returning list.
SQLException
public int insertFiredTrigger(Connection conn,
OperableTrigger trigger,
String state,
JobDetail job)
throws SQLException
Insert a fired trigger.
insertFiredTrigger in interface DriverDelegateconn - the DB Connectiontrigger - the triggerstate - the state that the trigger should be stored in
SQLException
public int updateFiredTrigger(Connection conn,
OperableTrigger trigger,
String state,
JobDetail job)
throws SQLException
Update a fired trigger.
updateFiredTrigger in interface DriverDelegateconn - the DB Connectiontrigger - the triggerstate - the state that the trigger should be stored in
SQLException
public List<FiredTriggerRecord> selectFiredTriggerRecords(Connection conn,
String triggerName,
String groupName)
throws SQLException
Select the states of all fired-trigger records for a given trigger, or
trigger group if trigger name is null.
selectFiredTriggerRecords in interface DriverDelegateSQLException
public List<FiredTriggerRecord> selectFiredTriggerRecordsByJob(Connection conn,
String jobName,
String groupName)
throws SQLException
Select the states of all fired-trigger records for a given job, or job
group if job name is null.
selectFiredTriggerRecordsByJob in interface DriverDelegateSQLException
public List<FiredTriggerRecord> selectInstancesFiredTriggerRecords(Connection conn,
String instanceName)
throws SQLException
DriverDelegateSelect the states of all fired-trigger records for a given scheduler instance.
selectInstancesFiredTriggerRecords in interface DriverDelegateSQLException
public Set<String> selectFiredTriggerInstanceNames(Connection conn)
throws 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.)
selectFiredTriggerInstanceNames in interface DriverDelegateSQLException
public int deleteFiredTrigger(Connection conn,
String entryId)
throws SQLException
Delete a fired trigger.
deleteFiredTrigger in interface DriverDelegateconn - the DB ConnectionentryId - the fired trigger entry to delete
SQLException
public int selectJobExecutionCount(Connection conn,
JobKey jobKey)
throws SQLException
DriverDelegateGet the number instances of the identified job currently executing.
selectJobExecutionCount in interface DriverDelegateconn - the DB Connection
SQLException
public int insertSchedulerState(Connection conn,
String theInstanceId,
long checkInTime,
long interval)
throws SQLException
DriverDelegateInsert a scheduler-instance state record.
insertSchedulerState in interface DriverDelegateconn - the DB Connection
SQLException
public int deleteSchedulerState(Connection conn,
String theInstanceId)
throws SQLException
DriverDelegateDelete a scheduler-instance state record.
deleteSchedulerState in interface DriverDelegateconn - the DB Connection
SQLException
public int updateSchedulerState(Connection conn,
String theInstanceId,
long checkInTime)
throws SQLException
DriverDelegateUpdate a scheduler-instance state record.
updateSchedulerState in interface DriverDelegateconn - the DB Connection
SQLException
public List<SchedulerStateRecord> selectSchedulerStateRecords(Connection conn,
String theInstanceId)
throws SQLException
DriverDelegate
A List of all current SchedulerStateRecords.
If instanceId is not null, then only the record for the identified instance will be returned.
selectSchedulerStateRecords in interface DriverDelegateconn - the DB Connection
SQLExceptionprotected final String rtp(String query)
Replace the table prefix in a query by replacing any occurrences of "{0}" with the table prefix.
query - the unsubstitued query
protected String getSchedulerNameLiteral()
protected ByteArrayOutputStream serializeObject(Object obj)
throws IOException
Create a serialized java.util.ByteArrayOutputStream
version of an Object.
obj - the object to serialize
IOException - if serialization causes an error
protected ByteArrayOutputStream serializeJobData(JobDataMap data)
throws IOException
Remove the transient data from and then create a serialized java.util.ByteArrayOutputStream
version of a .
JobDataMap
data - the JobDataMap to serialize
IOException - if serialization causes an errorprotected Object getKeyOfNonSerializableValue(Map<?,?> data)
protected Map<?,?> convertFromProperty(Properties properties)
throws IOException
IOException
protected Properties convertToProperty(Map<?,?> data)
throws IOException
IOException
protected Object getObjectFromBlob(ResultSet rs,
String colName)
throws ClassNotFoundException,
IOException,
SQLException
This method should be overridden by any delegate subclasses that need
special handling for BLOBs. The default implementation uses standard
JDBC java.sql.Blob operations.
rs - the result set, already queued to the correct rowcolName - the column name for the BLOB
ClassNotFoundException - if a class found during deserialization cannot be found
IOException - if deserialization causes an error
SQLException
protected Object getJobDataFromBlob(ResultSet rs,
String colName)
throws ClassNotFoundException,
IOException,
SQLException
This method should be overridden by any delegate subclasses that need
special handling for BLOBs for job details. The default implementation
uses standard JDBC java.sql.Blob operations.
rs - the result set, already queued to the correct rowcolName - the column name for the BLOB
ClassNotFoundException - if a class found during deserialization cannot be found
IOException - if deserialization causes an error
SQLException
public Set<String> selectPausedTriggerGroups(Connection conn)
throws SQLException
selectPausedTriggerGroups in interface DriverDelegateSQLExceptionDriverDelegate.selectPausedTriggerGroups(java.sql.Connection)protected static void closeResultSet(ResultSet rs)
ResultSet
while ignoring any errors.
protected static void closeStatement(Statement statement)
Statement
while ignoring any errors.
protected void setBoolean(PreparedStatement ps,
int index,
boolean val)
throws SQLException
boolean value.
This just wraps PreparedStatement.setBoolean(int, boolean)
by default, but it can be overloaded by subclass delegates for databases that
don't explicitly support the boolean type.
SQLException
protected boolean getBoolean(ResultSet rs,
String columnName)
throws SQLException
boolean.
This just wraps ResultSet.getBoolean(java.lang.String)
by default, but it can be overloaded by subclass delegates for databases that
don't explicitly support the boolean type.
SQLException
protected boolean getBoolean(ResultSet rs,
int columnIndex)
throws SQLException
boolean.
This just wraps ResultSet.getBoolean(java.lang.String)
by default, but it can be overloaded by subclass delegates for databases that
don't explicitly support the boolean type.
SQLException
protected void setBytes(PreparedStatement ps,
int index,
ByteArrayOutputStream baos)
throws SQLException
ByteArrayOutputStream. Will set parameter value to null if the
ByteArrayOutputStream is null.
This just wraps PreparedStatement.setBytes(int, byte[])
by default, but it can be overloaded by subclass delegates for databases that
don't explicitly support storing bytes in this way.
SQLException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||