org.apache.zookeeper.server
Interface SessionTracker

All Known Implementing Classes:
FollowerSessionTracker, 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.SessionExpirer
           
 
Method Summary
 void addSession(long id, int to)
           
 void checkSession(long sessionId, Object owner)
           
 long createSession(int sessionTimeout)
           
 void removeSession(long sessionId)
           
 void setOwner(long id, Object owner)
           
 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

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