Package de.pisa.psa.rst.uti
Class IAMTokenCache
java.lang.Object
de.pisa.psa.rst.uti.IAMTokenCache
Cache for IAM tokens
- Since:
- 27.07.2023
- Author:
- weiland
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionfinal class
response for a required authenticationfinal class
cache entryclass
expire logic -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
clear all cache entriesfindInvalidEntry
(String token) search an IAM token in the invalid cache entriesfindValidEntry
(String token) search an IAM token in the valid cache entriesstatic IAMTokenCache
get()
get the instanceGet the response if the authentication is requiredputAuthenticationRequired
(int status, String json) put the response if the authentication is requiredvoid
putInvalidEntry
(String token) add an invalid token to the cachevoid
putValidEntry
(String token, de.pisa.psa.com.dxhub.iam.UserInfo user_info) add a valid token to the cachevoid
setExpiresIn
(int seconds) set the time when the entries expirevoid
setSize
(int size) set the cache size
-
Method Details
-
get
get the instance- Returns:
- instance
-
setExpiresIn
public void setExpiresIn(int seconds) set the time when the entries expire- Parameters:
seconds
- time in seconds
-
setSize
public void setSize(int size) set the cache size- Parameters:
size
- number of elements
-
findValidEntry
search an IAM token in the valid cache entries- Parameters:
token
- token to search- Returns:
- cache entry
-
findInvalidEntry
search an IAM token in the invalid cache entries- Parameters:
token
- token to search- Returns:
- cache entry
-
putValidEntry
add a valid token to the cache- Parameters:
token
- IAM tokenuser_info
- user information
-
putInvalidEntry
add an invalid token to the cache- Parameters:
token
- IAM token
-
putAuthenticationRequired
put the response if the authentication is required- Parameters:
status
- status codejson
- entity- Returns:
- response
-
getAuthenticationRequired
Get the response if the authentication is required- Returns:
- response
-
clear
public void clear()clear all cache entries
-