org.apache.zookeeper.server
Interface SessionTracker

All Known Implementing Classes:
LearnerSessionTracker, SessionTrackerImpl

public interface SessionTracker

This is the basic interface that ZooKeeperServer uses to track sessions. The standalone and leader ZooKeeperServer use the same SessionTracker. The FollowerZooKeeperServer uses a SessionTracker which is basically a simple shell to track information to be forwarded to the leader.


Nested Class Summary
static interface SessionTracker.Session
           
static interface SessionTracker.SessionExpirer
           
 
Method Summary
 void addSession(long id, int to)
           
 void checkSession(long sessionId, Object owner)
           
 long createSession(int sessionTimeout)
           
 void dumpSessions(PrintWriter pwriter)
          Text dump of session information, suitable for debugging.
 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)
           
 

Method Detail

createSession

long createSession(int sessionTimeout)

addSession

void addSession(long id,
                int to)

touchSession

boolean touchSession(long sessionId,
                     int sessionTimeout)
Parameters:
sessionId -
sessionTimeout -
Returns:
false if session is no longer active

setSessionClosing

void setSessionClosing(long sessionId)
Mark that the session is in the process of closing.

Parameters:
sessionId -

shutdown

void shutdown()

removeSession

void removeSession(long sessionId)
Parameters:
sessionId -

checkSession

void checkSession(long sessionId,
                  Object owner)
                  throws KeeperException.SessionExpiredException,
                         KeeperException.SessionMovedException
Throws:
KeeperException.SessionExpiredException
KeeperException.SessionMovedException

setOwner

void setOwner(long id,
              Object owner)
              throws KeeperException.SessionExpiredException
Throws:
KeeperException.SessionExpiredException

dumpSessions

void dumpSessions(PrintWriter pwriter)
Text dump of session information, suitable for debugging.

Parameters:
pwriter - the output writer


Copyright © 2011 The Apache Software Foundation