Interface ReplayCache

All Superinterfaces:
AutoCloseable, Closeable
All Known Implementing Classes:
EHCacheReplayCache, MemoryReplayCache

public interface ReplayCache extends Closeable
A cache to store (String) identifiers to avoid replay attacks. An example of such an identifier is a UsernameToken nonce.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(String identifier)
    Add the given identifier to the cache.
    void
    add(String identifier, Instant expiry)
    Add the given identifier to the cache to be cached for the given time
    boolean
    contains(String identifier)
    Return true if the given identifier is contained in the cache

    Methods inherited from interface java.io.Closeable

    close
  • Method Details

    • add

      void add(String identifier)
      Add the given identifier to the cache. It will be cached for a default amount of time.
      Parameters:
      identifier - The identifier to be added
    • add

      void add(String identifier, Instant expiry)
      Add the given identifier to the cache to be cached for the given time
      Parameters:
      identifier - The identifier to be added
      expiry - A custom expiry time for the identifier
    • contains

      boolean contains(String identifier)
      Return true if the given identifier is contained in the cache
      Parameters:
      identifier - The identifier to check