org.quartz.impl.jdbcjobstore
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Field Summary | |
|---|---|
protected String |
instanceId
|
protected org.apache.commons.logging.Log |
logger
|
protected String |
tablePrefix
|
protected boolean |
useProperties
|
| Constructor Summary | |
|---|---|
StdJDBCDelegate(org.apache.commons.logging.Log logger,
String tablePrefix,
String instanceId)
Create new StdJDBCDelegate instance. |
|
StdJDBCDelegate(org.apache.commons.logging.Log logger,
String tablePrefix,
String instanceId,
Boolean useProperties)
Create new StdJDBCDelegate instance. |
|
| Method Summary | |
|---|---|
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()
|
protected void |
closeResultSet(ResultSet rs)
Cleanup helper method that closes the given ResultSet
while ignoring any errors. |
protected 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 |
countMisfiredTriggersInStates(Connection conn,
String state1,
String state2,
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,
String triggerName,
String groupName)
Delete the cron trigger data for a trigger. |
int |
deleteCalendar(Connection conn,
String calendarName)
Delete a calendar. |
int |
deleteCronTrigger(Connection conn,
String triggerName,
String groupName)
Delete the cron trigger data for a trigger. |
int |
deleteFiredTrigger(Connection conn,
String entryId)
Delete a fired trigger. |
int |
deleteFiredTriggers(Connection conn)
Delete all fired triggers. |
int |
deleteFiredTriggers(Connection conn,
String instanceId)
Delete all fired triggers of the given instance. |
int |
deleteJobDetail(Connection conn,
String jobName,
String groupName)
Delete the job detail record for the given job. |
int |
deleteJobListeners(Connection conn,
String jobName,
String groupName)
Delete all job listeners for the given job. |
int |
deletePausedTriggerGroup(Connection conn,
String groupName)
|
int |
deleteSchedulerState(Connection conn,
String instanceId)
Delete a scheduler-instance state record. |
int |
deleteSimpleTrigger(Connection conn,
String triggerName,
String groupName)
Delete the simple trigger data for a trigger. |
int |
deleteTrigger(Connection conn,
String triggerName,
String groupName)
Delete the base trigger data for a trigger. |
int |
deleteTriggerListeners(Connection conn,
String triggerName,
String groupName)
Delete all of the listeners associated with a given trigger. |
int |
deleteVolatileFiredTriggers(Connection conn)
Delete all volatile fired triggers. |
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 |
getJobDetailFromBlob(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. |
int |
insertBlobTrigger(Connection conn,
Trigger trigger)
Insert the blob trigger data. |
int |
insertCalendar(Connection conn,
String calendarName,
Calendar calendar)
Insert a new calendar. |
int |
insertCronTrigger(Connection conn,
CronTrigger trigger)
Insert the cron trigger data. |
int |
insertFiredTrigger(Connection conn,
Trigger trigger,
String state,
JobDetail job)
Insert a fired trigger. |
int |
insertJobDetail(Connection conn,
JobDetail job)
Insert the job detail record. |
int |
insertJobListener(Connection conn,
JobDetail job,
String listener)
Associate a listener with a job. |
int |
insertPausedTriggerGroup(Connection conn,
String groupName)
|
int |
insertSchedulerState(Connection conn,
String instanceId,
long checkInTime,
long interval)
Insert a scheduler-instance state record. |
int |
insertSimpleTrigger(Connection conn,
SimpleTrigger trigger)
Insert the simple trigger data. |
int |
insertTrigger(Connection conn,
Trigger trigger,
String state,
JobDetail jobDetail)
Insert the base trigger data. |
int |
insertTriggerListener(Connection conn,
Trigger trigger,
String listener)
Associate a listener with the given trigger. |
boolean |
isExistingTriggerGroup(Connection conn,
String groupName)
|
boolean |
isJobStateful(Connection conn,
String jobName,
String groupName)
Check whether or not the given job is stateful. |
boolean |
isTriggerGroupPaused(Connection conn,
String groupName)
|
boolean |
jobExists(Connection conn,
String jobName,
String groupName)
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. |
String[] |
selectCalendars(Connection conn)
Select all of the stored calendars. |
Set |
selectFiredTriggerInstanceNames(Connection conn)
Select the distinct instance names of all fired-trigger records. |
List |
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 |
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 |
selectInstancesFiredTriggerRecords(Connection conn,
String instanceName)
Select the states of all fired-trigger records for a given scheduler instance. |
JobDetail |
selectJobDetail(Connection conn,
String jobName,
String groupName,
ClassLoadHelper loadHelper)
Select the JobDetail object for a given job name / group name. |
int |
selectJobExecutionCount(Connection conn,
String jobName,
String jobGroup)
Get the number instances of the identified job currently executing. |
JobDetail |
selectJobForTrigger(Connection conn,
String triggerName,
String groupName,
ClassLoadHelper loadHelper)
Select the job to which the trigger is associated. |
String[] |
selectJobGroups(Connection conn)
Select all of the job group names that are stored. |
String[] |
selectJobListeners(Connection conn,
String jobName,
String groupName)
Get all of the listeners for a given job. |
String[] |
selectJobsInGroup(Connection conn,
String groupName)
Select all of the jobs contained in a given group. |
Key[] |
selectMisfiredTriggers(Connection conn,
long ts)
Get the names of all of the triggers that have misfired. |
Key[] |
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. |
Key[] |
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. |
boolean |
selectMisfiredTriggersInStates(Connection conn,
String state1,
String state2,
long ts,
int count,
List resultList)
Get the names of all of the triggers in the given states 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,
String jobName,
String groupName)
Select the number of triggers associated with a given job. |
Set |
selectPausedTriggerGroups(Connection conn)
|
List |
selectSchedulerStateRecords(Connection conn,
String instanceId)
A List of all current SchedulerStateRecords. |
List |
selectStatefulJobsOfTriggerGroup(Connection conn,
String groupName)
Select the stateful jobs which are referenced by triggers in the given trigger group. |
Trigger |
selectTrigger(Connection conn,
String triggerName,
String groupName)
Select a trigger. |
Key |
selectTriggerForFireTime(Connection conn,
long fireTime)
Select the trigger that will be fired at the given fire time. |
String[] |
selectTriggerGroups(Connection conn)
Select all of the trigger group names that are stored. |
JobDataMap |
selectTriggerJobDataMap(Connection conn,
String triggerName,
String groupName)
Select a trigger's JobDataMap. |
String[] |
selectTriggerListeners(Connection conn,
String triggerName,
String groupName)
Select the listeners associated with a given trigger. |
Key[] |
selectTriggerNamesForJob(Connection conn,
String jobName,
String groupName)
Get the names of all of the triggers associated with the given job. |
Trigger[] |
selectTriggersForCalendar(Connection conn,
String calName)
Select the triggers for a calendar |
Trigger[] |
selectTriggersForJob(Connection conn,
String jobName,
String groupName)
Select the triggers for a job |
Trigger[] |
selectTriggersForRecoveringJobs(Connection conn)
Select all of the triggers for jobs that are requesting recovery. |
String[] |
selectTriggersInGroup(Connection conn,
String groupName)
Select all of the triggers contained in a given group. |
Key[] |
selectTriggersInState(Connection conn,
String state)
Select all of the triggers in a given state. |
String |
selectTriggerState(Connection conn,
String triggerName,
String groupName)
Select a trigger' state value. |
TriggerStatus |
selectTriggerStatus(Connection conn,
String triggerName,
String groupName)
Select a trigger' status (state & next fire time). |
Key |
selectTriggerToAcquire(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(Connection conn)
Get the names of all of the jobs that are volatile. |
Key[] |
selectVolatileTriggers(Connection conn)
Get the names of all of the triggers that are volatile. |
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. |
boolean |
triggerExists(Connection conn,
String triggerName,
String groupName)
Check whether or not a trigger exists. |
int |
updateBlobTrigger(Connection conn,
Trigger trigger)
Update the blob trigger data. |
int |
updateCalendar(Connection conn,
String calendarName,
Calendar calendar)
Update a calendar. |
int |
updateCronTrigger(Connection conn,
CronTrigger trigger)
Update the cron trigger data. |
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 instanceId,
long checkInTime)
Update a scheduler-instance state record. |
int |
updateSimpleTrigger(Connection conn,
SimpleTrigger trigger)
Update the simple trigger data. |
int |
updateTrigger(Connection conn,
Trigger trigger,
String state,
JobDetail jobDetail)
Update the base trigger data. |
int |
updateTriggerGroupStateFromOtherState(Connection conn,
String groupName,
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,
String groupName,
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,
String triggerName,
String groupName,
String state)
Update the state for a given trigger. |
int |
updateTriggerStateFromOtherState(Connection conn,
String triggerName,
String groupName,
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,
String triggerName,
String groupName,
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 |
updateTriggerStateFromOtherStatesBeforeTime(Connection conn,
String newState,
String oldState1,
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(Connection conn,
String jobName,
String groupName,
String state)
Update the states of all triggers associated with the given job. |
int |
updateTriggerStatesForJobFromOtherState(Connection conn,
String jobName,
String groupName,
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.apache.commons.logging.Log logger
protected String tablePrefix
protected String instanceId
protected boolean useProperties
| Constructor Detail |
|---|
public StdJDBCDelegate(org.apache.commons.logging.Log logger,
String tablePrefix,
String instanceId)
Create new StdJDBCDelegate instance.
logger - the logger to use during executiontablePrefix - the prefix of all table names
public StdJDBCDelegate(org.apache.commons.logging.Log logger,
String tablePrefix,
String instanceId,
Boolean useProperties)
Create new StdJDBCDelegate instance.
logger - the logger to use during executiontablePrefix - the prefix of all table names| Method Detail |
|---|
protected boolean canUseProperties()
public int updateTriggerStatesFromOtherStates(Connection conn, String newState, String oldState1,