Codota Logo
DriverDelegate
Code IndexAdd Codota to your IDE (free)

How to use
DriverDelegate
in
org.quartz.impl.jdbcjobstore

Best Java code snippets using org.quartz.impl.jdbcjobstore.DriverDelegate (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
BufferedReader b =
  • Codota IconInputStream in;new BufferedReader(new InputStreamReader(in))
  • Codota IconReader in;new BufferedReader(in)
  • Codota IconFile file;new BufferedReader(new FileReader(file))
  • Smart code suggestions by Codota
}
origin: quartz-scheduler/quartz

protected boolean calendarExists(Connection conn, String calName)
  throws JobPersistenceException {
  try {
    return getDelegate().calendarExists(conn, calName);
  } catch (SQLException e) {
    throw new JobPersistenceException(
        "Couldn't determine calendar existence (" + calName + "): "
            + e.getMessage(), e);
  }
}
origin: quartz-scheduler/quartz

protected boolean removeCalendar(Connection conn, 
    String calName) throws JobPersistenceException {
  try {
    if (getDelegate().calendarIsReferenced(conn, calName)) { 
      throw new JobPersistenceException(
        "Calender cannot be removed if it referenced by a trigger!"); 
    }
    if (!isClustered) {
      calendarCache.remove(calName);
    }
    return (getDelegate().deleteCalendar(conn, calName) > 0);
  } catch (SQLException e) {
    throw new JobPersistenceException("Couldn't remove calendar: "
        + e.getMessage(), e);
  }
}
origin: quartz-scheduler/quartz

protected void releaseAcquiredTrigger(Connection conn,
    OperableTrigger trigger)
  throws JobPersistenceException {
  try {
    getDelegate().updateTriggerStateFromOtherState(conn,
        trigger.getKey(), STATE_WAITING, STATE_ACQUIRED);
    getDelegate().deleteFiredTrigger(conn, trigger.getFireInstanceId());
  } catch (SQLException e) {
    throw new JobPersistenceException(
        "Couldn't release acquired trigger: " + e.getMessage(), e);
  }
}
origin: quartz-scheduler/quartz

getDelegate().deletePausedTriggerGroup(conn, matcher);
HashSet<String> groups = new HashSet<String>();
Set<TriggerKey> keys = getDelegate().selectTriggersInGroup(conn,
    matcher);
origin: quartz-scheduler/quartz

  .selectInstancesFiredTriggerRecords(conn,
      rec.getSchedulerInstanceId());
      .updateTriggerStatesForJobFromOtherState(
          conn, jKey,
          STATE_WAITING, STATE_BLOCKED);
} else if (ftRec.getFireInstanceState().equals(STATE_PAUSED_BLOCKED)) {
  getDelegate()
      .updateTriggerStatesForJobFromOtherState(
          conn, jKey,
          STATE_PAUSED, STATE_PAUSED_BLOCKED);
  getDelegate().updateTriggerStateFromOtherState(
      conn, tKey, STATE_WAITING,
      STATE_ACQUIRED);
    rcvryTrig.setMisfireInstruction(SimpleTrigger.MISFIRE_INSTRUCTION_IGNORE_MISFIRE_POLICY);
    rcvryTrig.setPriority(ftRec.getPriority());
    JobDataMap jd = getDelegate().selectTriggerJobDataMap(conn, tKey.getName(), tKey.getGroup());
    jd.put(Scheduler.FAILED_JOB_ORIGINAL_TRIGGER_NAME, tKey.getName());
    jd.put(Scheduler.FAILED_JOB_ORIGINAL_TRIGGER_GROUP, tKey.getGroup());
      .updateTriggerStatesForJobFromOtherState(
          conn, jKey,
          STATE_WAITING, STATE_BLOCKED);
  getDelegate()
      .updateTriggerStatesForJobFromOtherState(
          conn, jKey,
          STATE_PAUSED, STATE_PAUSED_BLOCKED);
origin: quartz-scheduler/quartz

    TriggerStatus stat = getDelegate().selectTriggerStatus(
        conn, trigger.getKey());
    if(stat != null && stat.getNextFireTime() == null) {
  getDelegate().updateTriggerState(conn, trigger.getKey(),
      STATE_COMPLETE);
  signalSchedulingChangeOnTxCompletion(0L);
} else if (triggerInstCode == CompletedExecutionInstruction.SET_TRIGGER_ERROR) {
  getLog().info("Trigger " + trigger.getKey() + " set to ERROR state.");
  getDelegate().updateTriggerState(conn, trigger.getKey(),
      STATE_ERROR);
  signalSchedulingChangeOnTxCompletion(0L);
} else if (triggerInstCode == CompletedExecutionInstruction.SET_ALL_JOB_TRIGGERS_COMPLETE) {
  getDelegate().updateTriggerStatesForJob(conn,
      trigger.getJobKey(), STATE_COMPLETE);
  signalSchedulingChangeOnTxCompletion(0L);
  getLog().info("All triggers of Job " + 
      trigger.getKey() + " set to ERROR state.");
  getDelegate().updateTriggerStatesForJob(conn,
      trigger.getJobKey(), STATE_ERROR);
  signalSchedulingChangeOnTxCompletion(0L);
  getDelegate().updateTriggerStatesForJobFromOtherState(conn,
      jobDetail.getKey(), STATE_WAITING,
      STATE_BLOCKED);
  getDelegate().updateTriggerStatesForJobFromOtherState(conn,
      jobDetail.getKey(), STATE_PAUSED,
origin: quartz-scheduler/quartz

try {
  int rows = getDelegate().updateTriggerStatesFromOtherStates(conn,
      STATE_WAITING, STATE_ACQUIRED, STATE_BLOCKED);
  rows += getDelegate().updateTriggerStatesFromOtherStates(conn,
        STATE_PAUSED, STATE_PAUSED_BLOCKED, STATE_PAUSED_BLOCKED);
      .selectTriggersForRecoveringJobs(conn);
  getLog()
      .info(
  List<TriggerKey> cts = getDelegate().selectTriggersInState(conn, STATE_COMPLETE);
  for(TriggerKey ct: cts) {
    removeTrigger(conn, ct);
  int n = getDelegate().deleteFiredTriggers(conn);
  getLog().info("Removed " + n + " stale fired job entries.");
} catch (JobPersistenceException e) {
origin: com.opensymphony.quartz/com.springsource.org.quartz

  String state = getDelegate().selectTriggerState(conn,
      trigger.getName(), trigger.getGroup());
  if (!state.equals(STATE_ACQUIRED)) {
  try {
    getLog().error("Error retrieving job, setting trigger state to ERROR.", jpe);
    getDelegate().updateTriggerState(conn, trigger.getName(),
        trigger.getGroup(), STATE_ERROR);
  } catch (SQLException sqle) {
  getDelegate().deleteFiredTrigger(conn, trigger.getFireInstanceId());
  getDelegate().insertFiredTrigger(conn, trigger, STATE_EXECUTING,
      job);
} catch (SQLException e) {
  force = false;
  try {
    getDelegate().updateTriggerStatesForJobFromOtherState(conn, job.getName(),
        job.getGroup(), STATE_BLOCKED, STATE_WAITING);
    getDelegate().updateTriggerStatesForJobFromOtherState(conn, job.getName(),
        job.getGroup(), STATE_BLOCKED, STATE_ACQUIRED);
    getDelegate().updateTriggerStatesForJobFromOtherState(conn, job.getName(),
        job.getGroup(), STATE_PAUSED_BLOCKED, STATE_PAUSED);
  } catch (SQLException e) {
origin: quartz-scheduler/quartz

if (getDelegate().updateCalendar(conn, calName, calendar) < 1) { 
  throw new JobPersistenceException(
    "Couldn't store calendar.  Update failed."); 
  List<OperableTrigger> trigs = getDelegate().selectTriggersForCalendar(conn, calName);
if (getDelegate().insertCalendar(conn, calName, calendar) < 1) { 
  throw new JobPersistenceException(
    "Couldn't store calendar.  Insert failed."); 
origin: com.opensymphony.quartz/com.springsource.org.quartz

/**
 * Delete a trigger, its listeners, and its Simple/Cron/BLOB sub-table entry.
 * 
 * @see #removeJob(Connection, SchedulingContext, String, String, boolean)
 * @see #removeTrigger(Connection, SchedulingContext, String, String)
 * @see #replaceTrigger(Connection, SchedulingContext, String, String, Trigger)
 */
private boolean deleteTriggerAndChildren(
    Connection conn, String triggerName, String triggerGroupName)
  throws SQLException, NoSuchDelegateException {
  DriverDelegate delegate = getDelegate();
  // Once it succeeds in deleting one sub-table entry it will not try the others.
  if ((delegate.deleteSimpleTrigger(conn, triggerName, triggerGroupName) == 0) && 
    (delegate.deleteCronTrigger(conn, triggerName, triggerGroupName) == 0)) {
    delegate.deleteBlobTrigger(conn, triggerName, triggerGroupName);
  }
  
  delegate.deleteTriggerListeners(conn, triggerName, triggerGroupName);
  
  return (delegate.deleteTrigger(conn, triggerName, triggerGroupName) > 0);
}
 
origin: quartz/quartz-all

/**
 * Delete a job and its listeners.
 * 
 * @see #removeJob(Connection, SchedulingContext, String, String, boolean)
 * @see #removeTrigger(Connection, SchedulingContext, String, String)
 */
private boolean deleteJobAndChildren(Connection conn, 
    SchedulingContext ctxt, String jobName, String groupName)
  throws NoSuchDelegateException, SQLException {
  getDelegate().deleteJobListeners(conn, jobName, groupName);
  return (getDelegate().deleteJobDetail(conn, jobName, groupName) > 0);
}

origin: quartz-scheduler/quartz

/**
 * protected
 * <p>
 * Resume (un-pause) all triggers - equivalent of calling <code>resumeTriggerGroup(group)</code>
 * on every group.
 * </p>
 * 
 * <p>
 * If any <code>Trigger</code> missed one or more fire-times, then the
 * <code>Trigger</code>'s misfire instruction will be applied.
 * </p>
 * 
 * @see #pauseAll(Connection)
 */
public void resumeAll(Connection conn)
  throws JobPersistenceException {
  List<String> names = getTriggerGroupNames(conn);
  for (String name: names) {
    resumeTriggerGroup(conn, GroupMatcher.triggerGroupEquals(name));
  }
  try {
    getDelegate().deletePausedTriggerGroup(conn, ALL_GROUPS_PAUSED);
  } catch (SQLException e) {
    throw new JobPersistenceException(
        "Couldn't resume all trigger groups: " + e.getMessage(), e);
  }
}
origin: quartz-scheduler/quartz

/**
 * Delete a trigger, its listeners, and its Simple/Cron/BLOB sub-table entry.
 * 
 * @see #removeJob(java.sql.Connection, org.quartz.JobKey)
 * @see #removeTrigger(Connection, TriggerKey)
 * @see #replaceTrigger(Connection, TriggerKey, OperableTrigger)
 */
private boolean deleteTriggerAndChildren(Connection conn, TriggerKey key)
  throws SQLException, NoSuchDelegateException {
  return (getDelegate().deleteTrigger(conn, key) > 0);
}

origin: quartz-scheduler/quartz

/**
 * Delete a job and its listeners.
 * 
 * @see #removeJob(java.sql.Connection, org.quartz.JobKey)
 * @see #removeTrigger(Connection, TriggerKey)
 */
private boolean deleteJobAndChildren(Connection conn, JobKey key)
  throws NoSuchDelegateException, SQLException {
  return (getDelegate().deleteJobDetail(conn, key) > 0);
}

origin: quartz-scheduler/quartz

  .selectInstancesFiredTriggerRecords(conn,
      rec.getSchedulerInstanceId());
      .updateTriggerStatesForJobFromOtherState(
          conn, jKey,
          STATE_WAITING, STATE_BLOCKED);
} else if (ftRec.getFireInstanceState().equals(STATE_PAUSED_BLOCKED)) {
  getDelegate()
      .updateTriggerStatesForJobFromOtherState(
          conn, jKey,
          STATE_PAUSED, STATE_PAUSED_BLOCKED);
  getDelegate().updateTriggerStateFromOtherState(
      conn, tKey, STATE_WAITING,
      STATE_ACQUIRED);
    rcvryTrig.setMisfireInstruction(SimpleTrigger.MISFIRE_INSTRUCTION_IGNORE_MISFIRE_POLICY);
    rcvryTrig.setPriority(ftRec.getPriority());
    JobDataMap jd = getDelegate().selectTriggerJobDataMap(conn, tKey.getName(), tKey.getGroup());
    jd.put(Scheduler.FAILED_JOB_ORIGINAL_TRIGGER_NAME, tKey.getName());
    jd.put(Scheduler.FAILED_JOB_ORIGINAL_TRIGGER_GROUP, tKey.getGroup());
      .updateTriggerStatesForJobFromOtherState(
          conn, jKey,
          STATE_WAITING, STATE_BLOCKED);
  getDelegate()
      .updateTriggerStatesForJobFromOtherState(
          conn, jKey,
          STATE_PAUSED, STATE_PAUSED_BLOCKED);
origin: quartz-scheduler/quartz

    TriggerStatus stat = getDelegate().selectTriggerStatus(
        conn, trigger.getKey());
    if(stat != null && stat.getNextFireTime() == null) {
  getDelegate().updateTriggerState(conn, trigger.getKey(),
      STATE_COMPLETE);
  signalSchedulingChangeOnTxCompletion(0L);
} else if (triggerInstCode == CompletedExecutionInstruction.SET_TRIGGER_ERROR) {
  getLog().info("Trigger " + trigger.getKey() + " set to ERROR state.");
  getDelegate().updateTriggerState(conn, trigger.getKey(),
      STATE_ERROR);
  signalSchedulingChangeOnTxCompletion(0L);
} else if (triggerInstCode == CompletedExecutionInstruction.SET_ALL_JOB_TRIGGERS_COMPLETE) {
  getDelegate().updateTriggerStatesForJob(conn,
      trigger.getJobKey(), STATE_COMPLETE);
  signalSchedulingChangeOnTxCompletion(0L);
  getLog().info("All triggers of Job " + 
      trigger.getKey() + " set to ERROR state.");
  getDelegate().updateTriggerStatesForJob(conn,
      trigger.getJobKey(), STATE_ERROR);
  signalSchedulingChangeOnTxCompletion(0L);
  getDelegate().updateTriggerStatesForJobFromOtherState(conn,
      jobDetail.getKey(), STATE_WAITING,
      STATE_BLOCKED);
  getDelegate().updateTriggerStatesForJobFromOtherState(conn,
      jobDetail.getKey(), STATE_PAUSED,
origin: quartz-scheduler/quartz

try {
  int rows = getDelegate().updateTriggerStatesFromOtherStates(conn,
      STATE_WAITING, STATE_ACQUIRED, STATE_BLOCKED);
  rows += getDelegate().updateTriggerStatesFromOtherStates(conn,
        STATE_PAUSED, STATE_PAUSED_BLOCKED, STATE_PAUSED_BLOCKED);
      .selectTriggersForRecoveringJobs(conn);
  getLog()
      .info(
  List<TriggerKey> cts = getDelegate().selectTriggersInState(conn, STATE_COMPLETE);
  for(TriggerKey ct: cts) {
    removeTrigger(conn, ct);
  int n = getDelegate().deleteFiredTriggers(conn);
  getLog().info("Removed " + n + " stale fired job entries.");
} catch (JobPersistenceException e) {
origin: quartz/quartz-all

  String state = getDelegate().selectTriggerState(conn,
      trigger.getName(), trigger.getGroup());
  if (!state.equals(STATE_ACQUIRED)) {
  try {
    getLog().error("Error retrieving job, setting trigger state to ERROR.", jpe);
    getDelegate().updateTriggerState(conn, trigger.getName(),
        trigger.getGroup(), STATE_ERROR);
  } catch (SQLException sqle) {
  getDelegate().deleteFiredTrigger(conn, trigger.getFireInstanceId());
  getDelegate().insertFiredTrigger(conn, trigger, STATE_EXECUTING,
      job);
} catch (SQLException e) {
  force = false;
  try {
    getDelegate().updateTriggerStatesForJobFromOtherState(conn, job.getName(),
        job.getGroup(), STATE_BLOCKED, STATE_WAITING);
    getDelegate().updateTriggerStatesForJobFromOtherState(conn, job.getName(),
        job.getGroup(), STATE_BLOCKED, STATE_ACQUIRED);
    getDelegate().updateTriggerStatesForJobFromOtherState(conn, job.getName(),
        job.getGroup(), STATE_PAUSED_BLOCKED, STATE_PAUSED);
  } catch (SQLException e) {
origin: quartz-scheduler/quartz

if (getDelegate().updateCalendar(conn, calName, calendar) < 1) { 
  throw new JobPersistenceException(
    "Couldn't store calendar.  Update failed."); 
  List<OperableTrigger> trigs = getDelegate().selectTriggersForCalendar(conn, calName);
if (getDelegate().insertCalendar(conn, calName, calendar) < 1) { 
  throw new JobPersistenceException(
    "Couldn't store calendar.  Insert failed."); 
origin: quartz/quartz-all

/**
 * Delete a trigger, its listeners, and its Simple/Cron/BLOB sub-table entry.
 * 
 * @see #removeJob(Connection, SchedulingContext, String, String, boolean)
 * @see #removeTrigger(Connection, SchedulingContext, String, String)
 * @see #replaceTrigger(Connection, SchedulingContext, String, String, Trigger)
 */
private boolean deleteTriggerAndChildren(
    Connection conn, String triggerName, String triggerGroupName)
  throws SQLException, NoSuchDelegateException {
  DriverDelegate delegate = getDelegate();
  // Once it succeeds in deleting one sub-table entry it will not try the others.
  if ((delegate.deleteSimpleTrigger(conn, triggerName, triggerGroupName) == 0) && 
    (delegate.deleteCronTrigger(conn, triggerName, triggerGroupName) == 0)) {
    delegate.deleteBlobTrigger(conn, triggerName, triggerGroupName);
  }
  
  delegate.deleteTriggerListeners(conn, triggerName, triggerGroupName);
  
  return (delegate.deleteTrigger(conn, triggerName, triggerGroupName) > 0);
}

org.quartz.impl.jdbcjobstoreDriverDelegate

Javadoc

This is the base interface for all driver delegate classes.

This interface is very similar to the org.quartz.spi.JobStore interface except each method has an additional java.sql.Connection parameter.

Unless a database driver has some extremely-DB-specific requirements, any DriverDelegate implementation classes should extend the org.quartz.impl.jdbcjobstore.StdJDBCDelegate class.

Most used methods

  • calendarExists
    Check whether or not a calendar exists.
  • calendarIsReferenced
    Check whether or not a calendar is referenced by any triggers.
  • deleteCalendar
    Delete a calendar.
  • deleteFiredTrigger
    Delete a fired trigger.
  • deleteFiredTriggers
    Delete all fired triggers of the given instance.
  • deleteJobDetail
    Delete the job detail record for the given job.
  • deletePausedTriggerGroup
  • deleteSchedulerState
    Delete a scheduler-instance state record.
  • deleteTrigger
    Delete the base trigger data for a trigger.
  • insertCalendar
    Insert a new calendar.
  • insertFiredTrigger
    Insert a fired trigger.
  • insertJobDetail
    Insert the job detail record.
  • insertFiredTrigger,
  • insertJobDetail,
  • insertPausedTriggerGroup,
  • insertSchedulerState,
  • insertTrigger,
  • isTriggerGroupPaused,
  • jobExists,
  • selectCalendar,
  • selectCalendars,
  • selectFiredTriggerInstanceNames

Popular in Java

  • Making http requests using okhttp
  • requestLocationUpdates (LocationManager)
  • onRequestPermissionsResult (Fragment)
  • getSystemService (Context)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • BigInteger (java.math)
    Immutable arbitrary-precision integers. All operations behave as if BigIntegers were represented in
  • ConcurrentHashMap (java.util.concurrent)
    A hash table supporting full concurrency of retrievals and adjustable expected concurrency for updat
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now