public class TokenRedisClient extends Object implements TokenClient
| Constructor and Description |
|---|
TokenRedisClient(String host,
int port) |
| Modifier and Type | Method and Description |
|---|---|
void |
del(String... keys) |
Long |
exists(String... keys) |
String |
get(String key)
retrieve expiration from persistence
|
String |
set(String key,
long seconds,
String value) |
String |
set(String key,
String value) |
String |
setKeepTTL(String key,
String value)
Used to postpone expiration but keep existing absolute timeout
|
void |
shutdownClient()
shut down client connection
|
Long |
ttl(String key)
retrieve the absolute timeout of token in seconds
|
public TokenRedisClient(String host, int port)
public void shutdownClient()
TokenClientshutdownClient in interface TokenClientpublic String set(String key, long seconds, String value)
set in interface TokenClientkey - the tokenseconds - for absolute timeoutvalue - representation of expirationpublic String set(String key, String value)
set in interface TokenClientkey - the tokenvalue - representation of expirationpublic String setKeepTTL(String key, String value)
TokenClientsetKeepTTL in interface TokenClientkey - the tokenvalue - representation of expirationpublic String get(String key)
TokenClientget in interface TokenClientkey - the tokenpublic Long ttl(String key)
TokenClientttl in interface TokenClientkey - the token to determine ttl forpublic void del(String... keys)
del in interface TokenClientkeys - the tokens to be removed from persistenceCopyright © 2018–2021 LF AI & Data Foundation. All rights reserved.