Class AbstractEthosNotificationSubscriber
- java.lang.Object
-
- com.ellucian.ethos.integration.notification.AbstractEthosNotificationSubscriber
-
- Direct Known Subclasses:
AbstractEthosChangeNotificationListSubscriber
,AbstractEthosChangeNotificationSubscriber
public abstract class AbstractEthosNotificationSubscriber extends Object
Abstract class containing common processing logic for subscribing to and cancelling subscriptions. Subclasses should implement theFlow.Subscriber
interface.- Since:
- 0.2.0
- Author:
- David Kumar
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_NUM_NOTIFICATIONS
Constant for indicating the default number of notifications to be retrieved at a time from Ethos Integration.protected Integer
numNotifications
The number of notifications to request at a time from Ethos Integration.protected Flow.Subscription
subscription
The subscription used by this subscriber.
-
Constructor Summary
Constructors Constructor Description AbstractEthosNotificationSubscriber()
Enables subclasses to construct this class without specifying the number of notifications to retrieve from Ethos Integration at a single time.AbstractEthosNotificationSubscriber(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 Concrete Methods Modifier and Type Method Description void
cancelSubscription()
Cancels the subscription used by this subscriber.void
doSubscribe(Flow.Subscription subscription)
Intended to be used internally by the SDK.boolean
isSubscriptionRunning()
Indicates whether the subscription for this subscriber is running, or not.
-
-
-
Field Detail
-
DEFAULT_NUM_NOTIFICATIONS
public static final int DEFAULT_NUM_NOTIFICATIONS
Constant for indicating the default number of notifications to be retrieved at a time from Ethos Integration. The value of this constant is not the default number of notifications that Ethos Integration uses.- See Also:
- Constant Field Values
-
numNotifications
protected Integer numNotifications
The number of notifications to request at a time from Ethos Integration. Must be between 1 and 1000.
-
subscription
protected Flow.Subscription subscription
The subscription used by this subscriber.
-
-
Constructor Detail
-
AbstractEthosNotificationSubscriber
public AbstractEthosNotificationSubscriber()
Enables subclasses to construct this class without specifying the number of notifications to retrieve from Ethos Integration at a single time.
-
AbstractEthosNotificationSubscriber
public AbstractEthosNotificationSubscriber(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
-
doSubscribe
public void doSubscribe(Flow.Subscription subscription)
Intended to be used internally by the SDK.Initiates the subscription process for this subscriber.
- Parameters:
subscription
- The subscription to process, or request notifications for.
-
cancelSubscription
public void cancelSubscription()
Cancels the subscription used by this subscriber. This will request for the thread running the subscription to stop after the current polling operation is completed, after which no further notifications should be received for this subscriber.
-
isSubscriptionRunning
public boolean isSubscriptionRunning()
Indicates whether the subscription for this subscriber is running, or not.- Returns:
- true if the subscription is running, false if not (if it were canceled).
-
-