public String getDescription() { final StringBuffer actionsString = new StringBuffer(); for (final TriggerAction act : this.actions) { actionsString.append(", "); actionsString.append(act.getDescription()); } return "Trigger from " + getSource() + " with trigger condition of " + this.triggerCondition.getExpression() + " and expire condition of " + this.expireCondition.getExpression() + actionsString; }
private void onTriggerPause(final Trigger t) throws TriggerManagerException { final List<TriggerAction> expireActions = t.getExpireActions(); for (final TriggerAction action : expireActions) { try { logger.info("Doing expire actions for " + action.getDescription() + " for " + t); action.doAction(); } catch (final Exception e) { logger.error("Failed to do expire action " + action.getDescription() + " for " + t, e); } catch (final Throwable th) { logger.error("Failed to do expire action " + action.getDescription() + " for " + t, th); } } logger.info("Pausing Trigger " + t.getDescription()); t.setStatus(TriggerStatus.PAUSED); try { TriggerManager.this.triggerLoader.updateTrigger(t); } catch (final TriggerLoaderException e) { throw new TriggerManagerException(e); } }
for (final TriggerAction action : actions) { try { logger.info("Doing trigger actions " + action.getDescription() + " for " + t); action.doAction(); } catch (final ExecutorManagerException e) { if (e.getReason() == ExecutorManagerException.Reason.SkippedExecution) { logger.info("Skipped action [" + action.getDescription() + "] for [" + t + "] because: " + e.getMessage()); } else { logger.error("Failed to do action [" + action.getDescription() + "] for [" + t + "]", e); logger.error("Failed to do action [" + action.getDescription() + "] for [" + t + "]", th);
public String getDescription() { StringBuffer actionsString = new StringBuffer(); for(TriggerAction act : actions) { actionsString.append(", "); actionsString.append(act.getDescription()); } return "Trigger from " + getSource() + " with trigger condition of " + triggerCondition.getExpression() + " and expire condition of " + expireCondition.getExpression() + actionsString; }
public String getDescription() { final StringBuffer actionsString = new StringBuffer(); for (final TriggerAction act : this.actions) { actionsString.append(", "); actionsString.append(act.getDescription()); } return "Trigger from " + getSource() + " with trigger condition of " + this.triggerCondition.getExpression() + " and expire condition of " + this.expireCondition.getExpression() + actionsString; }
private void onTriggerPause(final Trigger t) throws TriggerManagerException { final List<TriggerAction> expireActions = t.getExpireActions(); for (final TriggerAction action : expireActions) { try { logger.info("Doing expire actions for " + action.getDescription() + " for " + t); action.doAction(); } catch (final Exception e) { logger.error("Failed to do expire action " + action.getDescription() + " for " + t, e); } catch (final Throwable th) { logger.error("Failed to do expire action " + action.getDescription() + " for " + t, th); } } logger.info("Pausing Trigger " + t.getDescription()); t.setStatus(TriggerStatus.PAUSED); try { TriggerManager.this.triggerLoader.updateTrigger(t); } catch (final TriggerLoaderException e) { throw new TriggerManagerException(e); } }
private void onTriggerTrigger(final Trigger t) throws TriggerManagerException { final List<TriggerAction> actions = t.getTriggerActions(); for (final TriggerAction action : actions) { try { logger.info("Doing trigger actions " + action.getDescription() + " for " + t); action.doAction(); } catch (final Exception e) { logger.error("Failed to do action " + action.getDescription() + " for " + t, e); } catch (final Throwable th) { logger.error("Failed to do action " + action.getDescription() + " for " + t, th); } } if (t.isResetOnTrigger()) { t.resetTriggerConditions(); } else { logger.info("NextCheckTime did not change. Setting status to expired for trigger" + t.getTriggerId()); t.setStatus(TriggerStatus.EXPIRED); } try { TriggerManager.this.triggerLoader.updateTrigger(t); } catch (final TriggerLoaderException e) { throw new TriggerManagerException(e); } }
private void onTriggerTrigger(Trigger t) throws TriggerManagerException { List<TriggerAction> actions = t.getTriggerActions(); for(TriggerAction action : actions) { try { logger.info("Doing trigger actions"); action.doAction(); } catch (Exception e) { // TODO Auto-generated catch block //throw new TriggerManagerException("action failed to execute", e); logger.error("Failed to do action " + action.getDescription(), e); } catch (Throwable th) { logger.error("Failed to do action " + action.getDescription(), th); } } if(t.isResetOnTrigger()) { t.resetTriggerConditions(); t.resetExpireCondition(); } else { t.setStatus(TriggerStatus.EXPIRED); } try { triggerLoader.updateTrigger(t); } catch (TriggerLoaderException e) { throw new TriggerManagerException(e); } }
private void onTriggerExpire(Trigger t) throws TriggerManagerException { List<TriggerAction> expireActions = t.getExpireActions(); for(TriggerAction action : expireActions) { try { logger.info("Doing expire actions"); action.doAction(); } catch (Exception e) { // TODO Auto-generated catch block //throw new TriggerManagerException("action failed to execute", e); logger.error("Failed to do expire action " + action.getDescription(), e); } catch (Throwable th) { logger.error("Failed to do expire action " + action.getDescription(), th); } } if(t.isResetOnExpire()) { t.resetTriggerConditions(); t.resetExpireCondition(); // updateTrigger(t); } else { t.setStatus(TriggerStatus.EXPIRED); } try { triggerLoader.updateTrigger(t); } catch (TriggerLoaderException e) { throw new TriggerManagerException(e); } }