Package com.ultikits.ultitools.utils
Class DeviceAuthorizationClient.PollResult
java.lang.Object
com.ultikits.ultitools.utils.DeviceAuthorizationClient.PollResult
- Enclosing class:
DeviceAuthorizationClient
The outcome of one token poll.
toString() omits the credential.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static enumRFC 8628 ยง3.5 outcomes, plus the two local ones. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Stringprivate final ServerCredentialprivate final DeviceAuthorizationClient.PollResult.Kindprivate final Stringprivate final long -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivatePollResult(DeviceAuthorizationClient.PollResult.Kind kind, ServerCredential credential, String code, String message, long retryAfterSeconds) -
Method Summary
Modifier and TypeMethodDescription(package private) Stringcode()(package private) ServerCredential(package private) static DeviceAuthorizationClient.PollResultgranted(ServerCredential credential) (package private) DeviceAuthorizationClient.PollResult.Kindkind()(package private) Stringmessage()(package private) static DeviceAuthorizationClient.PollResult(package private) static DeviceAuthorizationClient.PollResult(package private) longtoString()(package private) static DeviceAuthorizationClient.PollResulttransientFailure(long retryAfterSeconds)
-
Field Details
-
kind
-
credential
-
code
-
message
-
retryAfterSeconds
private final long retryAfterSeconds
-
-
Constructor Details
-
PollResult
private PollResult(DeviceAuthorizationClient.PollResult.Kind kind, ServerCredential credential, String code, String message, long retryAfterSeconds)
-
-
Method Details
-
of
-
granted
-
rejected
-
transientFailure
-
kind
- Returns:
- the outcome; never
null
-
credential
ServerCredential credential()- Returns:
- the issued credential when
DeviceAuthorizationClient.PollResult.Kind.GRANTED, otherwisenull
-
code
String code()- Returns:
- the backend error code when
DeviceAuthorizationClient.PollResult.Kind.REJECTED, otherwisenull
-
message
String message()- Returns:
- the sanitised backend message when
DeviceAuthorizationClient.PollResult.Kind.REJECTED, otherwisenull
-
retryAfterSeconds
long retryAfterSeconds()- Returns:
- the
Retry-Afterof a 429 in seconds, or-1
-
toString
-