Package com.saperion.ws.pool
Class PoolKeyHolder
java.lang.Object
com.saperion.ws.pool.PoolKeyHolder
The Class PoolKeyHolder is used to store a map of tokens to TokenOrCredentialKey (which is
referred to as a session). In addition, a timeout is maintained for each session. If the
timeout is reached, the session will be removed from the map.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic String
Stores the given TokenOrCredentialKey.static PoolKeyHolder.Session
Gets the TokenOrCredentialKey by the given token.static void
initSessionCleaner
(Properties properties) static void
Logs the current content of the token map to the logger using DEBUG level.static void
Removes the key by the given token.static void
-
Method Details
-
initSessionCleaner
- Throws:
Exception
-
stopSessionCleaner
public static void stopSessionCleaner() -
add
public static String add(String token, com.lexmark.saperion.remote.common.authentication.Credentials key) Stores the given TokenOrCredentialKey. If the given token is already contained in the underlying map, a new token is created. The actual stored token is returned.- Parameters:
token
- the token to identify the given key.key
- the key to store.- Returns:
-
get
Gets the TokenOrCredentialKey by the given token.- Parameters:
token
- the token to get the key for.- Returns:
- the TokenOrCredentialKey by the given token.
-
remove
Removes the key by the given token.- Parameters:
token
- the token to remove the key for.
-
logStatistic
public static void logStatistic()Logs the current content of the token map to the logger using DEBUG level.
-