public FullTrigger(Trigger trigger, List<Dampening> dampenings, List<Condition> conditions) { this.trigger = trigger; this.dampenings = dampenings; this.conditions = conditions; checkDampenings(); checkConditions(); }
public void setFiringMatch(Match firingMatch) { if (firingMatch == null) { firingMatch = Match.ALL; } this.firingMatch = firingMatch; setMatch(this.mode == Mode.FIRING ? getFiringMatch() : getAutoResolveMatch()); }
@Override public int hashCode() { return trigger != null ? trigger.hashCode() : 0; }
public DefinitionsEvent(Type type, Trigger trigger) { this(type, trigger.getTenantId(), trigger.getId(), null, null, null, trigger.getTags()); }
public void addAction(TriggerAction triggerAction) { triggerAction.setTenantId(this.getTenantId()); getActions().add(triggerAction); }
public void updateTenant(String tenantId) { if (triggers != null) { for (FullTrigger t : triggers) { if (t.getTrigger() != null) { t.getTrigger().setTenantId(tenantId); t.check(); } } } if (actions != null) { for (ActionDefinition a : actions) { if (a != null) { a.setTenantId(tenantId); } } } }
private void updateId() { StringBuilder sb = new StringBuilder(tenantId); sb.append("-").append(triggerId); sb.append("-").append(triggerMode.name()); this.dampeningId = sb.toString(); }
public void setDampenings(List<Dampening> dampenings) { if (dampenings == null) { dampenings = new ArrayList<>(); } this.dampenings = dampenings; checkDampenings(); }
public void setConditions(List<Condition> conditions) { if (conditions == null) { conditions = new ArrayList<>(); } this.conditions = conditions; checkConditions(); }
public void addState(String state) { getStates().add(state); }
@JsonIgnore public boolean isLoadable() { return !isGroup() && enabled; }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; FullTrigger that = (FullTrigger) o; return trigger != null ? trigger.equals(that.trigger) : that.trigger == null; }
@Override public String toString() { return "Trigger [tenantId=" + tenantId + ", id=" + id + ", type=" + type.name() + ", eventType=" + eventType.name() + ", name=" + name + ", description=" + description + ", eventCategory=" + eventCategory + ", eventText=" + eventText + ", severity=" + severity + ", context=" + context + ", actions=" + actions + ", autoDisable=" + autoDisable + ", autoEnable=" + autoEnable + ", autoResolve=" + autoResolve + ", autoResolveAlerts=" + autoResolveAlerts + ", autoResolveMatch=" + autoResolveMatch + ", memberOf=" + memberOf + ", dataIdMap=" + dataIdMap + ", enabled=" + enabled + ", firingMatch=" + firingMatch + ", mode=" + mode + ", tags=" + tags + "]"; }
public static boolean isEmpty(Trigger trigger) { return trigger == null || isEmpty(trigger.getId()); }
public Alert(String tenantId, Trigger trigger, Dampening dampening, List<Set<ConditionEval>> evalSets) { super(tenantId, trigger, dampening, evalSets); this.status = Status.OPEN; this.severity = trigger.getSeverity(); this.eventType = EventType.ALERT.name(); addLifecycle(this.status, "system", this.ctime); }
public void setAutoResolveMatch(Match autoResolveMatch) { if (autoResolveMatch == null) { autoResolveMatch = Match.ALL; } this.autoResolveMatch = autoResolveMatch; setMatch(this.mode == Mode.FIRING ? getFiringMatch() : getAutoResolveMatch()); }
public void setTrigger(Trigger trigger) { this.trigger = trigger; checkDampenings(); checkConditions(); }
private void updateId() { StringBuilder sb = new StringBuilder(tenantId); sb.append("-").append(triggerId); sb.append("-").append(triggerMode.name()); sb.append("-").append(conditionSetSize); sb.append("-").append(conditionSetIndex); this.conditionId = sb.toString(); }
public void setMode(Mode mode) { this.mode = mode; setMatch(this.mode == Mode.FIRING ? getFiringMatch() : getAutoResolveMatch()); }
public void check() { checkDampenings(); checkConditions(); }