Class RequestConfigResult

java.lang.Object
io.confluent.telemetry.config.remote.polling.RequestConfigResult

public final class RequestConfigResult extends Object
Wrapper class that encapsulates the result of requesting remote configuration. This class allows implementations to distinguish between different types of results and determine appropriate retry behavior.
  • Method Details

    • success

      public static RequestConfigResult success(io.confluent.telemetry.config.v2.remote.RemoteConfiguration config)
      Creates a successful result with the retrieved configuration.
      Parameters:
      config - the remote configuration that was successfully retrieved
      Returns:
      a RequestConfigResult indicating success
    • noUpdate

      public static RequestConfigResult noUpdate()
      Creates a result indicating that the configuration has not changed since the last check.
      Returns:
      a RequestConfigResult indicating no update
    • notFound

      public static RequestConfigResult notFound()
      Creates a result indicating that no configuration was found.
      Returns:
      a RequestConfigResult indicating not found
    • retryableError

      public static RequestConfigResult retryableError(Exception error)
      Creates a result indicating a retryable error occurred.
      Parameters:
      error - the error that occurred
      Returns:
      a RequestConfigResult indicating a retryable error
    • nonRetryableError

      public static RequestConfigResult nonRetryableError(Exception error)
      Creates a result indicating a non-retryable error occurred.
      Parameters:
      error - the error that occurred
      Returns:
      a RequestConfigResult indicating a non-retryable error
    • getConfig

      public io.confluent.telemetry.config.v2.remote.RemoteConfiguration getConfig()
    • getError

      public Exception getError()
    • getErrorMessage

      public String getErrorMessage()
    • isSuccess

      public boolean isSuccess()
      Returns:
      true if this result represents successful configuration retrieval
    • isRetryableError

      public boolean isRetryableError()
      Returns:
      true if this result represents an error that should trigger retry
    • isNonRetryableError

      public boolean isNonRetryableError()
      Returns:
      true if this result represents an error that should not trigger retry
    • isError

      public boolean isError()
      Returns:
      true if this result represents any type of error (retryable or non-retryable)
    • isNoUpdate

      public boolean isNoUpdate()
      Returns:
      true if this result indicates no update was needed
    • isNotFound

      public boolean isNotFound()
      Returns:
      true if this result indicates no configuration was found
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object