public interface SessionTracker
Modifier and Type | Interface and Description |
---|---|
static interface |
SessionTracker.Session |
static interface |
SessionTracker.SessionExpirer |
Modifier and Type | Method and Description |
---|---|
boolean |
addGlobalSession(long id,
int to)
Add a global session to those being tracked.
|
boolean |
addSession(long id,
int to)
Add a session to those being tracked.
|
void |
checkGlobalSession(long sessionId,
Object owner)
Strictly check that a given session is a global session or not
|
void |
checkSession(long sessionId,
Object owner)
Checks whether the SessionTracker is aware of this session, the session
is still active, and the owner matches.
|
long |
createSession(int sessionTimeout) |
void |
dumpSessions(PrintWriter pwriter)
Text dump of session information, suitable for debugging.
|
Map<Long,Set<Long>> |
getSessionExpiryMap()
Returns a mapping of time to session IDs that expire at that time.
|
boolean |
isTrackingSession(long sessionId) |
void |
removeSession(long sessionId) |
void |
setOwner(long id,
Object owner) |
void |
setSessionClosing(long sessionId)
Mark that the session is in the process of closing.
|
void |
shutdown() |
boolean |
touchSession(long sessionId,
int sessionTimeout) |
long createSession(int sessionTimeout)
boolean addGlobalSession(long id, int to)
id
- sessionIdto
- sessionTimeoutboolean addSession(long id, int to)
id
- sessionIdto
- sessionTimeoutboolean touchSession(long sessionId, int sessionTimeout)
sessionId
- sessionTimeout
- void setSessionClosing(long sessionId)
sessionId
- void shutdown()
void removeSession(long sessionId)
sessionId
- boolean isTrackingSession(long sessionId)
sessionId
- void checkSession(long sessionId, Object owner) throws KeeperException.SessionExpiredException, KeeperException.SessionMovedException, KeeperException.UnknownSessionException
sessionId
- owner
- KeeperException.SessionExpiredException
KeeperException.SessionMovedException
KeeperException.UnknownSessionException
void checkGlobalSession(long sessionId, Object owner) throws KeeperException.SessionExpiredException, KeeperException.SessionMovedException
sessionId
- owner
- KeeperException.SessionExpiredException
KeeperException.SessionMovedException
void setOwner(long id, Object owner) throws KeeperException.SessionExpiredException
void dumpSessions(PrintWriter pwriter)
pwriter
- the output writerCopyright © 2008–2019 The Apache Software Foundation. All rights reserved.