public class AlertServiceImpl extends Object implements AlertService
Constructor and Description |
---|
AlertServiceImpl(MongoConnection mongoConnection,
MongoJackObjectMapperProvider mapperProvider,
AlertConditionFactory alertConditionFactory,
AlarmCallbackHistoryService alarmCallbackHistoryService) |
@Inject public AlertServiceImpl(MongoConnection mongoConnection, MongoJackObjectMapperProvider mapperProvider, AlertConditionFactory alertConditionFactory, AlarmCallbackHistoryService alarmCallbackHistoryService)
public Alert factory(AlertCondition.CheckResult checkResult)
factory
in interface AlertService
public List<Alert> loadRecentOfStreams(List<String> streamIds, org.joda.time.DateTime since, int limit)
loadRecentOfStreams
in interface AlertService
public List<Alert> loadRecentOfStream(String streamId, org.joda.time.DateTime since, int limit)
loadRecentOfStream
in interface AlertService
public Optional<Alert> getLastTriggeredAlert(String streamId, String conditionId)
getLastTriggeredAlert
in interface AlertService
public long totalCount()
totalCount
in interface AlertService
public long totalCountForStream(String streamId)
totalCountForStream
in interface AlertService
public long totalCountForStreams(List<String> streamIds, Alert.AlertState state)
totalCountForStreams
in interface AlertService
public AlertCondition fromPersisted(Map<String,Object> fields, Stream stream) throws ConfigurationException
fromPersisted
in interface AlertService
ConfigurationException
public AlertCondition fromRequest(CreateConditionRequest ccr, Stream stream, String userId) throws ConfigurationException
fromRequest
in interface AlertService
ConfigurationException
public AlertCondition updateFromRequest(AlertCondition alertCondition, CreateConditionRequest ccr) throws ConfigurationException
updateFromRequest
in interface AlertService
ConfigurationException
public boolean inGracePeriod(AlertCondition alertCondition)
inGracePeriod
in interface AlertService
public boolean shouldRepeatNotifications(AlertCondition alertCondition, Alert alert)
shouldRepeatNotifications
in interface AlertService
public List<Alert> listForStreamIds(List<String> streamIds, Alert.AlertState state, int skip, int limit)
listForStreamIds
in interface AlertService
public List<Alert> listForStreamId(String streamId, int skip, int limit)
listForStreamId
in interface AlertService
public Alert load(String alertId, String streamId) throws NotFoundException
load
in interface AlertService
NotFoundException
public String save(Alert alert) throws ValidationException
save
in interface AlertService
ValidationException
public Alert resolveAlert(Alert alert)
resolveAlert
in interface AlertService
public boolean isResolved(Alert alert)
isResolved
in interface AlertService
Copyright © 2012–2018 Graylog, Inc.. All rights reserved.