Class AbstractEthosNotificationPollService
- java.lang.Object
-
- com.ellucian.ethos.integration.notification.AbstractEthosNotificationPollService
-
- Direct Known Subclasses:
EthosChangeNotificationListPollService
,EthosChangeNotificationPollService
public abstract class AbstractEthosNotificationPollService extends Object
Abstract class containing a mapping of subscribers to subscriptions, and the polling interval in seconds to wait between poll attempts. Extended by subclasses implementing theFlow.Publisher
interface.- Since:
- 0.2.0
- Author:
- David Kumar
-
-
Field Summary
Fields Modifier and Type Field Description static long
DEFAULT_POLL_INTERVAL_SECONDS
The default poll interval in seconds.protected long
pollingIntervalSeconds
The polling interval in seconds between poll attempts to retrieve notification messages from Ethos Integration.protected Map<Flow.Subscriber,Flow.Subscription>
subscriberMap
Maps the subscribers to their subscriptions, as there could be multiple instances of subscribers.
-
Constructor Summary
Constructors Constructor Description AbstractEthosNotificationPollService()
No-arg constructor setting the pollingIntervalSeconds to DEFAULT_POLL_INTERVAL_SECONDS.AbstractEthosNotificationPollService(long pollingIntervalSeconds)
Constructs an instance of this class with the given params.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getNumberOfSubscribers()
Gets the number of subscribers this publisher is responsible for.List<Flow.Subscriber>
getSubscribers()
Gets a list of the subscribers this publisher has.void
unsubscribe(Flow.Subscriber subscriber)
Unsubscribes the given subscriber from this publisher, removing them from the subscriber map.
-
-
-
Field Detail
-
DEFAULT_POLL_INTERVAL_SECONDS
public static final long DEFAULT_POLL_INTERVAL_SECONDS
The default poll interval in seconds. This is how long to wait between poll attempts by default if poll interval is not specified.- See Also:
- Constant Field Values
-
subscriberMap
protected Map<Flow.Subscriber,Flow.Subscription> subscriberMap
Maps the subscribers to their subscriptions, as there could be multiple instances of subscribers.
-
pollingIntervalSeconds
protected long pollingIntervalSeconds
The polling interval in seconds between poll attempts to retrieve notification messages from Ethos Integration.
-
-
Constructor Detail
-
AbstractEthosNotificationPollService
public AbstractEthosNotificationPollService()
No-arg constructor setting the pollingIntervalSeconds to DEFAULT_POLL_INTERVAL_SECONDS.
-
AbstractEthosNotificationPollService
public AbstractEthosNotificationPollService(long pollingIntervalSeconds)
Constructs an instance of this class with the given params.- Parameters:
pollingIntervalSeconds
- The polling interval between poll attempts to retrieve notification messages, in seconds.- Throws:
IllegalArgumentException
- Thrown if the ethosChangeNotificationService is null.
-
-
Method Detail
-
unsubscribe
public void unsubscribe(Flow.Subscriber subscriber)
Unsubscribes the given subscriber from this publisher, removing them from the subscriber map.- Parameters:
subscriber
- The subscriber to unsubscribe.- Throws:
IllegalArgumentException
- Thrown if the given subscriber is null.
-
getNumberOfSubscribers
public int getNumberOfSubscribers()
Gets the number of subscribers this publisher is responsible for.- Returns:
- The number of subscribers this publisher has.
-
getSubscribers
public List<Flow.Subscriber> getSubscribers()
Gets a list of the subscribers this publisher has.- Returns:
- A list of subscribers for this publisher.
-
-