Class NotificationSystem
- java.lang.Object
-
- io.pravega.client.stream.notifications.NotificationSystem
-
public class NotificationSystem extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description NotificationSystem()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends Notification>
voidaddListeners(java.lang.String type, Listener<T> listener, java.util.concurrent.ScheduledExecutorService executor)
boolean
isListenerPresent(java.lang.String type)
Check if a Listener is present for a given notification type.<T extends Notification>
voidnotify(T notification)
This method will ensure the notification is intimated to the listeners of the same type.<T extends Notification>
voidremoveListener(java.lang.String type, Listener<T> listener)
Remove Listener of a given notification type.void
removeListeners(java.lang.String type)
Remove all listeners of a notification type.
-
-
-
Method Detail
-
addListeners
public <T extends Notification> void addListeners(java.lang.String type, Listener<T> listener, java.util.concurrent.ScheduledExecutorService executor)
-
notify
public <T extends Notification> void notify(T notification)
This method will ensure the notification is intimated to the listeners of the same type.- Type Parameters:
T
- Type of notification.- Parameters:
notification
- Notification to be notified.
-
removeListener
public <T extends Notification> void removeListener(java.lang.String type, Listener<T> listener)
Remove Listener of a given notification type.- Type Parameters:
T
- Type of notification.- Parameters:
type
- Type of notification listener.listener
- Listener to be removed.
-
removeListeners
public void removeListeners(java.lang.String type)
Remove all listeners of a notification type.- Parameters:
type
- Type of notification listener.
-
isListenerPresent
public boolean isListenerPresent(java.lang.String type)
Check if a Listener is present for a given notification type.- Parameters:
type
- Type of notification listener.- Returns:
- true if Listener is present.
-
-