Class ReadStreamOptions

java.lang.Object
com.eventstore.dbclient.ReadStreamOptions

public class ReadStreamOptions extends Object
Options of the read stream request.
  • Method Details

    • get

      public static ReadStreamOptions get()
      Returns options with default values.
    • direction

      public ReadStreamOptions direction(Direction direction)
      Reads stream in the given direction.
    • forwards

      public ReadStreamOptions forwards()
      Reads stream in revision-ascending order.
    • backwards

      public ReadStreamOptions backwards()
      Reads stream in revision-descending order.
    • maxCount

      public ReadStreamOptions maxCount(long maxCount)
      The maximum event count EventStoreDB will return.
    • fromRevision

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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