public abstract class AlertRunnable extends Object implements Runnable
AlertRunnable
class is used to boilerplate the expected
functionality of Runnable
s which need to eventually create and fire
AlertReceivedEvent
s.
Implementations of this class do not need to concern themselves with checking
for whether their alert definition is enabled or with constructing and firing
the alert events.Modifier and Type | Field and Description |
---|---|
protected AlertHelper |
alertHelper |
protected String |
m_definitionName
The alert definition name.
|
Constructor and Description |
---|
AlertRunnable(String definitionName)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected Alert |
buildAlert(Cluster cluster,
AlertDefinitionEntity myDefinition,
AlertState alertState,
String message)
Builds an
Alert instance. |
void |
run() |
protected final String m_definitionName
@Inject protected AlertHelper alertHelper
public AlertRunnable(String definitionName)
definitionName
- the definition name (not null
).protected Alert buildAlert(Cluster cluster, AlertDefinitionEntity myDefinition, AlertState alertState, String message)
Alert
instance.cluster
- the cluster the alert is for (not null
).myDefinition
- the alert's definition (not null
).alertState
- the state of the alert (not null
).message
- the alert text.Copyright © 2022 Apache Software Foundation. All rights reserved.