public class Dampening extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Dampening.Type |
| Modifier and Type | Field and Description |
|---|---|
protected String |
dampeningId
A composed key for the dampening
|
| Constructor and Description |
|---|
Dampening() |
Dampening(String triggerId,
Mode triggerMode,
Dampening.Type type,
int evalTrueSetting,
int evalTotalSetting,
long evalTimeSetting) |
| Modifier and Type | Method and Description |
|---|---|
void |
addSatisfyingEvals(ConditionEval... satisfyingEvals) |
void |
addSatisfyingEvals(Set<ConditionEval> satisfyingEvals) |
boolean |
equals(Object obj) |
static Dampening |
forRelaxedCount(String triggerId,
Mode triggerMode,
int numTrueEvals,
int numTotalEvals)
Fire if we have
numTrueEvals of the condition set out of numTotalEvals. |
static Dampening |
forRelaxedTime(String triggerId,
Mode triggerMode,
int numTrueEvals,
long evalPeriod)
Fire if we have
numTrueEvals of the condition set within evalPeriod. |
static Dampening |
forStrict(String triggerId,
Mode triggerMode,
int numConsecutiveTrueEvals)
Fire if we have
numTrueEvals consecutive true evaluations of the condition set. |
static Dampening |
forStrictTime(String triggerId,
Mode triggerMode,
long evalPeriod)
Fire if we have only true evaluations of the condition set for at least
evalPeriod. |
static Dampening |
forStrictTimeout(String triggerId,
Mode triggerMode,
long evalPeriod)
Fire if we have only true evaluations of the condition set for
evalPeriod. |
Map<Integer,ConditionEval> |
getCurrentEvals() |
String |
getDampeningId() |
long |
getEvalTimeSetting() |
int |
getEvalTotalSetting() |
int |
getEvalTrueSetting() |
int |
getNumEvals() |
int |
getNumTrueEvals() |
List<Set<ConditionEval>> |
getSatisfyingEvals() |
String |
getTenantId() |
String |
getTriggerId() |
Mode |
getTriggerMode() |
long |
getTrueEvalsStartTime() |
Dampening.Type |
getType() |
int |
hashCode() |
boolean |
isSatisfied() |
String |
log() |
void |
perform(Match match,
ConditionEval conditionEval) |
void |
reset() |
void |
setEvalTimeSetting(long evalTimeSetting) |
void |
setEvalTotalSetting(int evalTotalSetting) |
void |
setEvalTrueSetting(int evalTrueSetting) |
void |
setNumEvals(int numEvals) |
void |
setNumTrueEvals(int numTrueEvals) |
void |
setSatisfied(boolean satisfied) |
void |
setSatisfyingEvals(List<Set<ConditionEval>> satisfyingEvals) |
void |
setTenantId(String tenantId) |
void |
setTriggerId(String triggerId) |
void |
setTriggerMode(Mode triggerMode) |
void |
setTrueEvalsStartTime(long trueEvalsStartTime) |
void |
setType(Dampening.Type type) |
String |
toString() |
protected String dampeningId
public Dampening()
public Dampening(String triggerId, Mode triggerMode, Dampening.Type type, int evalTrueSetting, int evalTotalSetting, long evalTimeSetting)
public static Dampening forStrict(String triggerId, Mode triggerMode, int numConsecutiveTrueEvals)
numTrueEvals consecutive true evaluations of the condition set. There is
no time limit for the evaluations.triggerId - the triggerIdtriggerMode - the trigger mode for when this dampening is activenumConsecutiveTrueEvals - the numConsecutiveTrueEvals, >= 1.public static Dampening forRelaxedCount(String triggerId, Mode triggerMode, int numTrueEvals, int numTotalEvals)
numTrueEvals of the condition set out of numTotalEvals. There is
no time limit for the evaluations.triggerId - the triggerIdtriggerMode - the trigger mode for when this dampening is activenumTrueEvals - the numTrueEvals, >=1numTotalEvals - the numTotalEvals, > numTotalEvalspublic static Dampening forRelaxedTime(String triggerId, Mode triggerMode, int numTrueEvals, long evalPeriod)
numTrueEvals of the condition set within evalPeriod. This can only
fire if the condition set is evaluated the required number of times in the given evalPeriod, so
the requisite data must be supplied in a timely manner.triggerId - the triggerIdtriggerMode - the trigger mode for when this dampening is activenumTrueEvals - the numTrueEvals, >= 1.evalPeriod - Elapsed real time, in milliseconds. In other words, this is not measured against
collectionTimes (i.e. the timestamp on the data) but rather the evaluation times. >=1ms.public static Dampening forStrictTime(String triggerId, Mode triggerMode, long evalPeriod)
evalPeriod. In other
words, fire the Trigger after N consecutive true condition set evaluations, such that N GTE 2
and delta(evalTime-1,evalTime-N) GTE evalPeriod. Any false evaluation resets the dampening.triggerId - the triggerIdtriggerMode - the trigger mode for when this dampening is activeevalPeriod - Elapsed real time, in milliseconds. In other words, this is not measured against
collectionTimes (i.e. the timestamp on the data) but rather the evaluation times. >=1ms.public static Dampening forStrictTimeout(String triggerId, Mode triggerMode, long evalPeriod)
evalPeriod. In other
words, fire the Trigger after N consecutive true condition set evaluations, such that N GTE 1
and delta(evalTime-1,currentTime) == evalPeriod. Any false evaluation resets the dampening.triggerId - the triggerIdtriggerMode - the trigger mode for when this dampening is activeevalPeriod - Elapsed real time, in milliseconds. In other words, this is not measured against
collectionTimes (i.e. the timestamp on the data) but rather the clock starts at true-evaluation-time-1. >=1ms.public String getTriggerId()
public void setTriggerId(String triggerId)
public Mode getTriggerMode()
public void setTriggerMode(Mode triggerMode)
public void setEvalTimeSetting(long evalTimeSetting)
public void setEvalTotalSetting(int evalTotalSetting)
public void setEvalTrueSetting(int evalTrueSetting)
public void setSatisfied(boolean satisfied)
public void setSatisfyingEvals(List<Set<ConditionEval>> satisfyingEvals)
public void setType(Dampening.Type type)
public int getNumTrueEvals()
public void setNumTrueEvals(int numTrueEvals)
public long getTrueEvalsStartTime()
public void setTrueEvalsStartTime(long trueEvalsStartTime)
public int getNumEvals()
public void setNumEvals(int numEvals)
public Dampening.Type getType()
public int getEvalTrueSetting()
public int getEvalTotalSetting()
public long getEvalTimeSetting()
public Map<Integer,ConditionEval> getCurrentEvals()
public boolean isSatisfied()
public List<Set<ConditionEval>> getSatisfyingEvals()
public void addSatisfyingEvals(Set<ConditionEval> satisfyingEvals)
public void addSatisfyingEvals(ConditionEval... satisfyingEvals)
public String getTenantId()
public void setTenantId(String tenantId)
public void perform(Match match, ConditionEval conditionEval)
public void reset()
public String log()
public String getDampeningId()
Copyright © 2015 Red Hat, Inc.. All rights reserved.