protected boolean replaceTrigger(Connection conn, TriggerKey key, OperableTrigger newTrigger) throws JobPersistenceException { try { // this must be called before we delete the trigger, obviously JobDetail job = getDelegate().selectJobForTrigger(conn, getClassLoadHelper(), key); if (job == null) { return false; } if (!newTrigger.getJobKey().equals(job.getKey())) { throw new JobPersistenceException("New trigger is not related to the same job as the old trigger."); } boolean removedTrigger = deleteTriggerAndChildren(conn, key); storeTrigger(conn, newTrigger, job, false, STATE_WAITING, false, false); return removedTrigger; } catch (ClassNotFoundException e) { throw new JobPersistenceException("Couldn't remove trigger: " + e.getMessage(), e); } catch (SQLException e) { throw new JobPersistenceException("Couldn't remove trigger: " + e.getMessage(), e); } }
protected boolean replaceTrigger(Connection conn, TriggerKey key, OperableTrigger newTrigger) throws JobPersistenceException { try { // this must be called before we delete the trigger, obviously JobDetail job = getDelegate().selectJobForTrigger(conn, getClassLoadHelper(), key); if (job == null) { return false; } if (!newTrigger.getJobKey().equals(job.getKey())) { throw new JobPersistenceException("New trigger is not related to the same job as the old trigger."); } boolean removedTrigger = deleteTriggerAndChildren(conn, key); storeTrigger(conn, newTrigger, job, false, STATE_WAITING, false, false); return removedTrigger; } catch (ClassNotFoundException e) { throw new JobPersistenceException("Couldn't remove trigger: " + e.getMessage(), e); } catch (SQLException e) { throw new JobPersistenceException("Couldn't remove trigger: " + e.getMessage(), e); } }
protected boolean removeTrigger(Connection conn, TriggerKey key) throws JobPersistenceException { boolean removedTrigger; try { // this must be called before we delete the trigger, obviously JobDetail job = getDelegate().selectJobForTrigger(conn, getClassLoadHelper(), key, false); removedTrigger = deleteTriggerAndChildren(conn, key); if (null != job && !job.isDurable()) { int numTriggers = getDelegate().selectNumTriggersForJob(conn, job.getKey()); if (numTriggers == 0) { // Don't call removeJob() because we don't want to check for // triggers again. deleteJobAndChildren(conn, job.getKey()); } } } catch (ClassNotFoundException e) { throw new JobPersistenceException("Couldn't remove trigger: " + e.getMessage(), e); } catch (SQLException e) { throw new JobPersistenceException("Couldn't remove trigger: " + e.getMessage(), e); } return removedTrigger; }
protected boolean removeTrigger(Connection conn, TriggerKey key) throws JobPersistenceException { boolean removedTrigger; try { // this must be called before we delete the trigger, obviously JobDetail job = getDelegate().selectJobForTrigger(conn, getClassLoadHelper(), key, false); removedTrigger = deleteTriggerAndChildren(conn, key); if (null != job && !job.isDurable()) { int numTriggers = getDelegate().selectNumTriggersForJob(conn, job.getKey()); if (numTriggers == 0) { // Don't call removeJob() because we don't want to check for // triggers again. deleteJobAndChildren(conn, job.getKey()); } } } catch (ClassNotFoundException e) { throw new JobPersistenceException("Couldn't remove trigger: " + e.getMessage(), e); } catch (SQLException e) { throw new JobPersistenceException("Couldn't remove trigger: " + e.getMessage(), e); } return removedTrigger; }
protected boolean replaceTrigger(Connection conn, SchedulingContext ctxt, String triggerName, String groupName, Trigger newTrigger) throws JobPersistenceException { try { // this must be called before we delete the trigger, obviously JobDetail job = getDelegate().selectJobForTrigger(conn, triggerName, groupName, getClassLoadHelper()); if (job == null) { return false; } if (!newTrigger.getJobName().equals(job.getName()) || !newTrigger.getJobGroup().equals(job.getGroup())) { throw new JobPersistenceException("New trigger is not related to the same job as the old trigger."); } boolean removedTrigger = deleteTriggerAndChildren(conn, triggerName, groupName); storeTrigger(conn, ctxt, newTrigger, job, false, STATE_WAITING, false, false); return removedTrigger; } catch (ClassNotFoundException e) { throw new JobPersistenceException("Couldn't remove trigger: " + e.getMessage(), e); } catch (SQLException e) { throw new JobPersistenceException("Couldn't remove trigger: " + e.getMessage(), e); } }
protected boolean replaceTrigger(Connection conn, SchedulingContext ctxt, String triggerName, String groupName, Trigger newTrigger) throws JobPersistenceException { try { // this must be called before we delete the trigger, obviously JobDetail job = getDelegate().selectJobForTrigger(conn, triggerName, groupName, getClassLoadHelper()); if (job == null) { return false; } if (!newTrigger.getJobName().equals(job.getName()) || !newTrigger.getJobGroup().equals(job.getGroup())) { throw new JobPersistenceException("New trigger is not related to the same job as the old trigger."); } boolean removedTrigger = deleteTriggerAndChildren(conn, triggerName, groupName); storeTrigger(conn, ctxt, newTrigger, job, false, STATE_WAITING, false, false); return removedTrigger; } catch (ClassNotFoundException e) { throw new JobPersistenceException("Couldn't remove trigger: " + e.getMessage(), e); } catch (SQLException e) { throw new JobPersistenceException("Couldn't remove trigger: " + e.getMessage(), e); } }
protected boolean removeTrigger(Connection conn, SchedulingContext ctxt, String triggerName, String groupName) throws JobPersistenceException { boolean removedTrigger = false; try { // this must be called before we delete the trigger, obviously JobDetail job = getDelegate().selectJobForTrigger(conn, triggerName, groupName, getClassLoadHelper()); removedTrigger = deleteTriggerAndChildren(conn, triggerName, groupName); if (null != job && !job.isDurable()) { int numTriggers = getDelegate().selectNumTriggersForJob(conn, job.getName(), job.getGroup()); if (numTriggers == 0) { // Don't call removeJob() because we don't want to check for // triggers again. deleteJobAndChildren(conn, ctxt, job.getName(), job.getGroup()); } } } catch (ClassNotFoundException e) { throw new JobPersistenceException("Couldn't remove trigger: " + e.getMessage(), e); } catch (SQLException e) { throw new JobPersistenceException("Couldn't remove trigger: " + e.getMessage(), e); } return removedTrigger; }
protected boolean removeTrigger(Connection conn, SchedulingContext ctxt, String triggerName, String groupName) throws JobPersistenceException { boolean removedTrigger = false; try { // this must be called before we delete the trigger, obviously JobDetail job = getDelegate().selectJobForTrigger(conn, triggerName, groupName, getClassLoadHelper()); removedTrigger = deleteTriggerAndChildren(conn, triggerName, groupName); if (null != job && !job.isDurable()) { int numTriggers = getDelegate().selectNumTriggersForJob(conn, job.getName(), job.getGroup()); if (numTriggers == 0) { // Don't call removeJob() because we don't want to check for // triggers again. deleteJobAndChildren(conn, ctxt, job.getName(), job.getGroup()); } } } catch (ClassNotFoundException e) { throw new JobPersistenceException("Couldn't remove trigger: " + e.getMessage(), e); } catch (SQLException e) { throw new JobPersistenceException("Couldn't remove trigger: " + e.getMessage(), e); } return removedTrigger; }