public class AlarmDuplicateFilter extends Object implements NotificationFilter
AlarmNotifications that occur during a specified period of time. Only the first of a series of equivalent alarm notifications is allowed through this filter. When the specified period of time elapses after the first notification, the cycle restarts and a subsequent equivalent alarm notification is allowed through.
Alarm notification equivalence is tested using the
Notifications that are not instances of
AlarmNotification are suppressed
by this filter.
Note: This filter implementation does not use threads to clear stale timeouts.
Instead, stale timeouts are cleared on each invocation of
isNotificationEnabled. Methods in this class are also thread-safe.
|Constructor and Description|
|Modifier and Type||Method and Description|
Determine whether the specified notification should be delivered to notification listeners using this notification filter.
public AlarmDuplicateFilter(long period)
period- the period (measured in ms) during which duplicate alarm notifications will be discarded.
public boolean isNotificationEnabled(Notification notification)
notification- the notification to be sent.
trueif the notification should be delivered to notification listeners,
falseotherwise. This method always returns
notificationis not an instance of