Class TokenRedisClient
- java.lang.Object
-
- org.odpi.openmetadata.userinterface.uichassis.springboot.auth.redis.TokenRedisClient
-
- All Implemented Interfaces:
TokenClient
public class TokenRedisClient extends Object implements TokenClient
-
-
Constructor Summary
Constructors Constructor Description TokenRedisClient(String host, int port)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddel(String... keys)Longexists(String... keys)Stringget(String key)retrieve expiration from persistenceStringset(String key, long seconds, String value)Stringset(String key, String value)StringsetKeepTTL(String key, String value)Used to postpone expiration but keep existing absolute timeoutvoidshutdownClient()shut down client connectionLongttl(String key)retrieve the absolute timeout of token in seconds
-
-
-
Constructor Detail
-
TokenRedisClient
public TokenRedisClient(String host, int port)
-
-
Method Detail
-
shutdownClient
public void shutdownClient()
Description copied from interface:TokenClientshut down client connection- Specified by:
shutdownClientin interfaceTokenClient
-
set
public String set(String key, long seconds, String value)
- Specified by:
setin interfaceTokenClient- Parameters:
key- the tokenseconds- for absolute timeoutvalue- representation of expiration- Returns:
- the persistence response
-
set
public String set(String key, String value)
- Specified by:
setin interfaceTokenClient- Parameters:
key- the tokenvalue- representation of expiration- Returns:
- the persistence response
-
setKeepTTL
public String setKeepTTL(String key, String value)
Description copied from interface:TokenClientUsed to postpone expiration but keep existing absolute timeout- Specified by:
setKeepTTLin interfaceTokenClient- Parameters:
key- the tokenvalue- representation of expiration- Returns:
- the persistence response
-
get
public String get(String key)
Description copied from interface:TokenClientretrieve expiration from persistence- Specified by:
getin interfaceTokenClient- Parameters:
key- the token- Returns:
- expiration or null if token doesn't exist
-
ttl
public Long ttl(String key)
Description copied from interface:TokenClientretrieve the absolute timeout of token in seconds- Specified by:
ttlin interfaceTokenClient- Parameters:
key- the token to determine ttl for- Returns:
- the ttl for the token
-
del
public void del(String... keys)
- Specified by:
delin interfaceTokenClient- Parameters:
keys- the tokens to be removed from persistence
-
-