public interface SessionTracker
Modifier and Type | Interface and Description |
---|---|
static interface |
SessionTracker.Session |
static interface |
SessionTracker.SessionExpirer |
Modifier and Type | Method and Description |
---|---|
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.
|
boolean |
commitSession(long id,
int to)
Add the session to the local session map or global one in zkDB.
|
long |
createSession(int sessionTimeout) |
void |
dumpSessions(PrintWriter pwriter)
Text dump of session information, suitable for debugging.
|
long |
getLocalSessionCount()
If this session tracker supports local sessions, return how many.
|
Map<Long,Set<Long>> |
getSessionExpiryMap()
Returns a mapping of time to session IDs that expire at that time.
|
boolean |
isLocalSessionsEnabled() |
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) |
boolean |
trackSession(long id,
int to)
Track the session expire, not add to ZkDb.
|
long createSession(int sessionTimeout)
boolean trackSession(long id, int to)
id
- sessionIdto
- sessionTimeoutboolean commitSession(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 writerMap<Long,Set<Long>> getSessionExpiryMap()
long getLocalSessionCount()
boolean isLocalSessionsEnabled()
Copyright © 2008–2020 The Apache Software Foundation. All rights reserved.