Class PersistentStreamCallbacks


  • public class PersistentStreamCallbacks
    extends Object
    Definitions of the callbacks to be added to a persistent stream.
    Since:
    2024.0.0
    Author:
    Marc Gathier
    • Constructor Detail

      • PersistentStreamCallbacks

        public PersistentStreamCallbacks​(Consumer<PersistentStreamSegment> onSegmentOpened,
                                         Consumer<PersistentStreamSegment> onSegmentClosed,
                                         Consumer<PersistentStreamSegment> onAvailable,
                                         Consumer<Throwable> onClosed)
        Instantiates the callbacks object.
        Parameters:
        onSegmentOpened - callback that the connector invokes when a persistent stream segment is opened
        onSegmentClosed - callback that the connector invokes when a persistent stream segment is closed
        onAvailable - callback that the connector invokes when an event is available on a persistent stream segment
        onClosed - callback that the connector invokes when the persistent stream is closed
    • Method Detail

      • onClosed

        public Consumer<Throwable> onClosed()
        Returns the callback that the connector invokes when the persistent stream is closed.
        Returns:
        callback that the connector invokes when the persistent stream is closed
      • onSegmentOpened

        public Consumer<PersistentStreamSegment> onSegmentOpened()
        Returns the callback that the connector invokes when a persistent stream segment is opened.
        Returns:
        callback that the connector invokes when a persistent stream segment is opened
      • onSegmentClosed

        public Consumer<PersistentStreamSegment> onSegmentClosed()
        Returns the callback that the connector invokes when a persistent stream segment is closed.
        Returns:
        callback that the connector invokes when a persistent stream segment is closed
      • onAvailable

        public Consumer<PersistentStreamSegment> onAvailable()
        Returns the callback that the connector invokes when an event is available on a persistent stream segment.
        Returns:
        callback that the connector invokes when an event is available on a persistent stream segment