public class HashSessionIdManager extends AbstractSessionIdManager
AbstractLifeCycle.AbstractLifeCycleListener
LifeCycle.Listener
_random, _weakRandom, _workerName
_listeners, FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING
Constructor and Description |
---|
HashSessionIdManager() |
HashSessionIdManager(java.util.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() |
java.lang.String |
getClusterId(java.lang.String nodeId)
Get the session ID without any worker ID.
|
java.lang.String |
getNodeId(java.lang.String clusterId,
javax.servlet.http.HttpServletRequest request)
Get the session ID with any worker ID.
|
java.util.Collection<javax.servlet.http.HttpSession> |
getSession(java.lang.String id) |
java.util.Collection<java.lang.String> |
getSessions() |
boolean |
idInUse(java.lang.String id) |
void |
invalidateAll(java.lang.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(java.util.Random random)
public java.util.Collection<java.lang.String> getSessions()
public java.util.Collection<javax.servlet.http.HttpSession> getSession(java.lang.String id)
public java.lang.String getNodeId(java.lang.String clusterId, javax.servlet.http.HttpServletRequest request)
clusterId
- request
- public java.lang.String getClusterId(java.lang.String nodeId)
nodeId
- the node idprotected void doStart() throws java.lang.Exception
doStart
in class AbstractSessionIdManager
java.lang.Exception
protected void doStop() throws java.lang.Exception
doStop
in class AbstractSessionIdManager
java.lang.Exception
public boolean idInUse(java.lang.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(java.lang.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 © 2013. All Rights Reserved.