Class PersistentStreamCallbacks
- java.lang.Object
-
- io.axoniq.axonserver.connector.event.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 Summary
Constructors Constructor Description PersistentStreamCallbacks(Consumer<PersistentStreamSegment> onSegmentOpened, Consumer<PersistentStreamSegment> onSegmentClosed, Consumer<PersistentStreamSegment> onAvailable, Consumer<Throwable> onClosed)Instantiates the callbacks object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Consumer<PersistentStreamSegment>onAvailable()Returns the callback that the connector invokes when an event is available on a persistent stream segment.Consumer<Throwable>onClosed()Returns the callback that the connector invokes when the persistent stream is closed.Consumer<PersistentStreamSegment>onSegmentClosed()Returns the callback that the connector invokes when a persistent stream segment is closed.Consumer<PersistentStreamSegment>onSegmentOpened()Returns the callback that the connector invokes when a persistent stream segment is opened.
-
-
-
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 openedonSegmentClosed- callback that the connector invokes when a persistent stream segment is closedonAvailable- callback that the connector invokes when an event is available on a persistent stream segmentonClosed- 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
-
-