Interface TokenClient
public interface TokenClient
TokenClient defines the interface for a stateful web token by using persistence and expiration validation.
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
default String
retrieve expiration from persistencedefault String
default String
default String
setKeepTTL
(String token, String expiration) Used to postpone expiration but keep existing absolute timeoutdefault void
shut down client connectiondefault Long
retrieve the absolute timeout of token in seconds
-
Method Details
-
shutdownClient
default void shutdownClient()shut down client connection -
set
- Parameters:
token
- the tokenseconds
- for absolute timeoutexpiration
- representation of expiration- Returns:
- the persistence response
-
set
- Parameters:
token
- the tokenexpiration
- representation of expiration- Returns:
- the persistence response
-
setKeepTTL
Used to postpone expiration but keep existing absolute timeout- Parameters:
token
- the tokenexpiration
- representation of expiration- Returns:
- the persistence response
-
get
retrieve expiration from persistence- Parameters:
token
- the token- Returns:
- expiration or null if token doesn't exist
-
ttl
retrieve the absolute timeout of token in seconds- Parameters:
token
- the token to determine ttl for- Returns:
- the ttl for the token
-
del
- Parameters:
tokens
- the tokens to be removed from persistence
-