Package com.fauna.event
Class StreamOptions
- java.lang.Object
-
- com.fauna.event.StreamOptions
-
public class StreamOptions extends java.lang.Object
Represents configuration options for a Fauna Event Stream.The
StreamOptions
class 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 class
StreamOptions.Builder
Builder class for constructingStreamOptions
instances.
-
Field Summary
Fields Modifier and Type Field Description static StreamOptions
DEFAULT
DefaultStreamOptions
instance with defaults.
-
Constructor Summary
Constructors Constructor Description StreamOptions(StreamOptions.Builder builder)
Constructs aStreamOptions
instance with the specified builder.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static StreamOptions.Builder
builder()
Creates a newBuilder
for 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
DefaultStreamOptions
instance with defaults.
-
-
Constructor Detail
-
StreamOptions
public StreamOptions(StreamOptions.Builder builder)
Constructs aStreamOptions
instance with the specified builder.- Parameters:
builder
- TheStreamOptions.Builder
instance 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
Optional
containing the cursor, or empty if not set.
-
getRetryStrategy
public java.util.Optional<RetryStrategy> getRetryStrategy()
Retrieves the retry strategy for the stream.- Returns:
- An
Optional
containing 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
Optional
containing 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
Optional
containing 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
Optional
containing the timeout duration, or empty if not set.
-
builder
public static StreamOptions.Builder builder()
Creates a newBuilder
for constructingStreamOptions
.- Returns:
- A new
Builder
instance.
-
-