Class AbstractRemoteAuthTokenAPIHandler.TokenInfo
- java.lang.Object
-
- co.arago.hiro.client.model.HiroJsonMap
-
- co.arago.hiro.client.model.HiroMessage
-
- co.arago.hiro.client.model.token.TokenResponse
-
- co.arago.hiro.client.connection.token.AbstractRemoteAuthTokenAPIHandler.TokenInfo
-
- All Implemented Interfaces:
JsonMessage,ToMap,java.io.Serializable
- Enclosing class:
- AbstractRemoteAuthTokenAPIHandler
protected static class AbstractRemoteAuthTokenAPIHandler.TokenInfo extends TokenResponse
Extends the TokenResponse with additional data and operations.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.time.InstantlastUpdateTimestamp of when the token has been fetchedprotected longrefreshOffsetms of offset for token expiry-
Fields inherited from class co.arago.hiro.client.model.token.TokenResponse
application, expiresAt, expiresIn, identity, identityId, refreshToken, token, type
-
Fields inherited from class co.arago.hiro.client.model.HiroMessage
hiroError
-
Fields inherited from class co.arago.hiro.client.model.HiroJsonMap
fieldsMap
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedTokenInfo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.LongexpiresAt()java.time.InstantexpiryInstant()Calculate the Instant after which the token should be refreshed (expiresAt minus therefreshOffset).voidparse(TokenResponse tokenResponse)Copy data from the response to me and setlastUpdate.booleantokenExpired()Check for token expiration-
Methods inherited from class co.arago.hiro.client.model.HiroMessage
catchError, getError, isError, setField
-
Methods inherited from class co.arago.hiro.client.model.HiroJsonMap
addFields, getField, getMap, getUnmappedField, setFields, toMap
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface co.arago.hiro.client.model.JsonMessage
toJsonString, toJsonStringNoNull, toPrettyJsonString, toPrettyJsonStringNoNull
-
-
-
-
Method Detail
-
tokenExpired
public boolean tokenExpired()
Check for token expiration- Returns:
- true if expired or no token is available, false otherwise.
-
expiryInstant
public java.time.Instant expiryInstant()
Calculate the Instant after which the token should be refreshed (expiresAt minus therefreshOffset).- Returns:
- The Instant after which the token shall be refreshed. null if token cannot be refreshed.
-
expiresAt
public java.lang.Long expiresAt()
-
parse
public void parse(TokenResponse tokenResponse)
Copy data from the response to me and setlastUpdate.- Parameters:
tokenResponse- The TokenResponse.
-
-