Class AppendToStreamOptions

java.lang.Object
com.eventstore.dbclient.AppendToStreamOptions

public class AppendToStreamOptions extends Object
Options of the append stream request.
  • Method Details

    • get

      public static AppendToStreamOptions get()
      Returns options with default values.
    • expectedRevision

      public AppendToStreamOptions expectedRevision(ExpectedRevision revision)
      Asks the server to check that the stream receiving is at the given expected version.
      Parameters:
      revision - - expected revision.
      Returns:
      updated options.
    • expectedRevision

      public AppendToStreamOptions expectedRevision(long revision)
      Asks the server to check that the stream receiving is at the given expected version.
      Parameters:
      revision - - expected revision.
      Returns:
      updated options.
    • authenticated

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

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

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

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

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

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

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