Class AbstractSessionStore<A,B extends Session<A>>

java.lang.Object
io.inverno.mod.session.AbstractSessionStore<A,B>
Type Parameters:
A - the session data type
B - the session type
All Implemented Interfaces:
SessionStore<A,B>
Direct Known Subclasses:
InMemoryBasicSessionStore, InMemoryJWTSessionStore, RedisBasicSessionStore, RedisJWTSessionStore

public abstract class AbstractSessionStore<A,B extends Session<A>> extends Object implements SessionStore<A,B>

Base SessionStore implementation class.

Since:
1.13
Author:
Jeremy Kuhn
  • Field Details

    • sessionIdGenerator

      protected final SessionIdGenerator<A,B extends Session<A>> sessionIdGenerator
      The session id generator.
    • maxInactiveInterval

      protected final Long maxInactiveInterval
      The initial maximum inactive interval in milliseconds to set when creating a new session.
    • expireAfterPeriod

      protected final Long expireAfterPeriod
      The period in milliseconds after a which a new session must expire.
  • Constructor Details

    • AbstractSessionStore

      protected AbstractSessionStore(SessionIdGenerator<A,B> sessionIdGenerator, Long maxInactiveInterval, Long expireAfterPeriod) throws IllegalArgumentException

      Creates a base session store.

      Parameters:
      sessionIdGenerator - a session id generator
      maxInactiveInterval - the initial maximum inactive interval in milliseconds
      expireAfterPeriod - the period in milliseconds after which a new session must expire
      Throws:
      IllegalArgumentException - if both maximum inactive interval and expire after period are null
  • Method Details

    • getSessionIdGenerator

      public SessionIdGenerator<A,? extends Session<A>> getSessionIdGenerator()

      Returns the session id generator.

      Returns:
      the session id generator
    • getMaxInactiveInterval

      public Long getMaxInactiveInterval()

      Returns the initial maximum inactive interval in milliseconds to set when creating a new session.

      Returns:
      the maximum inactive interval in milliseconds
    • getExpireAfterPeriod

      public Long getExpireAfterPeriod()

      Returns the period in milliseconds after a which a new session must expire.

      Returns:
      the period in milliseconds after which a new session must expire