Interface SessionIdManager

All Superinterfaces:
org.eclipse.jetty.util.component.LifeCycle
All Known Implementing Classes:
DefaultSessionIdManager

public interface SessionIdManager extends org.eclipse.jetty.util.component.LifeCycle
Session ID Manager. Manages session IDs across multiple contexts.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle

    org.eclipse.jetty.util.component.LifeCycle.Listener
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Expire all sessions on all contexts that share the same id.
    getExtendedId(String id, org.eclipse.jetty.server.Request request)
    Get an extended id for a session.
    getId(String qualifiedId)
    Get just the session id from an id that includes the worker name as a suffix.
     
     
    void
    Invalidate all sessions on all contexts that share the same id.
    boolean
     
    newSessionId(org.eclipse.jetty.server.Request request, String requestedId, long created)
    Create a new Session ID.
    renewSessionId(String oldId, String oldExtendedId, org.eclipse.jetty.server.Request request)
    Change the existing session id.
    void
     
    void
    Set the housekeeper for doing scavenging.

    Methods inherited from interface org.eclipse.jetty.util.component.LifeCycle

    addEventListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeEventListener, start, stop
  • Method Details

    • isIdInUse

      boolean isIdInUse(String id)
      Parameters:
      id - The plain session ID (ie no workername extension)
      Returns:
      True if the session ID is in use by at least one context.
    • expireAll

      void expireAll(String id)
      Expire all sessions on all contexts that share the same id.
      Parameters:
      id - The session ID without any cluster node extension
    • invalidateAll

      void invalidateAll(String id)
      Invalidate all sessions on all contexts that share the same id.
      Parameters:
      id - the session id
    • newSessionId

      String newSessionId(org.eclipse.jetty.server.Request request, String requestedId, long created)
      Create a new Session ID.
      Parameters:
      request - the request asking for a new session
      requestedId - the session id requested by the session
      created - the timestamp for when the session was created
      Returns:
      the new session id
    • getWorkerName

      String getWorkerName()
      Returns:
      the unique name of this server instance
    • getId

      String getId(String qualifiedId)
      Get just the session id from an id that includes the worker name as a suffix. Strip node identifier from a located session ID.
      Parameters:
      qualifiedId - the session id including the worker name
      Returns:
      the cluster id
    • getExtendedId

      String getExtendedId(String id, org.eclipse.jetty.server.Request request)
      Get an extended id for a session. An extended id contains the workername as a suffix.
      Parameters:
      id - The id of the session
      request - The request that for the session (or null)
      Returns:
      The session id qualified with the worker name
    • renewSessionId

      String renewSessionId(String oldId, String oldExtendedId, org.eclipse.jetty.server.Request request)
      Change the existing session id.
      Parameters:
      oldId - the old plain session id
      oldExtendedId - the old fully qualified id
      request - the request containing the session
      Returns:
      the new session id
    • scavenge

      void scavenge()
    • setSessionHouseKeeper

      void setSessionHouseKeeper(HouseKeeper houseKeeper)
      Set the housekeeper for doing scavenging.
      Parameters:
      houseKeeper - the housekeeper for doing scavenging
    • getSessionHouseKeeper

      HouseKeeper getSessionHouseKeeper()
      Returns:
      the housekeeper for doing scavenging