Record Class OdysseyRequestManager.TokenAcquisitionResult
java.lang.Object
java.lang.Record
io.confluent.kafka.odyssey.OdysseyRequestManager.TokenAcquisitionResult
- Record Components:
token- The LAT token if acquisition succeeded, empty otherwiseerrorMessage- Human-readable error message if acquisition failed, null on successisPermanent- True if failure will not resolve without external intervention (not retryable)isNotConfigured- True when Token Platform is not configured (Confluent Platform mode)
- Enclosing interface:
OdysseyRequestManager
public static record OdysseyRequestManager.TokenAcquisitionResult(Optional<String> token, String errorMessage, boolean isPermanent, boolean isNotConfigured)
extends Record
Result of token acquisition from Token Platform.
Errors are classified into two categories:
- Permanent (
isPermanent=true): Will not succeed on retry without external intervention (e.g., missing config, permission denied, invalid credentials) - Transient (
isPermanent=false): May succeed on retry (e.g., network timeout, service temporarily unavailable)
-
Constructor Summary
ConstructorsConstructorDescriptionTokenAcquisitionResult(Optional<String> token, String errorMessage, boolean isPermanent, boolean isNotConfigured) Creates an instance of aTokenAcquisitionResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Returns the value of theerrorMessagerecord component.final inthashCode()Returns a hash code value for this object.booleanReturns the value of theisNotConfiguredrecord component.booleanReturns the value of theisPermanentrecord component.booleanpermanentError(String message) token()Returns the value of thetokenrecord component.final StringtoString()Returns a string representation of this record class.transientError(String message)
-
Constructor Details
-
TokenAcquisitionResult
public TokenAcquisitionResult(Optional<String> token, String errorMessage, boolean isPermanent, boolean isNotConfigured) Creates an instance of aTokenAcquisitionResultrecord class.- Parameters:
token- the value for thetokenrecord componenterrorMessage- the value for theerrorMessagerecord componentisPermanent- the value for theisPermanentrecord componentisNotConfigured- the value for theisNotConfiguredrecord component
-
-
Method Details
-
success
-
notConfigured
-
permanentError
-
transientError
-
isSuccess
public boolean isSuccess() -
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
token
-
errorMessage
Returns the value of theerrorMessagerecord component.- Returns:
- the value of the
errorMessagerecord component
-
isPermanent
public boolean isPermanent()Returns the value of theisPermanentrecord component.- Returns:
- the value of the
isPermanentrecord component
-
isNotConfigured
public boolean isNotConfigured()Returns the value of theisNotConfiguredrecord component.- Returns:
- the value of the
isNotConfiguredrecord component
-