public void checkSession(long sessionId, Object owner) throws SessionExpiredException, SessionMovedException { if (localSessionTracker != null) { try { localSessionTracker.checkSession(sessionId, owner); return; } catch (UnknownSessionException e) { // Check whether it's a global session. We can ignore those // because they are handled at the leader, but if not, rethrow. // We check local session status first to avoid race condition // with session upgrading. if (!isGlobalSession(sessionId)) { throw new SessionExpiredException(); } } } }
public void checkGlobalSession(long sessionId, Object owner) throws SessionExpiredException, SessionMovedException { try { globalSessionTracker.checkSession(sessionId, owner); } catch (UnknownSessionException e) { // For global session, if we don't know it, it is already expired throw new SessionExpiredException(); } }
@Override public void checkSession(long sessionId, Object owner) throws SessionExpiredException, SessionMovedException { // TODO Auto-generated method stub }
@Override public void checkGlobalSession(long sessionId, Object owner) throws SessionExpiredException, SessionMovedException { // TODO Auto-generated method stub }
/** * Checks whether the SessionTracker is aware of this session, the session * is still active, and the owner matches. If the owner wasn't previously * set, this sets the owner of the session. * * UnknownSessionException should never been thrown to the client. It is * only used internally to deal with possible local session from other * machine * * @param sessionId * @param owner */ public void checkSession(long sessionId, Object owner) throws KeeperException.SessionExpiredException, KeeperException.SessionMovedException, KeeperException.UnknownSessionException;
/** * Strictly check that a given session is a global session or not * @param sessionId * @param owner * @throws KeeperException.SessionExpiredException * @throws KeeperException.SessionMovedException */ public void checkGlobalSession(long sessionId, Object owner) throws KeeperException.SessionExpiredException, KeeperException.SessionMovedException;
void checkSession(long sessionId, Object owner) throws KeeperException.SessionExpiredException, SessionMovedException;