public final class VolatileNotificationRepositoryAndFactory extends Object implements NotificationRepository, NotificationFactory
NotificationRepository.NotificationRemover
Constructor and Description |
---|
VolatileNotificationRepositoryAndFactory() |
Modifier and Type | Method and Description |
---|---|
Notification |
createAndPersist(String soundUrl,
String buildDetails)
Creates a
Notification and makes it instantly available in the NotificationRepository . |
List<Notification> |
findNewerThan(NotificationId id)
Returns each
Notification that is newer than, i.e. |
NotificationId |
getLastNotificationId()
Returns the id of the newest
Notification or null if the repository is empty. |
void |
remove(NotificationRepository.NotificationRemover remover)
Provides access to an
Iterator that can be used to remove individual notifications. |
public VolatileNotificationRepositoryAndFactory()
public Notification createAndPersist(String soundUrl, String buildDetails)
NotificationFactory
Notification
and makes it instantly available in the NotificationRepository
.createAndPersist
in interface NotificationFactory
soundUrl
- URL of a sound that should be playedbuildDetails
- details about the build that caused the notification, used for loggingpublic NotificationId getLastNotificationId()
NotificationRepository
Notification
or null
if the repository is empty.getLastNotificationId
in interface NotificationRepository
public List<Notification> findNewerThan(NotificationId id)
NotificationRepository
Notification
that is newer than, i.e. happened after, a provided notification.
Clients waiting for new notifications are notified (Object.notifyAll()
) when new
notifications are available.
findNewerThan
in interface NotificationRepository
id
- a NotificationId
or null
to list each notificationpublic void remove(NotificationRepository.NotificationRemover remover)
NotificationRepository
Iterator
that can be used to remove individual notifications.remove
in interface NotificationRepository
Copyright © 2004-2011. All Rights Reserved.