Package com.atlan.auth
Class TokenManager
java.lang.Object
com.atlan.auth.TokenManager
- Direct Known Subclasses:
APITokenManager
,EscalationTokenManager
,LocalTokenManager
,OAuthClientManager
,UserTokenManager
Manage authorization tokens in a standard way.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract String
Retrieve the header to use for Authorization using this token.final String
getHeader
(AtlanClient client) Retrieve the header to use for Authorization using this token.final boolean
refresh
(AtlanClient client) Refresh the managed token for a new, valid token.protected abstract boolean
refreshToken
(AtlanClient client) Refresh the managed token for a new, valid token.
-
Field Details
-
lock
-
token
protected volatile char[] token
-
-
Constructor Details
-
TokenManager
protected TokenManager(char[] token)
-
-
Method Details
-
getHeader
Retrieve the header to use for Authorization using this token.- Parameters:
client
- through which to retrieve the token (if a refresh is needed)- Returns:
- the value for the Authorization header
- Throws:
AtlanException
- on any API communication issue during attempted refresh (if needed)
-
getAuthHeader
Retrieve the header to use for Authorization using this token.- Returns:
- the value for the Authorization header
-
refresh
Refresh the managed token for a new, valid token.- Parameters:
client
- through which to refresh the token- Returns:
- true iff the refresh was successful
- Throws:
AtlanException
- on any API communication issue during the attempted refresh
-
refreshToken
Refresh the managed token for a new, valid token.- Parameters:
client
- through which to refresh the token- Returns:
- true iff the refresh was successful
- Throws:
AtlanException
- on any API communication issue during the attempted refresh
-