Class AbstractEthosChangeNotificationSubscriber
- java.lang.Object
-
- com.ellucian.ethos.integration.notification.AbstractEthosNotificationSubscriber
-
- com.ellucian.ethos.integration.notification.AbstractEthosChangeNotificationSubscriber
-
- All Implemented Interfaces:
Flow.Subscriber<ChangeNotification>
public abstract class AbstractEthosChangeNotificationSubscriber extends AbstractEthosNotificationSubscriber implements Flow.Subscriber<ChangeNotification>
Abstract class which provides "hooks" into the Ethos SDK for ChangeNotification subscribers. Client application code should extend this class and implement the abstract methods to handle individual ChangeNotifications as desired.A client application code ChangeNotification subscriber extending this class will become active in receiving ChangeNotifications after being subscribed to an EthosChangeNotificationPublisher via the
EthosChangeNotificationPollService.subscribe(Flow.Subscriber)
method. A client subscriber will stop receiving ChangeNotifications after calling theAbstractEthosNotificationSubscriber.cancelSubscription()
method.- Since:
- 0.2.0
- Author:
- David Kumar
-
-
Field Summary
-
Fields inherited from class com.ellucian.ethos.integration.notification.AbstractEthosNotificationSubscriber
DEFAULT_NUM_NOTIFICATIONS, numNotifications, subscription
-
-
Constructor Summary
Constructors Constructor Description AbstractEthosChangeNotificationSubscriber()
Enables subclasses to construct this class without specifying the number of notifications to retrieve from Ethos Integration at a single time.AbstractEthosChangeNotificationSubscriber(Integer numNotifications)
Enables subclasses to construct this class with the specified number of notifications to retrieve from Ethos Integration at a single time (per polling request).
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
onChangeNotification(ChangeNotification changeNotification)
This is the hook which client application code should implement when subclassing this class for processing ChangeNotifications.abstract void
onChangeNotificationError(Throwable throwable)
This is the hook which client application code should implement when subclassing this class for handling errors that occurred during onChangeNotification().void
onComplete()
Intended to be used internally by the SDK.void
onError(Throwable throwable)
Intended to be used internally by the SDK.void
onNext(ChangeNotification item)
Intended to be used internally by the SDK.void
onSubscribe(Flow.Subscription subscription)
Intended to be used internally by the SDK.-
Methods inherited from class com.ellucian.ethos.integration.notification.AbstractEthosNotificationSubscriber
cancelSubscription, doSubscribe, isSubscriptionRunning
-
-
-
-
Constructor Detail
-
AbstractEthosChangeNotificationSubscriber
public AbstractEthosChangeNotificationSubscriber()
Enables subclasses to construct this class without specifying the number of notifications to retrieve from Ethos Integration at a single time.
-
AbstractEthosChangeNotificationSubscriber
public AbstractEthosChangeNotificationSubscriber(Integer numNotifications)
Enables subclasses to construct this class with the specified number of notifications to retrieve from Ethos Integration at a single time (per polling request).- Parameters:
numNotifications
- The number of notifications to retrieve from Ethos Integration per polling request.
-
-
Method Detail
-
onSubscribe
public void onSubscribe(Flow.Subscription subscription)
Intended to be used internally by the SDK.Initiates the subscription process for this subscriber.
- Specified by:
onSubscribe
in interfaceFlow.Subscriber<ChangeNotification>
- Parameters:
subscription
- The subscription to process, or request notifications for.
-
onNext
public void onNext(ChangeNotification item)
Intended to be used internally by the SDK.Called by the subscription used by this subscriber for each notification. Relays the given notification to the
onChangeNotification(ChangeNotification)
method.- Specified by:
onNext
in interfaceFlow.Subscriber<ChangeNotification>
- Parameters:
item
- The ChangeNotification to process.
-
onError
public void onError(Throwable throwable)
Intended to be used internally by the SDK.Called by the subscription to handle any exceptions thrown during the processing call to onNext(). Relays the throwable to the
onChangeNotificationError(Throwable)
method.- Specified by:
onError
in interfaceFlow.Subscriber<ChangeNotification>
- Parameters:
throwable
- The exception caught by the subscription.
-
onComplete
public void onComplete()
Intended to be used internally by the SDK.Called by the subscriber when a given polling operation is complete.
- Specified by:
onComplete
in interfaceFlow.Subscriber<ChangeNotification>
-
onChangeNotification
public abstract void onChangeNotification(ChangeNotification changeNotification)
This is the hook which client application code should implement when subclassing this class for processing ChangeNotifications.- Parameters:
changeNotification
- The ChangeNotification to process.
-
onChangeNotificationError
public abstract void onChangeNotificationError(Throwable throwable)
This is the hook which client application code should implement when subclassing this class for handling errors that occurred during onChangeNotification().- Parameters:
throwable
- The exception thrown during the call to onChangeNotification().
-
-