Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.quartz.impl.jdbcjobstore
Class JobStoreSupport

    java.lang.Object
      org.quartz.impl.jdbcjobstore.JobStoreSupport

All Implemented Interfaces:
  Constants, JobStore

Direct Known Subclasses:
  JobStoreCMT, JobStoreTX

public abstract class JobStoreSupport
extends Object
implements JobStore, Constants

Contains base functionality for JDBC-based JobStore implementations.

Author:
  Jeffrey Wescott, James House

Field Summary
`protected HashMap` | `calendarCache`
`protected Class` | `delegateClass`
`protected String` | `delegateClassName`
`protected String` | `dsName`
`protected boolean` | `firstCheckIn`
`protected String` | `instanceId`
`protected String` | `instanceName`
`protected long` | `lastCheckin`
`protected static String` | `LOCK_CALENDAR_ACCESS`
`protected static String` | `LOCK_JOB_ACCESS`
`protected static String` | `LOCK_MISFIRE_ACCESS`
`protected static String` | `LOCK_STATE_ACCESS`
`protected static String` | `LOCK_TRIGGER_ACCESS`
`protected int` | `maxToRecoverAtATime`
`protected String` | `tablePrefix`
`protected boolean` | `useProperties`

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
`JobStoreSupport()`

Method Summary
`protected Trigger` | `acquireNextTrigger(Connection conn, SchedulingContext ctxt, long noLaterThan)`
`protected long` | `calcFailedIfAfter(SchedulerStateRecord rec)`
`protected boolean` | `calendarExists(Connection conn, String calName)`
`boolean` | `canUseProperties()` Get whether String-only properties will be handled in JobDataMaps.
`protected abstract void` | `cleanVolatileTriggerAndJobs()` Removes all volatile data
`protected void` | `cleanVolatileTriggerAndJobs(Connection conn)` Removes all volatile data.
`protected void` | `closeConnection(Connection conn)` Closes the supplied connection
`protected List` | `clusterCheckIn(Connection conn)`
`protected void` | `clusterRecover(Connection conn, List failedInstances)`
`protected void` | `commitConnection(Connection conn)` Commit the supplied connection
`protected abstract boolean` | `doCheckin()`
`protected abstract boolean` | `doRecoverMisfires()`
`protected List` | `findFailedInstances(Connection conn)` Get a list of all scheduler instances in the cluster that may have failed.
`protected String[]` | `getCalendarNames(Connection conn, SchedulingContext ctxt)`
`protected ClassLoadHelper` | `getClassLoadHelper()`
`long` | `getClusterCheckinInterval()` Get the frequency (in milliseconds) at which this instance "checks-in" with the other instances of the cluster.
`protected Connection` | `getConnection()`
`String` | `getDataSource()` Get the name of the `DataSource` that should be used for performing database functions.
`long` | `getDbRetryInterval()`
`protected DriverDelegate` | `getDelegate()` Get the driver delegate for DB operations.
`String` | `getDriverDelegateClass()` Get the JDBC driver delegate class name.
`protected String` | `getFiredTriggerRecordId()`
`String` | `getInstanceId()` Get the instance Id of the Scheduler (must be unique within a cluster).
`String` | `getInstanceName()` Get the instance Id of the Scheduler (must be unique within a cluster).
`protected String[]` | `getJobGroupNames(Connection conn, SchedulingContext ctxt)`
`protected String[]` | `getJobNames(Connection conn, SchedulingContext ctxt, String groupName)`
`protected Semaphore` | `getLockHandler()`
`int` | `getMaxMisfiresToHandleAtATime()` Get the maximum number of misfired triggers that the misfire handling thread will try to recover at one time (within one transaction).
`long` | `getMisfireThreshold()`
`protected long` | `getMisfireTime()`
`protected String` | `getNewStatusForTrigger(Connection conn, SchedulingContext ctxt, String jobName, String groupName)`
`protected int` | `getNumberOfCalendars(Connection conn, SchedulingContext ctxt)`
`protected int` | `getNumberOfJobs(Connection conn, SchedulingContext ctxt)`
`protected int` | `getNumberOfTriggers(Connection conn, SchedulingContext ctxt)`
`Set` | `getPausedTriggerGroups(Connection conn, SchedulingContext ctxt)` Pause all of the ``Trigger`s` in the given group.
`String` | `getSelectWithLockSQL()`
`protected String` | `getStatusForResumedTrigger(Connection conn, SchedulingContext ctxt, TriggerStatus status)`
`String` | `getTablePrefix()` Get the prefix that should be pre-pended to all table names.
`protected String[]` | `getTriggerGroupNames(Connection conn, SchedulingContext ctxt)`
`protected String[]` | `getTriggerNames(Connection conn, SchedulingContext ctxt, String groupName)`
`protected Trigger[]` | `getTriggersForJob(Connection conn, SchedulingContext ctxt, String jobName, String groupName)`
`int` | `getTriggerState(Connection conn, SchedulingContext ctxt, String triggerName, String groupName)`
`boolean` | `getUseDBLocks()` Get whether this instance should use database-based thread synchronization.
`void` | `initialize(ClassLoadHelper loadHelper, SchedulerSignaler signaler)` Called by the QuartzScheduler before the `JobStore` is used, in order to give the it a chance to initialize.
`boolean` | `isClustered()` Get whether this instance is part of a cluster.
`boolean` | `isDontSetAutoCommitFalse()`
`boolean` | `isLockOnInsert()`
`boolean` | `isTxIsolationLevelSerializable()`
`protected boolean` | `jobExists(Connection conn, String jobName, String groupName)` Check existence of a given job.
`protected void` | `logWarnIfNonZero(int val, String warning)`
`void` | `pauseAll(Connection conn, SchedulingContext ctxt)` Pause all triggers - equivalent of calling `pauseTriggerGroup(group)` on every group.
`void` | `pauseTrigger(Connection conn, SchedulingContext ctxt, String triggerName, String groupName)` Pause the ``Trigger`` with the given name.
`void` | `pauseTriggerGroup(Connection conn, SchedulingContext ctxt, String groupName)` Pause all of the ``Trigger`s` in the given group.
`protected abstract void` | `recoverJobs()` Will recover any failed or misfired jobs and clean up the data store as appropriate.
`protected void` | `recoverJobs(Connection conn)` Will recover any failed or misfired jobs and clean up the data store as appropriate.
`protected boolean` | `recoverMisfiredJobs(Connection conn, boolean recovering)`
`protected void` | `releaseAcquiredTrigger(Connection conn, SchedulingContext ctxt, Trigger trigger)`
`protected void` | `releaseLock(Connection conn, String lockName, boolean doIt)`
`protected boolean` | `removeCalendar(Connection conn, SchedulingContext ctxt, String calName)`
`protected boolean` | `removeJob(Connection conn, SchedulingContext ctxt, String jobName, String groupName, boolean activeDeleteSafe)`
`protected boolean` | `removeTrigger(Connection conn, SchedulingContext ctxt, String triggerName, String groupName)`
`protected boolean` | `replaceTrigger(Connection conn, SchedulingContext ctxt, String triggerName, String groupName, Trigger newTrigger)`
`void` | `resumeAll(Connection conn, SchedulingContext ctxt)` protected
`void` | `resumeTrigger(Connection conn, SchedulingContext ctxt, String triggerName, String groupName)` Resume (un-pause) the ``Trigger`` with the given name.
`void` | `resumeTriggerGroup(Connection conn, SchedulingContext ctxt, String groupName)` Resume (un-pause) all of the ``Trigger`s` in the given group.
`protected Calendar` | `retrieveCalendar(Connection conn, SchedulingContext ctxt, String calName)`
`protected JobDetail` | `retrieveJob(Connection conn, SchedulingContext ctxt, String jobName, String groupName)`
`protected Trigger` | `retrieveTrigger(Connection conn, SchedulingContext ctxt, String triggerName, String groupName)`
`protected void` | `rollbackConnection(Connection conn)` Rollback the supplied connection
`void` | `schedulerStarted()` Called by the QuartzScheduler to inform the `JobStore` that the scheduler has started.
`void` | `setClusterCheckinInterval(long l)` Set the frequency (in milliseconds) at which this instance "checks-in" with the other instances of the cluster.
`void` | `setDataSource(String dsName)` Set the name of the `DataSource` that should be used for performing database functions.
`void` | `setDbRetryInterval(long dbRetryInterval)`
`void` | `setDontSetAutoCommitFalse(boolean b)` Don't call set autocommit(false) on connections obtained from the DataSource.
`void` | `setDriverDelegateClass(String delegateClassName)` Set the JDBC driver delegate class.
`void` | `setInstanceId(String instanceId)` Set the instance Id of the Scheduler (must be unique within a cluster).
`void` | `setInstanceName(String instanceName)` Set the instance Id of the Scheduler (must be unique within a cluster).
`void` | `setIsClustered(boolean isClustered)` Set whether this instance is part of a cluster.
`void` | `setLockOnInsert(boolean lockOnInsert)` Whether or not to obtain locks when inserting new jobs/triggers.
`void` | `setMaxMisfiresToHandleAtATime(int maxToRecoverAtATime)` Set the maximum number of misfired triggers that the misfire handling thread will try to recover at one time (within one transaction).
`void` | `setMisfireThreshold(long misfireThreshold)` The the number of milliseconds by which a trigger must have missed its next-fire-time, in order for it to be considered "misfired" and thus have its misfire instruction applied.
`void` | `setSelectWithLockSQL(String string)` set the SQL statement to use to select and lock a row in the "locks" table.
`void` | `setTablePrefix(String prefix)` Set the prefix that should be pre-pended to all table names.
`void` | `setTxIsolationLevelSerializable(boolean b)` Set the transaction isolation level of DB connections to sequential.
`void` | `setUseDBLocks(boolean useDBLocks)` Set whether this instance should use database-based thread synchronization.
`void` | `setUseProperties(String useProp)` Set whether String-only properties will be handled in JobDataMaps.
`void` | `shutdown()` Called by the QuartzScheduler to inform the `JobStore` that it should free up all of it's resources because the scheduler is shutting down.
`protected void` | `signalSchedulingChange()`
`protected void` | `storeCalendar(Connection conn, SchedulingContext ctxt, String calName, Calendar calendar, boolean replaceExisting, boolean updateTriggers)`
`protected void` | `storeJob(Connection conn, SchedulingContext ctxt, JobDetail newJob, boolean replaceExisting)` Insert or update a job.
`protected void` | `storeTrigger(Connection conn, SchedulingContext ctxt, Trigger newTrigger, JobDetail job, boolean replaceExisting, String state, boolean forceState, boolean recovering)` Insert or update a trigger.
`boolean` | `supportsPersistence()`
`protected void` | `triggeredJobComplete(Connection conn, SchedulingContext ctxt, Trigger trigger, JobDetail jobDetail, int triggerInstCode)`
`protected boolean` | `triggerExists(Connection conn, String triggerName, String groupName)` Check existence of a given trigger.
`protected TriggerFiredBundle` | `triggerFired(Connection conn, SchedulingContext ctxt, Trigger trigger)`
`protected boolean` | `updateMisfiredTrigger(Connection conn, SchedulingContext ctxt, String triggerName, String groupName, String newStateIfNotComplete, boolean forceState)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface org.quartz.spi.JobStore
`acquireNextTrigger, getCalendarNames, getJobGroupNames, getJobNames, getNumberOfCalendars, getNumberOfJobs, getNumberOfTriggers, getPausedTriggerGroups, getTriggerGroupNames, getTriggerNames, getTriggersForJob, getTriggerState, pauseAll, pauseJob, pauseJobGroup, pauseTrigger, pauseTriggerGroup, releaseAcquiredTrigger, removeCalendar, removeJob, removeTrigger, replaceTrigger, resumeAll, resumeJob, resumeJobGroup, resumeTrigger, resumeTriggerGroup, retrieveCalendar, retrieveJob, retrieveTrigger, storeCalendar, storeJob, storeJobAndTrigger, storeTrigger, triggeredJobComplete, triggerFired`

Field Detail

### LOCK_TRIGGER_ACCESS

    protected static String LOCK_TRIGGER_ACCESS

### LOCK_JOB_ACCESS

    protected static String LOCK_JOB_ACCESS

### LOCK_CALENDAR_ACCESS

    protected static String LOCK_CALENDAR_ACCESS

### LOCK_STATE_ACCESS

    protected static String LOCK_STATE_ACCESS

### LOCK_MISFIRE_ACCESS

    protected static String LOCK_MISFIRE_ACCESS

### dsName

    protected String dsName

### tablePrefix

    protected String tablePrefix

### useProperties

    protected boolean useProperties

### instanceId

    protected String instanceId

### instanceName

    protected String instanceName

### delegateClassName

    protected String delegateClassName

### delegateClass

    protected Class delegateClass

### calendarCache

    protected HashMap calendarCache

### maxToRecoverAtATime

    protected int maxToRecoverAtATime

### firstCheckIn

    protected boolean firstCheckIn

### lastCheckin

    protected long lastCheckin

Constructor Detail

### JobStoreSupport

    public JobStoreSupport()

Method Detail

### setDataSource

    public void setDataSource(String dsName)

  Set the name of the `DataSource` that should be used for performing database functions.

### getDataSource

    public String getDataSource()

  Get the name of the `DataSource` that should be used for performing database functions.

### setTablePrefix

    public void setTablePrefix(String prefix)

  Set the prefix that should be pre-pended to all table names.

### getTablePrefix

    public String getTablePrefix()

  Get the prefix that should be pre-pended to all table names.

### setUseProperties

    public void setUseProperties(String useProp)

  Set whether String-only properties will be handled in JobDataMaps.

### canUseProperties

    public boolean canUseProperties()

  Get whether String-only properties will be handled in JobDataMaps.

### setInstanceId

    public void setInstanceId(String instanceId)

  Set the instance Id of the Scheduler (must be unique within a cluster).

### getInstanceId

    public String getInstanceId()

  Get the instance Id of the Scheduler (must be unique within a cluster).

### setInstanceName

    public void setInstanceName(String instanceName)

  Set the instance Id of the Scheduler (must be unique within a cluster).

### getInstanceName

    public String getInstanceName()

  Get the instance Id of the Scheduler (must be unique within a cluster).

### setIsClustered

    public void setIsClustered(boolean isClustered)

  Set whether this instance is part of a cluster.

### isClustered

    public boolean isClustered()

  Get whether this instance is part of a cluster.

### getClusterCheckinInterval

    public long getClusterCheckinInterval()

  Get the frequency (in milliseconds) at which this instance "checks-in" with the other instances of the cluster. -- Affects the rate of detecting failed instances.

### setClusterCheckinInterval

    public void setClusterCheckinInterval(long l)

  Set the frequency (in milliseconds) at which this instance "checks-in" with the other instances of the cluster. -- Affects the rate of detecting failed instances.

### getMaxMisfiresToHandleAtATime

    public int getMaxMisfiresToHandleAtATime()

  Get the maximum number of misfired triggers that the misfire handling thread will try to recover at one time (within one transaction). The default is 20.

### setMaxMisfiresToHandleAtATime

    public void setMaxMisfiresToHandleAtATime(int maxToRecoverAtATime)

  Set the maximum number of misfired triggers that the misfire handling thread will try to recover at one time (within one transaction). The default is 20.

### getDbRetryInterval

    public long getDbRetryInterval()

  Returns:
    Returns the dbRetryInterval.

### setDbRetryInterval

    public void setDbRetryInterval(long dbRetryInterval)

  Parameters:
    `dbRetryInterval` - The dbRetryInterval to set.

### setUseDBLocks

    public void setUseDBLocks(boolean useDBLocks)

  Set whether this instance should use database-based thread synchronization.

### getUseDBLocks

    public boolean getUseDBLocks()

  Get whether this instance should use database-based thread synchronization.

### isLockOnInsert

    public boolean isLockOnInsert()

### setLockOnInsert

    public void setLockOnInsert(boolean lockOnInsert)

  Whether or not to obtain locks when inserting new jobs/triggers. Defaults to `true`, which is safest - some db's (such as MS SQLServer) seem to require this to avoid deadlocks under high load, while others seem to do fine without.

  Setting this property to `false` will provide a significant performance increase during the addition of new jobs and triggers.

  Parameters:
    `lockOnInsert` -

### getMisfireThreshold

    public long getMisfireThreshold()

### setMisfireThreshold

    public void setMisfireThreshold(long misfireThreshold)

  The the number of milliseconds by which a trigger must have missed its next-fire-time, in order for it to be considered "misfired" and thus have its misfire instruction applied.

  Parameters:
    `misfireThreshold` -

### isDontSetAutoCommitFalse

    public boolean isDontSetAutoCommitFalse()

### setDontSetAutoCommitFalse

    public void setDontSetAutoCommitFalse(boolean b)

  Don't call set autocommit(false) on connections obtained from the DataSource. This can be helpfull in a few situations, such as if you have a driver that complains if it is called when it is already off.

  Parameters:
    `b` -

### isTxIsolationLevelSerializable

    public boolean isTxIsolationLevelSerializable()

### setTxIsolationLevelSerializable

    public void setTxIsolationLevelSerializable(boolean b)

  Set the transaction isolation level of DB connections to sequential.

  Parameters:
    `b` -

### setDriverDelegateClass

    public void setDriverDelegateClass(String delegateClassName)
                                throws InvalidConfigurationException

  Set the JDBC driver delegate class.

  Parameters:
    `delegateClassName` - the delegate class name
  Throws:
    `InvalidConfigurationException`

### getDriverDelegateClass

    public String getDriverDelegateClass()

  Get the JDBC driver delegate class name.

  Returns:
    the delegate class name

### getSelectWithLockSQL

    public String getSelectWithLockSQL()

### setSelectWithLockSQL

    public void setSelectWithLockSQL(String string)

  set the SQL statement to use to select and lock a row in the "locks" table.

  See Also:
    `StdRowLockSemaphore`

### getClassLoadHelper

    protected ClassLoadHelper getClassLoadHelper()

### initialize

    public void initialize(ClassLoadHelper loadHelper,
                           SchedulerSignaler signaler)
                    throws SchedulerConfigException

  Called by the QuartzScheduler before the `JobStore` is used, in order to give the it a chance to initialize.

  Specified by:
    `initialize` in interface `JobStore`
  Throws:
    `SchedulerConfigException`

### schedulerStarted

    public void schedulerStarted()
                          throws SchedulerException

  Description copied from interface: `JobStore`

  Called by the QuartzScheduler to inform the `JobStore` that the scheduler has started.

  Specified by:
    `schedulerStarted` in interface `JobStore`
  Throws:
    `SchedulerException`
  See Also:
    `JobStore.schedulerStarted()`

### shutdown

    public void shutdown()

  Called by the QuartzScheduler to inform the `JobStore` that it should free up all of it's resources because the scheduler is shutting down.

  Specified by:
    `shutdown` in interface `JobStore`

### supportsPersistence

    public boolean supportsPersistence()

  Specified by:
    `supportsPersistence` in interface `JobStore`

### getConnection

    protected Connection getConnection()
                                throws JobPersistenceException

  Throws:
    `JobPersistenceException`

### releaseLock

    protected void releaseLock(Connection conn,
                               String lockName,
                               boolean doIt)

### cleanVolatileTriggerAndJobs

    protected abstract void cleanVolatileTriggerAndJobs()
                                                 throws JobPersistenceException

  Removes all volatile data

  Throws:
    `JobPersistenceException` - if jobs could not be recovered

### cleanVolatileTriggerAndJobs

    protected void cleanVolatileTriggerAndJobs(Connection conn)
                                        throws JobPersistenceException

  Removes all volatile data.

  Throws:
    `JobPersistenceException` - if jobs could not be recovered

### recoverJobs

    protected abstract void recoverJobs()
                                 throws JobPersistenceException

  Will recover any failed or misfired jobs and clean up the data store as appropriate.

  Throws:
    `JobPersistenceException` - if jobs could not be recovered

### recoverJobs

    protected void recoverJobs(Connection conn)
                        throws JobPersistenceException

  Will recover any failed or misfired jobs and clean up the data store as appropriate.

  Throws:
    `JobPersistenceException` - if jobs could not be recovered

### getMisfireTime

    protected long getMisfireTime()

### recoverMisfiredJobs

    protected boolean recoverMisfiredJobs(Connection conn,
                                          boolean recovering)
                                   throws JobPersistenceException,
                                          NoSuchDelegateException,
                                          SQLException,
                                          ClassNotFoundException,
                                          IOException

  Throws:
    `JobPersistenceException`
    `NoSuchDelegateException`
    `SQLException`
    `ClassNotFoundException`
    `IOException`

### updateMisfiredTrigger

    protected boolean updateMisfiredTrigger(Connection conn,
                                            SchedulingContext ctxt,
                                            String triggerName,
                                            String groupName,
                                            String newStateIfNotComplete,
                                            boolean forceState)
                                     throws JobPersistenceException

  Throws:
    `JobPersistenceException`

### storeJob

    protected void storeJob(Connection conn,
                            SchedulingContext ctxt,
                            JobDetail newJob,
                            boolean replaceExisting)
                     throws ObjectAlreadyExistsException,
                            JobPersistenceException

  Insert or update a job.

  Throws:
    `ObjectAlreadyExistsException`
    `JobPersistenceException`

### jobExists

    protected boolean jobExists(Connection conn,
                                String jobName,
                                String groupName)
                         throws JobPersistenceException

  Check existence of a given job.

  Throws:
    `JobPersistenceException`

### storeTrigger

    protected void storeTrigger(Connection conn,
                                SchedulingContext ctxt,
                                Trigger newTrigger,
                                JobDetail job,
                                boolean replaceExisting,
                                String state,
                                boolean forceState,
                                boolean recovering)
                         throws ObjectAlreadyExistsException,
                                JobPersistenceException

  Insert or update a trigger.

  Throws:
    `ObjectAlreadyExistsException`
    `JobPersistenceException`

### triggerExists

    protected boolean triggerExists(Connection conn,
                                    String triggerName,
                                    String groupName)
                             throws JobPersistenceException

  Check existence of a given trigger.

  Throws:
    `JobPersistenceException`

### removeJob

    protected boolean removeJob(Connection conn,
                                SchedulingContext ctxt,
                                String jobName,
                                String groupName,
                                boolean activeDeleteSafe)
                         throws JobPersistenceException

  Throws:
    `JobPersistenceException`

### retrieveJob

    protected JobDetail retrieveJob(Connection conn,
                                    SchedulingContext ctxt,
                                    String jobName,
                                    String groupName)
                             throws JobPersistenceException

  Throws:
    `JobPersistenceException`

### removeTrigger

    protected boolean removeTrigger(Connection conn,
                                    SchedulingContext ctxt,
                                    String triggerName,
                                    String groupName)
                             throws JobPersistenceException

  Throws:
    `JobPersistenceException`

### replaceTrigger

    protected boolean replaceTrigger(Connection conn,
                                     SchedulingContext ctxt,
                                     String triggerName,
                                     String groupName,
                                     Trigger newTrigger)
                              throws JobPersistenceException

  Throws:
    `JobPersistenceException`

### retrieveTrigger

    protected Trigger retrieveTrigger(Connection conn,
                                      SchedulingContext ctxt,
                                      String triggerName,
                                      String groupName)
                               throws JobPersistenceException

  Throws:
    `JobPersistenceException`

### getTriggerState

    public int getTriggerState(Connection conn,
                               SchedulingContext ctxt,
                               String triggerName,
                               String groupName)
                        throws JobPersistenceException

  Throws:
    `JobPersistenceException`

### storeCalendar

    protected void storeCalendar(Connection conn,
                                 SchedulingContext ctxt,
                                 String calName,
                                 Calendar calendar,
                                 boolean replaceExisting,
                                 boolean updateTriggers)
                          throws ObjectAlreadyExistsException,
                                 JobPersistenceException

  Throws:
    `ObjectAlreadyExistsException`
    `JobPersistenceException`

### calendarExists

    protected boolean calendarExists(Connection conn,
                                     String calName)
                              throws JobPersistenceException

  Throws:
    `JobPersistenceException`

### removeCalendar

    protected boolean removeCalendar(Connection conn,
                                     SchedulingContext ctxt,
                                     String calName)
                              throws JobPersistenceException

  Throws:
    `JobPersistenceException`

### retrieveCalendar

    protected Calendar retrieveCalendar(Connection conn,
                                        SchedulingContext ctxt,
                                        String calName)
                                 throws JobPersistenceException

  Throws:
    `JobPersistenceException`

### getNumberOfJobs

    protected int getNumberOfJobs(Connection conn,
                                  SchedulingContext ctxt)
                           throws JobPersistenceException

  Throws:
    `JobPersistenceException`

### getNumberOfTriggers

    protected int getNumberOfTriggers(Connection conn,
                                      SchedulingContext ctxt)
                               throws JobPersistenceException

  Throws:
    `JobPersistenceException`

### getNumberOfCalendars

    protected int getNumberOfCalendars(Connection conn,
                                       SchedulingContext ctxt)
                                throws JobPersistenceException

  Throws:
    `JobPersistenceException`

### getJobNames

    protected String[] getJobNames(Connection conn,
                                   SchedulingContext ctxt,
                                   String groupName)
                            throws JobPersistenceException

  Throws:
    `JobPersistenceException`

### getTriggerNames

    protected String[] getTriggerNames(Connection conn,
                                       SchedulingContext ctxt,
                                       String groupName)
                                throws JobPersistenceException

  Throws:
    `JobPersistenceException`

### getJobGroupNames

    protected String[] getJobGroupNames(Connection conn,
                                        SchedulingContext ctxt)
                                 throws JobPersistenceException

  Throws:
    `JobPersistenceException`

### getTriggerGroupNames

    protected String[] getTriggerGroupNames(Connection conn,
                                            SchedulingContext ctxt)
                                     throws JobPersistenceException

  Throws:
    `JobPersistenceException`

### getCalendarNames

    protected String[] getCalendarNames(Connection conn,
                                        SchedulingContext ctxt)
                                 throws JobPersistenceException

  Throws:
    `JobPersistenceException`

### getTriggersForJob

    protected Trigger[] getTriggersForJob(Connection conn,
                                          SchedulingContext ctxt,
                                          String jobName,
                                          String groupName)
                                   throws JobPersistenceException

  Throws:
    `JobPersistenceException`

### pauseTrigger

    public void pauseTrigger(Connection conn,
                             SchedulingContext ctxt,
                             String triggerName,
                             String groupName)
                      throws JobPersistenceException

  Pause the ``Trigger`` with the given name.

  Throws:
    `JobPersistenceException`
  See Also:
    `resumeTrigger(Connection, SchedulingContext, String, String)`

### getStatusForResumedTrigger

    protected String getStatusForResumedTrigger(Connection conn,
                                                SchedulingContext ctxt,
                                                TriggerStatus status)
                                         throws JobPersistenceException

  Throws:
    `JobPersistenceException`

### getNewStatusForTrigger

    protected String getNewStatusForTrigger(Connection conn,
                                            SchedulingContext ctxt,
                                            String jobName,
                                            String groupName)
                                     throws JobPersistenceException

  Throws:
    `JobPersistenceException`

### resumeTrigger

    public void resumeTrigger(Connection conn,
                              SchedulingContext ctxt,
                              String triggerName,
                              String groupName)
                       throws JobPersistenceException

  Resume (un-pause) the ``Trigger`` with the given name.

  If the `Trigger` missed one or more fire-times, then the `Trigger`'s misfire instruction will be applied.

  Throws:
    `JobPersistenceException`
  See Also:
    `pauseTrigger(Connection, SchedulingContext, String, String)`

### pauseTriggerGroup

    public void pauseTriggerGroup(Connection conn,
                                  SchedulingContext ctxt,
                                  String groupName)
                           throws JobPersistenceException

  Pause all of the ``Trigger`s` in the given group.

  Throws:
    `JobPersistenceException`
  See Also:
    `resumeTriggerGroup(Connection, SchedulingContext, String)`

### getPausedTriggerGroups

    public Set getPausedTriggerGroups(Connection conn,
                                      SchedulingContext ctxt)
                               throws JobPersistenceException

  Pause all of the ``Trigger`s` in the given group.

  Throws:
    `JobPersistenceException`
  See Also:
    `resumeTriggerGroup(Connection, SchedulingContext, String)`

### resumeTriggerGroup

    public void resumeTriggerGroup(Connection conn,
                                   SchedulingContext ctxt,
                                   String groupName)
                            throws JobPersistenceException

  Resume (un-pause) all of the ``Trigger`s` in the given group.

  If any `Trigger` missed one or more fire-times, then the `Trigger`'s misfire instruction will be applied.

  Throws:
    `JobPersistenceException`
  See Also:
    `pauseTriggerGroup(Connection, SchedulingContext, String)`

### pauseAll

    public void pauseAll(Connection conn,
                         SchedulingContext ctxt)
                  throws JobPersistenceException

  Pause all triggers - equivalent of calling `pauseTriggerGroup(group)` on every group.

  When `resumeAll()` is called (to un-pause), trigger misfire instructions WILL be applied.

  Throws:
    `JobPersistenceException`
  See Also:
    `JobStore.resumeAll(SchedulingContext)`, `JobStore.pauseTriggerGroup(SchedulingContext, String)`

### resumeAll

    public void resumeAll(Connection conn,
                          SchedulingContext ctxt)
                   throws JobPersistenceException

  protected

  Resume (un-pause) all triggers - equivalent of calling `resumeTriggerGroup(group)` on every group.

  If any `Trigger` missed one or more fire-times, then the `Trigger`'s misfire instruction will be applied.

  Throws:
    `JobPersistenceException`
  See Also:
    `JobStore.pauseAll(SchedulingContext)`

### getFiredTriggerRecordId

    protected String getFiredTriggerRecordId()

### acquireNextTrigger

    protected Trigger acquireNextTrigger(Connection conn,
                                         SchedulingContext ctxt,
                                         long noLaterThan)
                                  throws JobPersistenceException

  Throws:
    `JobPersistenceException`

### releaseAcquiredTrigger

    protected void releaseAcquiredTrigger(Connection conn,
                                          SchedulingContext ctxt,
                                          Trigger trigger)
                                   throws JobPersistenceException

  Throws:
    `JobPersistenceException`

### triggerFired

    protected TriggerFiredBundle triggerFired(Connection conn,
                                              SchedulingContext ctxt,
                                              Trigger trigger)
                                       throws JobPersistenceException

  Throws:
    `JobPersistenceException`

### triggeredJobComplete

    protected void triggeredJobComplete(Connection conn,
                                        SchedulingContext ctxt,
                                        Trigger trigger,
                                        JobDetail jobDetail,
                                        int triggerInstCode)
                                 throws JobPersistenceException

  Throws:
    `JobPersistenceException`

### getDelegate

    protected DriverDelegate getDelegate()
                                  throws NoSuchDelegateException

  Get the driver delegate for DB operations.

  Throws:
    `NoSuchDelegateException`

### getLockHandler

    protected Semaphore getLockHandler()

### doRecoverMisfires

    protected abstract boolean doRecoverMisfires()
                                          throws JobPersistenceException

  Throws:
    `JobPersistenceException`

### signalSchedulingChange

    protected void signalSchedulingChange()

### doCheckin

    protected abstract boolean doCheckin()
                                  throws JobPersistenceException

  Throws:
    `JobPersistenceException`

### findFailedInstances

    protected List findFailedInstances(Connection conn)
                                throws JobPersistenceException

  Get a list of all scheduler instances in the cluster that may have failed. This includes this scheduler if it has no recoverer and is checking for the first time.

  Throws:
    `JobPersistenceException`

### calcFailedIfAfter

    protected long calcFailedIfAfter(SchedulerStateRecord rec)

### clusterCheckIn

    protected List clusterCheckIn(Connection conn)
                           throws JobPersistenceException

  Throws:
    `JobPersistenceException`

### clusterRecover

    protected void clusterRecover(Connection conn,
                                  List failedInstances)
                           throws JobPersistenceException

  Throws:
    `JobPersistenceException`

### logWarnIfNonZero

    protected void logWarnIfNonZero(int val,
                                    String warning)

### closeConnection

    protected void closeConnection(Connection conn)
                            throws JobPersistenceException

  Closes the supplied connection

  Parameters:
    `conn` - (Optional)
  Throws:
    `JobPersistenceException` - thrown if a SQLException occurs when the connection is closed

### rollbackConnection

    protected void rollbackConnection(Connection conn)
                               throws JobPersistenceException

  Rollback the supplied connection

  Parameters:
    `conn` - (Optional)
  Throws:
    `JobPersistenceException` - thrown if a SQLException occurs when the connection is rolled back

### commitConnection

    protected void commitConnection(Connection conn)
                             throws JobPersistenceException

  Commit the supplied connection

  Parameters:
    `conn` - (Optional)
  Throws:
    `JobPersistenceException` - thrown if a SQLException occurs when the connection is committed

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Quartz Enterprise Job Scheduler Project Page
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD