public class HashSessionIdManager extends AbstractSessionIdManager
AbstractLifeCycle.AbstractLifeCycleListener
LifeCycle.Listener
_random, _weakRandom, _workerName
_listeners, FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING
Constructor and Description |
---|
HashSessionIdManager() |
HashSessionIdManager(Random random) |
Modifier and Type | Method and Description |
---|---|
void |
addSession(javax.servlet.http.HttpSession session)
Add a session to the list of known sessions for a given ID.
|
protected void |
doStart() |
protected void |
doStop() |
String |
getClusterId(String nodeId)
Get the session ID without any worker ID.
|
String |
getNodeId(String clusterId,
javax.servlet.http.HttpServletRequest request)
Get the session ID with any worker ID.
|
Collection<javax.servlet.http.HttpSession> |
getSession(String id) |
Collection<String> |
getSessions() |
boolean |
idInUse(String id) |
void |
invalidateAll(String id)
Call
HttpSession.invalidate() on all known sessions for the given id. |
void |
removeSession(javax.servlet.http.HttpSession session)
Remove session from the list of known sessions for a given ID.
|
getRandom, getWorkerName, initRandom, newSessionId, setRandom, setWorkerName
addLifeCycleListener, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
public HashSessionIdManager()
public HashSessionIdManager(Random random)
public Collection<String> getSessions()
public Collection<javax.servlet.http.HttpSession> getSession(String id)
public String getNodeId(String clusterId, javax.servlet.http.HttpServletRequest request)
clusterId
- request
- public String getClusterId(String nodeId)
nodeId
- the node idprotected void doStart() throws Exception
doStart
in class AbstractSessionIdManager
Exception
protected void doStop() throws Exception
doStop
in class AbstractSessionIdManager
Exception
public boolean idInUse(String id)
id
- The session ID without any cluster node extensionSessionIdManager.idInUse(String)
public void addSession(javax.servlet.http.HttpSession session)
SessionIdManager
session
- The sessionSessionIdManager.addSession(HttpSession)
public void removeSession(javax.servlet.http.HttpSession session)
SessionIdManager
public void invalidateAll(String id)
SessionIdManager
HttpSession.invalidate()
on all known sessions for the given id.id
- The session ID without any cluster node extensionSessionIdManager.invalidateAll(String)
Copyright © 1995-2013 Mort Bay Consulting. All Rights Reserved.