Package com.fauna.event
Class StreamOptions
- java.lang.Object
-
- com.fauna.event.StreamOptions
-
public class StreamOptions extends java.lang.ObjectRepresents configuration options for a Fauna Event Stream.The
StreamOptionsclass allows customization of the stream request, including cursor, retry strategy, start timestamp, status events, and timeout.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classStreamOptions.BuilderBuilder class for constructingStreamOptionsinstances.
-
Field Summary
Fields Modifier and Type Field Description static StreamOptionsDEFAULTDefaultStreamOptionsinstance with defaults.
-
Constructor Summary
Constructors Constructor Description StreamOptions(StreamOptions.Builder builder)Constructs aStreamOptionsinstance with the specified builder.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static StreamOptions.Builderbuilder()Creates a newBuilderfor constructingStreamOptions.java.util.Optional<java.lang.String>getCursor()Retrieves the event cursor.java.util.Optional<RetryStrategy>getRetryStrategy()Retrieves the retry strategy for the stream.java.util.Optional<java.lang.Long>getStartTimestamp()Retrieves the start timestamp for the stream.java.util.Optional<java.lang.Boolean>getStatusEvents()Checks if status events are enabled for the stream.java.util.Optional<java.time.Duration>getTimeout()Retrieves the timeout duration for the stream.
-
-
-
Field Detail
-
DEFAULT
public static final StreamOptions DEFAULT
DefaultStreamOptionsinstance with defaults.
-
-
Constructor Detail
-
StreamOptions
public StreamOptions(StreamOptions.Builder builder)
Constructs aStreamOptionsinstance with the specified builder.- Parameters:
builder- TheStreamOptions.Builderinstance containing the configuration options.
-
-
Method Detail
-
getCursor
public java.util.Optional<java.lang.String> getCursor()
Retrieves the event cursor. Used to restart the stream.- Returns:
- An
Optionalcontaining the cursor, or empty if not set.
-
getRetryStrategy
public java.util.Optional<RetryStrategy> getRetryStrategy()
Retrieves the retry strategy for the stream.- Returns:
- An
Optionalcontaining the retry strategy, or empty if not set.
-
getStartTimestamp
public java.util.Optional<java.lang.Long> getStartTimestamp()
Retrieves the start timestamp for the stream.- Returns:
- An
Optionalcontaining the start timestamp, or empty if not set.
-
getStatusEvents
public java.util.Optional<java.lang.Boolean> getStatusEvents()
Checks if status events are enabled for the stream.- Returns:
- An
Optionalcontaining a boolean for status events, or empty if not set.
-
getTimeout
public java.util.Optional<java.time.Duration> getTimeout()
Retrieves the timeout duration for the stream.- Returns:
- An
Optionalcontaining the timeout duration, or empty if not set.
-
builder
public static StreamOptions.Builder builder()
Creates a newBuilderfor constructingStreamOptions.- Returns:
- A new
Builderinstance.
-
-