Class PoolKeyHolder

java.lang.Object
com.saperion.ws.pool.PoolKeyHolder

public final class PoolKeyHolder extends Object
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.
  • Method Details

    • initSessionCleaner

      public static void initSessionCleaner(Properties properties) throws Exception
      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

      public static PoolKeyHolder.Session get(String token)
      Gets the TokenOrCredentialKey by the given token.
      Parameters:
      token - the token to get the key for.
      Returns:
      the TokenOrCredentialKey by the given token.
    • remove

      public static void remove(String token)
      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.