Class MxGatewayClientOptions.Builder

java.lang.Object
com.zb.mom.ww.mxgateway.client.MxGatewayClientOptions.Builder
Enclosing class:
MxGatewayClientOptions

public static final class MxGatewayClientOptions.Builder extends Object
Mutable builder for MxGatewayClientOptions.
  • Method Details

    • endpoint

      public MxGatewayClientOptions.Builder endpoint(String value)
      Sets the gRPC target endpoint.
      Parameters:
      value - endpoint in host:port or DNS-target form; required
      Returns:
      this builder
    • apiKey

      public MxGatewayClientOptions.Builder apiKey(String value)
      Sets the API key sent in the authorization header.
      Parameters:
      value - the API key, or null/blank to disable authentication
      Returns:
      this builder
    • plaintext

      public MxGatewayClientOptions.Builder plaintext(boolean value)
      Selects plaintext transport instead of TLS.
      Parameters:
      value - true for plaintext, false for TLS
      Returns:
      this builder
    • caCertificatePath

      public MxGatewayClientOptions.Builder caCertificatePath(Path value)
      Sets the CA certificate used to verify the gateway server.
      Parameters:
      value - path to a PEM-encoded CA certificate, or null to use the platform trust store
      Returns:
      this builder
    • requireCertificateValidation

      public MxGatewayClientOptions.Builder requireCertificateValidation(boolean value)
      When true, TLS connections without a pinned CA use the OS trust store and will reject the gateway's self-signed certificate. When false (default), the gateway certificate is accepted without verification — appropriate for this internal tool's auto-generated self-signed certificate. Pinning a CA via caCertificatePath(Path) always verifies.
      Parameters:
      value - true to require certificate validation, false to accept any cert
      Returns:
      this builder
    • serverNameOverride

      public MxGatewayClientOptions.Builder serverNameOverride(String value)
      Overrides the TLS server name used during the handshake.
      Parameters:
      value - the override host name, or empty/null for none
      Returns:
      this builder
    • connectTimeout

      public MxGatewayClientOptions.Builder connectTimeout(Duration value)
      Sets the channel connect timeout.
      Parameters:
      value - the connect timeout, must be non-null
      Returns:
      this builder
      Throws:
      NullPointerException - if value is null
    • callTimeout

      public MxGatewayClientOptions.Builder callTimeout(Duration value)
      Sets the per-call deadline applied to unary RPCs.
      Parameters:
      value - the call timeout, must be non-null
      Returns:
      this builder
      Throws:
      NullPointerException - if value is null
    • streamTimeout

      public MxGatewayClientOptions.Builder streamTimeout(Duration value)
      Sets the deadline applied to server-streaming RPCs.
      Parameters:
      value - the stream timeout, must be non-null
      Returns:
      this builder
      Throws:
      NullPointerException - if value is null
    • maxGrpcMessageBytes

      public MxGatewayClientOptions.Builder maxGrpcMessageBytes(int value)
    • build

      public MxGatewayClientOptions build()
      Builds an immutable MxGatewayClientOptions from the current state.
      Returns:
      a new options instance
      Throws:
      IllegalArgumentException - if endpoint was not set or is blank