Class InMemorySessionStore

java.lang.Object
iu.auth.session.InMemorySessionStore
All Implemented Interfaces:
IuDataStore

public class InMemorySessionStore extends Object implements IuDataStore
In-memory session store implementation.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    (package private) static class 
    Purges all expired stored sessions.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    byte[]
    get(byte[] key)
    Get the binary value representation from Redis stored for the given key.
    Returns a listing of all entries in the data store (without contents).
    void
    put(byte[] key, byte[] data)
    Puts or deletes data represented by a given key.
    void
    put(byte[] key, byte[] value, Duration ttl)
    Write the given key/value pair to Redis and set the expiration time if defined.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • InMemorySessionStore

      public InMemorySessionStore()
      Default constructor
  • Method Details

    • list

      public Iterable<?> list()
      Description copied from interface: IuDataStore
      Returns a listing of all entries in the data store (without contents).
      Specified by:
      list in interface IuDataStore
      Returns:
      data entry listing
    • get

      public byte[] get(byte[] key)
      Description copied from interface: IuDataStore
      Get the binary value representation from Redis stored for the given key.
      Specified by:
      get in interface IuDataStore
      Parameters:
      key - must not be null.
      Returns:
      null if key does not exist.
    • put

      public void put(byte[] key, byte[] data)
      Description copied from interface: IuDataStore
      Puts or deletes data represented by a given key.
      Specified by:
      put in interface IuDataStore
      Parameters:
      key - data key
      data - data to assign to the key, replaces existing data. May be null to delete existing data.
    • put

      public void put(byte[] key, byte[] value, Duration ttl)
      Description copied from interface: IuDataStore
      Write the given key/value pair to Redis and set the expiration time if defined.
      Specified by:
      put in interface IuDataStore
      Parameters:
      key - key for the cache entry. Must not be null.
      value - value stored for the key. Must not be null.
      ttl - optional expiration time. Can be null.