Class EthosChangeNotificationListSubscription

  • All Implemented Interfaces:
    Flow.Subscription

    public class EthosChangeNotificationListSubscription
    extends AbstractEthosChangeNotificationSubscription
    Subscription for processing lists of ChangeNotifications. This subscription runs in a separate thread as configured by the scheduledExecutorService.
    Since:
    0.2.0
    Author:
    David Kumar
    • Constructor Detail

      • EthosChangeNotificationListSubscription

        public EthosChangeNotificationListSubscription​(Flow.Publisher publisher,
                                                       Flow.Subscriber subscriber,
                                                       EthosChangeNotificationService ethosChangeNotificationService,
                                                       long pollingInterval,
                                                       TimeUnit pollingIntervalTimeUnit)
        Constructs this subscription with the given params.
        Parameters:
        publisher - The publisher for this subscription.
        subscriber - The subscriber subscribing to this subscription. Should be a client application subscriber that extends AbstractEthosChangeNotificationSubscriber.
        ethosChangeNotificationService - Service for retrieving ChangeNotifications.
        pollingInterval - The polling time interval between polling attempts.
        pollingIntervalTimeUnit - The time unit for the polling interval.
        Throws:
        IllegalArgumentException - Thrown if the given ethosChangeNotificationService is null.
    • Method Detail

      • processChangeNotifications

        protected void processChangeNotifications​(List<ChangeNotification> cnList)
        Intended to be used internally by the SDK.

        Calls subscriber.onNext() passing the entire list of ChangeNotifications to the subscriber as a whole. This is a synchronous call waiting until the subscriber processes the entire list. If an exception is thrown, will also call subscriber.onError() passing the given Throwable.

        Specified by:
        processChangeNotifications in class AbstractEthosChangeNotificationSubscription
        Parameters:
        cnList - The list of ChangeNotifications to propagate.