Class EHCacheTokenStore

java.lang.Object
org.apache.cxf.ws.security.tokenstore.EHCacheTokenStore
All Implemented Interfaces:
Closeable, AutoCloseable, org.apache.cxf.buslifecycle.BusLifeCycleListener, TokenStore

public class EHCacheTokenStore extends Object implements TokenStore, Closeable, org.apache.cxf.buslifecycle.BusLifeCycleListener
An in-memory EHCache implementation of the TokenStore interface. The default TTL is 60 minutes and the max TTL is 12 hours.
  • Constructor Details

  • Method Details

    • add

      public void add(SecurityToken token)
      Description copied from interface: TokenStore
      Add the given token to the cache. The SecurityTokens getId() identifier will be used to key it in the cache.
      Specified by:
      add in interface TokenStore
      Parameters:
      token - The token to be added
    • add

      public void add(String identifier, SecurityToken token)
      Description copied from interface: TokenStore
      Add the given token to the cache under the given identifier
      Specified by:
      add in interface TokenStore
      Parameters:
      identifier - The identifier to use to key the SecurityToken in the cache
      token - The token to be added
    • remove

      public void remove(String identifier)
      Description copied from interface: TokenStore
      Remove an existing token by its identifier
      Specified by:
      remove in interface TokenStore
    • getTokenIdentifiers

      public Collection<String> getTokenIdentifiers()
      Description copied from interface: TokenStore
      Return the list of all valid token identifiers.
      Specified by:
      getTokenIdentifiers in interface TokenStore
      Returns:
      As array of (valid) token identifiers
    • getToken

      public SecurityToken getToken(String identifier)
      Description copied from interface: TokenStore
      Returns the Token of the given identifier
      Specified by:
      getToken in interface TokenStore
      Returns:
      The requested Token identified by the given identifier
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
    • initComplete

      public void initComplete()
      Specified by:
      initComplete in interface org.apache.cxf.buslifecycle.BusLifeCycleListener
    • preShutdown

      public void preShutdown()
      Specified by:
      preShutdown in interface org.apache.cxf.buslifecycle.BusLifeCycleListener
    • postShutdown

      public void postShutdown()
      Specified by:
      postShutdown in interface org.apache.cxf.buslifecycle.BusLifeCycleListener