public class GCloudSessionIdManager extends AbstractSessionIdManager
AbstractLifeCycle.AbstractLifeCycleListener
LifeCycle.Listener
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_IDLE_EXPIRY_MULTIPLE |
static String |
KIND |
_random, _reseed, _weakRandom, _workerAttr, _workerName
Constructor and Description |
---|
GCloudSessionIdManager(Server server) |
GCloudSessionIdManager(Server server,
Random random) |
Modifier and Type | Method and Description |
---|---|
void |
addSession(HttpSession session)
Remember a new in-use session id.
|
protected void |
delete(String id)
Remove a session id from the cluster.
|
protected void |
doStart()
Start the id manager.
|
protected void |
doStop()
Stop the id manager
|
protected boolean |
exists(String id)
Ask the datastore if a particular id exists.
|
boolean |
idInUse(String id)
Check to see if the given session id is being
used by a session in any context.
|
protected void |
insert(String id)
Put a session id into the cluster.
|
void |
invalidateAll(String id)
Remove a session id.
|
protected com.google.cloud.datastore.Key |
makeKey(String id)
Generate a unique key from the session id.
|
void |
removeSession(HttpSession session)
Remove a session id from the list of in-use ids.
|
void |
renewSessionId(String oldClusterId,
String oldNodeId,
HttpServletRequest request)
Change a session id.
|
getClusterId, getNodeId, getRandom, getReseed, getWorkerName, initRandom, newSessionId, newSessionId, setRandom, setReseed, setWorkerName
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, setStopTimeout, start, stop
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
public static final int DEFAULT_IDLE_EXPIRY_MULTIPLE
public static final String KIND
public GCloudSessionIdManager(Server server)
server
- protected void doStart() throws Exception
doStart
in class AbstractSessionIdManager
Exception
AbstractSessionIdManager.doStart()
protected void doStop() throws Exception
doStop
in class AbstractSessionIdManager
Exception
AbstractSessionIdManager.doStop()
public boolean idInUse(String id)
id
- The session ID without any cluster node extensionSessionIdManager.idInUse(java.lang.String)
public void addSession(HttpSession session)
session
- The sessionSessionIdManager.addSession(javax.servlet.http.HttpSession)
public void removeSession(HttpSession session)
session
- the session to removeSessionIdManager.removeSession(javax.servlet.http.HttpSession)
public void invalidateAll(String id)
id
- The session ID without any cluster node extensionSessionIdManager.invalidateAll(java.lang.String)
public void renewSessionId(String oldClusterId, String oldNodeId, HttpServletRequest request)
renewSessionId
in interface SessionIdManager
renewSessionId
in class AbstractSessionIdManager
oldClusterId
- the old cluster idoldNodeId
- the old node idrequest
- the request containing the sessionAbstractSessionIdManager.renewSessionId(java.lang.String, java.lang.String, javax.servlet.http.HttpServletRequest)
protected boolean exists(String id)
id
- the session id to check for existenceprotected void insert(String id)
id
- the id to mark as in useprotected void delete(String id)
id
- the id to removeprotected com.google.cloud.datastore.Key makeKey(String id)
id
- the id of the sessionCopyright © 1995-2016 Webtide. All Rights Reserved.