Class EthosChangeNotificationSubscription

  • All Implemented Interfaces:
    Flow.Subscription

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

      • EthosChangeNotificationSubscription

        public EthosChangeNotificationSubscription​(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.

        Iterates over the given ChangeNotification list and calls subscriber.onNext() for each notification. 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.