Class SubscribeToStreamOptions

java.lang.Object
com.eventstore.dbclient.SubscribeToStreamOptions

public class SubscribeToStreamOptions extends Object
Options of the subscribe to stream request.
  • Method Details

    • get

      public static SubscribeToStreamOptions get()
      Returns options with default values.
    • fromRevision

      public SubscribeToStreamOptions fromRevision(StreamPosition<Long> startRevision)
      Starts from a stream position.
    • fromStart

      public SubscribeToStreamOptions fromStart()
      Starts from the beginning of the stream.
    • fromEnd

      public SubscribeToStreamOptions fromEnd()
      Starts from the end of the stream.
    • fromRevision

      public SubscribeToStreamOptions fromRevision(long revision)
      Starts from the given event revision.
    • batchSize

      public SubscribeToStreamOptions batchSize(int batchSize)
      The maximum number of events to read from the server at the time.
    • thresholdRatio

      public SubscribeToStreamOptions thresholdRatio(float ratio)
      The ratio of the batch size at which more events should be requested from the server.
    • resolveLinkTos

      public SubscribeToStreamOptions resolveLinkTos(boolean value)
      Whether the subscription should resolve linkTo events to their linked events. Default: false.
    • resolveLinkTos

      public SubscribeToStreamOptions resolveLinkTos()
      Resolve linkTo events to their linked events.
    • notResolveLinkTos

      public SubscribeToStreamOptions notResolveLinkTos()
      Don't resolve linkTo events to their linked events.
    • authenticated

      public SubscribeToStreamOptions authenticated(UserCredentials credentials)
      Sets user credentials for the request
      Parameters:
      credentials -
      Returns:
      updated options
      See Also:
    • authenticated

      public SubscribeToStreamOptions authenticated(String login, String password)
      Sets user credentials for the request
      Parameters:
      login -
      password -
      Returns:
      updated options
    • requiresLeader

      public SubscribeToStreamOptions requiresLeader()
      Requires the request to be performed by the leader of the cluster.
      Returns:
      updated options
    • notRequireLeader

      public SubscribeToStreamOptions notRequireLeader()
      Do not require the request to be performed by the leader of the cluster.
      Returns:
      updated options
    • requiresLeader

      public SubscribeToStreamOptions requiresLeader(boolean value)
      If true, requires the request to be performed by the leader of the cluster.
      Parameters:
      value -
      Returns:
      updated options
    • deadline

      public SubscribeToStreamOptions deadline(long durationInMs)
      A length of time (in milliseconds) to use for gRPC deadlines.
      Parameters:
      durationInMs -
      Returns:
    • header

      public SubscribeToStreamOptions header(String key, String value)
      Adds a custom HTTP header that will be added to the request.