Record Class TokenPlatformClientConfig

java.lang.Object
java.lang.Record
io.confluent.kafka.odyssey.auth.TokenPlatformClientConfig
Record Components:
tokenPlatformUrl - the Token Platform gRPC endpoint URL (required)
spireAgentUrl - the SPIRE agent socket URL for mTLS authentication (required)
requestTimeoutMs - gRPC request timeout in milliseconds (must be positive)
maxRetries - maximum number of retry attempts for transient failures (must be non-negative)

public record TokenPlatformClientConfig(String tokenPlatformUrl, String spireAgentUrl, int requestTimeoutMs, int maxRetries) extends Record
Immutable configuration for TokenPlatformClient.

This record holds all configuration needed to connect to the Token Platform service using SPIRE mTLS authentication.

  • Field Details

    • DEFAULT_REQUEST_TIMEOUT_MS

      public static final int DEFAULT_REQUEST_TIMEOUT_MS
      Default request timeout: 5 seconds
      See Also:
    • DEFAULT_MAX_RETRIES

      public static final int DEFAULT_MAX_RETRIES
      Default max retries: 3 attempts
      See Also:
  • Constructor Details

    • TokenPlatformClientConfig

      public TokenPlatformClientConfig(String tokenPlatformUrl, String spireAgentUrl, int requestTimeoutMs, int maxRetries)
      Compact constructor with validation.
  • Method Details

    • create

      public static TokenPlatformClientConfig create(String tokenPlatformUrl, String spireAgentUrl)
      Creates a configuration with default timeout and retry settings.
      Parameters:
      tokenPlatformUrl - the Token Platform gRPC endpoint URL
      spireAgentUrl - the SPIRE agent socket URL
      Returns:
      a new configuration instance
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • tokenPlatformUrl

      public String tokenPlatformUrl()
      Returns the value of the tokenPlatformUrl record component.
      Returns:
      the value of the tokenPlatformUrl record component
    • spireAgentUrl

      public String spireAgentUrl()
      Returns the value of the spireAgentUrl record component.
      Returns:
      the value of the spireAgentUrl record component
    • requestTimeoutMs

      public int requestTimeoutMs()
      Returns the value of the requestTimeoutMs record component.
      Returns:
      the value of the requestTimeoutMs record component
    • maxRetries

      public int maxRetries()
      Returns the value of the maxRetries record component.
      Returns:
      the value of the maxRetries record component