org.quartz.impl.jdbcjobstore
Class DB2v7Delegate

java.lang.Object
  extended byorg.quartz.impl.jdbcjobstore.StdJDBCDelegate
      extended byorg.quartz.impl.jdbcjobstore.DB2v7Delegate
All Implemented Interfaces:
Constants, DriverDelegate, StdJDBCConstants

public class DB2v7Delegate
extends StdJDBCDelegate

Quartz JDBC delegate for DB2 v7 databases.

Author:
Blair Jensen

Field Summary
 
Fields inherited from class org.quartz.impl.jdbcjobstore.StdJDBCDelegate
instanceId, logger, tablePrefix, useProperties
 
Fields inherited from interface org.quartz.impl.jdbcjobstore.StdJDBCConstants
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_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_NEXT_FIRE_TIME, 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
 
Fields inherited from interface org.quartz.impl.jdbcjobstore.Constants
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_RECOVERER, 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 Summary
DB2v7Delegate(org.apache.commons.logging.Log logger, String tablePrefix, String instanceId)
           
DB2v7Delegate(org.apache.commons.logging.Log log, String tablePrefix, String instanceId, Boolean useProperties)
           
 
Method Summary
 int deleteVolatileFiredTriggers(Connection conn)
           Delete all volatile fired triggers.
 int insertCalendar(Connection conn, String calendarName, Calendar calendar)
           Insert a new calendar.
 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 insertTrigger(Connection conn, Trigger trigger, String state, JobDetail jobDetail)
           Insert the base trigger data.
 Trigger[] selectTriggersForRecoveringJobs(Connection conn)
           Select all of the triggers for jobs that are requesting recovery.
 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.
 int updateCalendar(Connection conn, String calendarName, Calendar calendar)
           Update a calendar.
 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 updateTrigger(Connection conn, Trigger trigger, String state, JobDetail jobDetail)
           Update the base trigger data.
 
Methods inherited from class org.quartz.impl.jdbcjobstore.StdJDBCDelegate
calendarExists, calendarIsReferenced, canUseProperties, convertFromProperty, convertToProperty, deleteAllPausedTriggerGroups, deleteBlobTrigger, deleteCalendar, deleteCronTrigger, deleteFiredTrigger, deleteFiredTriggers, deleteFiredTriggers, deleteJobDetail, deleteJobListeners, deletePausedTriggerGroup, deleteSchedulerState, deleteSimpleTrigger, deleteTrigger, deleteTriggerListeners, getJobDetailFromBlob, getObjectFromBlob, insertBlobTrigger, insertCronTrigger, insertJobListener, insertPausedTriggerGroup, insertSchedulerState, insertSimpleTrigger, insertTriggerListener, isExistingTriggerGroup, isJobStateful, isTriggerGroupPaused, jobExists, rtp, selectCalendar, selectCalendars, selectFiredTriggerRecords, selectFiredTriggerRecordsByJob, selectInstancesFiredTriggerRecords, selectJobDetail, selectJobExecutionCount, selectJobForTrigger, selectJobGroups, selectJobListeners, selectJobsInGroup, selectMisfiredTriggers, selectMisfiredTriggersInGroupInState, selectMisfiredTriggersInState, selectNextFireTime, selectNumCalendars, selectNumJobs, selectNumTriggers, selectNumTriggersForJob, selectPausedTriggerGroups, selectSchedulerStateRecords, selectStatefulJobsOfTriggerGroup, selectTrigger, selectTriggerForFireTime, selectTriggerGroups, selectTriggerJobDataMap, selectTriggerListeners, selectTriggerNamesForJob, selectTriggersForCalendar, selectTriggersForJob, selectTriggersInGroup, selectTriggersInState, selectTriggerState, selectTriggerStatus, serializeJobData, serializeObject, triggerExists, updateBlobTrigger, updateCronTrigger, updateSchedulerState, updateSimpleTrigger, updateTriggerGroupStateFromOtherState, updateTriggerGroupStateFromOtherStates, updateTriggerState, updateTriggerStateFromOtherState, updateTriggerStateFromOtherStates, updateTriggerStateFromOtherStatesBeforeTime, updateTriggerStatesForJob, updateTriggerStatesForJobFromOtherState, updateTriggerStatesFromOtherStates
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DB2v7Delegate

public DB2v7Delegate(org.apache.commons.logging.Log logger,
                     String tablePrefix,
                     String instanceId)

DB2v7Delegate

public DB2v7Delegate(org.apache.commons.logging.Log log,
                     String tablePrefix,
                     String instanceId,
                     Boolean useProperties)
Method Detail

selectTriggersForRecoveringJobs

public Trigger[] selectTriggersForRecoveringJobs(Connection conn)
                                          throws SQLException,
                                                 IOException,
                                                 ClassNotFoundException
Description copied from class: StdJDBCDelegate

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 Scheduler.DEFAULT_RECOVERY_GROUP trigger 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.

Specified by:
selectTriggersForRecoveringJobs in interface DriverDelegate
Overrides:
selectTriggersForRecoveringJobs in class StdJDBCDelegate
Parameters:
conn - the DB Connection
Returns:
an array of Trigger objects
Throws:
SQLException
IOException
ClassNotFoundException

insertJobDetail

public int insertJobDetail(Connection conn,
                           JobDetail job)
                    throws IOException,
                           SQLException
Description copied from class: StdJDBCDelegate

Insert the job detail record.

Specified by:
insertJobDetail in interface DriverDelegate
Overrides:
insertJobDetail in class StdJDBCDelegate
Parameters:
conn - the DB Connection
job - the job to insert
Returns:
number of rows inserted
Throws:
IOException - if there were problems serializing the JobDataMap
SQLException

updateJobDetail

public int updateJobDetail(Connection conn,
                           JobDetail job)
                    throws IOException,
                           SQLException
Description copied from class: StdJDBCDelegate

Update the job detail record.

Specified by:
updateJobDetail in interface DriverDelegate
Overrides:
updateJobDetail in class StdJDBCDelegate
Parameters:
conn - the DB Connection
job - the job to update
Returns:
number of rows updated
Throws:
IOException - if there were problems serializing the JobDataMap
SQLException

insertTrigger

public int insertTrigger(Connection conn,
                         Trigger trigger,
                         String state,
                         JobDetail jobDetail)
                  throws SQLException,
                         IOException
Description copied from class: StdJDBCDelegate

Insert the base trigger data.

Specified by:
insertTrigger in interface DriverDelegate
Overrides:
insertTrigger in class StdJDBCDelegate
Parameters:
conn - the DB Connection
trigger - the trigger to insert
state - the state that the trigger should be stored in
Returns:
the number of rows inserted
Throws:
SQLException
IOException

updateTrigger

public int updateTrigger(Connection conn,
                         Trigger trigger,
                         String state,
                         JobDetail jobDetail)
                  throws SQLException,
                         IOException
Description copied from class: StdJDBCDelegate

Update the base trigger data.

Specified by:
updateTrigger in interface DriverDelegate
Overrides:
updateTrigger in class StdJDBCDelegate
Parameters:
conn - the DB Connection
trigger - the trigger to insert
state - the state that the trigger should be stored in
Returns:
the number of rows updated
Throws:
SQLException
IOException

insertFiredTrigger

public int insertFiredTrigger(Connection conn,
                              Trigger trigger,
                              String state,
                              JobDetail job)
                       throws SQLException
Description copied from class: StdJDBCDelegate

Insert a fired trigger.

Specified by:
insertFiredTrigger in interface DriverDelegate
Overrides:
insertFiredTrigger in class StdJDBCDelegate
Parameters:
conn - the DB Connection
trigger - the trigger
state - the state that the trigger should be stored in
Returns:
the number of rows inserted
Throws:
SQLException

updateJobData

public int updateJobData(Connection conn,
                         JobDetail job)
                  throws IOException,
                         SQLException
Description copied from class: StdJDBCDelegate

Update the job data map for the given job.

Specified by:
updateJobData in interface DriverDelegate
Overrides:
updateJobData in class StdJDBCDelegate
Parameters:
conn - the DB Connection
job - the job to update
Returns:
the number of rows updated
Throws:
IOException
SQLException

insertCalendar

public int insertCalendar(Connection conn,
                          String calendarName,
                          Calendar calendar)
                   throws IOException,
                          SQLException
Description copied from class: StdJDBCDelegate

Insert a new calendar.

Specified by:
insertCalendar in interface DriverDelegate
Overrides:
insertCalendar in class StdJDBCDelegate
Parameters:
conn - the DB Connection
calendarName - the name for the new calendar
calendar - the calendar
Returns:
the number of rows inserted
Throws:
IOException - if there were problems serializing the calendar
SQLException

updateCalendar

public int updateCalendar(Connection conn,
                          String calendarName,
                          Calendar calendar)
                   throws IOException,
                          SQLException
Description copied from class: StdJDBCDelegate

Update a calendar.

Specified by:
updateCalendar in interface DriverDelegate
Overrides:
updateCalendar in class StdJDBCDelegate
Parameters:
conn - the DB Connection
calendarName - the name for the new calendar
calendar - the calendar
Returns:
the number of rows updated
Throws:
IOException - if there were problems serializing the calendar
SQLException

deleteVolatileFiredTriggers

public int deleteVolatileFiredTriggers(Connection conn)
                                throws SQLException
Description copied from interface: DriverDelegate

Delete all volatile fired triggers.

Specified by:
deleteVolatileFiredTriggers in interface DriverDelegate
Overrides:
deleteVolatileFiredTriggers in class StdJDBCDelegate
Throws:
SQLException

selectVolatileTriggers

public Key[] selectVolatileTriggers(Connection conn)
                             throws SQLException
Description copied from interface: DriverDelegate

Get the names of all of the triggers that are volatile.

Specified by:
selectVolatileTriggers in interface DriverDelegate
Overrides:
selectVolatileTriggers in class StdJDBCDelegate
Throws:
SQLException

selectVolatileJobs

public Key[] selectVolatileJobs(Connection conn)
                         throws SQLException
Description copied from interface: DriverDelegate

Get the names of all of the jobs that are volatile.

Specified by:
selectVolatileJobs in interface DriverDelegate
Overrides:
selectVolatileJobs in class StdJDBCDelegate
Throws:
SQLException

Quartz Enterprise Job Scheduler Project Page