public class AlertHelper extends Object
| Constructor and Description |
|---|
AlertHelper() |
| Modifier and Type | Method and Description |
|---|---|
void |
addStaleAlerts(Long hostId,
List<StaleAlert> staleAlertsDefinitionId)
Saves stale alerts for specified host.
|
void |
clearStaleAlert(Long definitionId)
Removes specified stale alert from specified host.
|
void |
clearStaleAlert(Long hostId,
Long definitionId)
Removes specified stale alert from specified host.
|
void |
clearStaleAlerts(Long hostId)
Removes all stale alerts for specified host.
|
List<Long> |
getHostIdsByDefinitionId(Long definitionId)
Retrieves all host ids containing specified definition id.
|
Map<Long,Long> |
getStaleAlerts(Long hostId)
Retrieves stale alerts for specified host.
|
int |
getThresholdValue(Object value,
int defaultValue)
Converts the given value to an integer safely.
|
int |
getWaitFactorMultiplier(AlertDefinition definition)
Gets the wait factor multiplier off of the definition, returning
INTERVAL_WAIT_FACTOR_DEFAULT if not specified. |
public int getWaitFactorMultiplier(AlertDefinition definition)
INTERVAL_WAIT_FACTOR_DEFAULT if not specified. This will look for
STALE_INTERVAL_MULTIPLIER_PARAM_KEY in the definition parameters.
The value returned from this method will be guaranteed to be in the range
of 2 to 10.definition - the definition to readpublic int getThresholdValue(Object value, int defaultValue)
value - defaultValue - public void addStaleAlerts(Long hostId, List<StaleAlert> staleAlertsDefinitionId)
hostId - host idstaleAlertsDefinitionId - list of stale alertspublic Map<Long,Long> getStaleAlerts(Long hostId)
hostId - host idpublic void clearStaleAlerts(Long hostId)
hostId - host idpublic void clearStaleAlert(Long hostId, Long definitionId)
hostId - host id.definitionId - alert definition id.public void clearStaleAlert(Long definitionId)
definitionId - alert definition id.Copyright © 2022 Apache Software Foundation. All rights reserved.