java.lang.Object
org.odpi.openmetadata.userinterface.uichassis.springboot.auth.redis.TokenRedisClient
All Implemented Interfaces:
TokenClient

public class TokenRedisClient extends Object implements TokenClient
  • Constructor Details

    • TokenRedisClient

      public TokenRedisClient(String host, int port)
  • Method Details

    • shutdownClient

      public void shutdownClient()
      Description copied from interface: TokenClient
      shut down client connection
      Specified by:
      shutdownClient in interface TokenClient
    • set

      public String set(String key, long seconds, String value)
      Specified by:
      set in interface TokenClient
      Parameters:
      key - the token
      seconds - for absolute timeout
      value - representation of expiration
      Returns:
      the persistence response
    • set

      public String set(String key, String value)
      Specified by:
      set in interface TokenClient
      Parameters:
      key - the token
      value - representation of expiration
      Returns:
      the persistence response
    • setKeepTTL

      public String setKeepTTL(String key, String value)
      Description copied from interface: TokenClient
      Used to postpone expiration but keep existing absolute timeout
      Specified by:
      setKeepTTL in interface TokenClient
      Parameters:
      key - the token
      value - representation of expiration
      Returns:
      the persistence response
    • get

      public String get(String key)
      Description copied from interface: TokenClient
      retrieve expiration from persistence
      Specified by:
      get in interface TokenClient
      Parameters:
      key - the token
      Returns:
      expiration or null if token doesn't exist
    • ttl

      public Long ttl(String key)
      Description copied from interface: TokenClient
      retrieve the absolute timeout of token in seconds
      Specified by:
      ttl in interface TokenClient
      Parameters:
      key - the token to determine ttl for
      Returns:
      the ttl for the token
    • exists

      public Long exists(String... keys)
    • del

      public void del(String... keys)
      Specified by:
      del in interface TokenClient
      Parameters:
      keys - the tokens to be removed from persistence