public abstract class AbstractNotificationService extends UncaughtExceptionIdleService implements NotificationService
NotificationService that handles the subscriptions to all the notification
feeds for the current process and that has the ability to push notifications to subscribers.| Modifier | Constructor and Description |
|---|---|
protected |
AbstractNotificationService(DatasetFramework dsFramework,
TransactionSystemClientService transactionSystemClient,
NotificationFeedManager feedManager) |
| Modifier and Type | Method and Description |
|---|---|
protected com.google.gson.Gson |
createGson() |
protected org.slf4j.Logger |
getUncaughtExceptionLogger() |
protected void |
notificationReceived(Id.NotificationFeed feed,
com.google.gson.JsonElement notificationJson)
Called when a notification is received on a feed, to push it to all the handlers that subscribed to the feed.
|
<N> com.google.common.util.concurrent.ListenableFuture<N> |
publish(Id.NotificationFeed feed,
N notification) |
protected void |
shutDown() |
protected void |
startUp() |
<N> Cancellable |
subscribe(Id.NotificationFeed feed,
NotificationHandler<N> handler) |
<N> Cancellable |
subscribe(Id.NotificationFeed feed,
NotificationHandler<N> handler,
Executor executor) |
executor, newHandleraddListener, isRunning, start, startAndWait, state, stop, stopAndWait, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitpublishprotected AbstractNotificationService(DatasetFramework dsFramework, TransactionSystemClientService transactionSystemClient, NotificationFeedManager feedManager)
protected void startUp()
throws Exception
startUp in class com.google.common.util.concurrent.AbstractIdleServiceExceptionprotected void shutDown()
throws Exception
shutDown in class com.google.common.util.concurrent.AbstractIdleServiceExceptionprotected com.google.gson.Gson createGson()
protected void notificationReceived(Id.NotificationFeed feed, com.google.gson.JsonElement notificationJson)
feed - Id.NotificationFeed of the notificationnotificationJson - notification as a json objectpublic <N> com.google.common.util.concurrent.ListenableFuture<N> publish(Id.NotificationFeed feed, N notification) throws NotificationException
publish in interface NotificationServiceNotificationExceptionpublic <N> Cancellable subscribe(Id.NotificationFeed feed, NotificationHandler<N> handler) throws NotificationFeedNotFoundException, NotificationFeedException
subscribe in interface NotificationServiceNotificationFeedNotFoundExceptionNotificationFeedExceptionpublic <N> Cancellable subscribe(Id.NotificationFeed feed, NotificationHandler<N> handler, Executor executor) throws NotificationFeedNotFoundException, NotificationFeedException
subscribe in interface NotificationServiceNotificationFeedNotFoundExceptionNotificationFeedExceptionprotected org.slf4j.Logger getUncaughtExceptionLogger()
getUncaughtExceptionLogger in class UncaughtExceptionIdleServiceCopyright © 2016 Cask Data, Inc. Licensed under the Apache License, Version 2.0.