Class 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 constructing StreamOptions instances.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static StreamOptions DEFAULT
      Default StreamOptions instance with defaults.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static StreamOptions.Builder builder()
      Creates a new Builder for constructing StreamOptions.
      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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • DEFAULT

        public static final StreamOptions DEFAULT
        Default StreamOptions instance with defaults.
    • Constructor Detail

      • StreamOptions

        public StreamOptions​(StreamOptions.Builder builder)
        Constructs a StreamOptions instance with the specified builder.
        Parameters:
        builder - The StreamOptions.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 new Builder for constructing StreamOptions.
        Returns:
        A new Builder instance.