# Class LocalSessionTracker

java.lang.Object
java.lang.Thread
org.apache.zookeeper.server.ZooKeeperThread
org.apache.zookeeper.server.ZooKeeperCriticalThread
org.apache.zookeeper.server.SessionTrackerImpl
org.apache.zookeeper.server.quorum.LocalSessionTracker

All Implemented Interfaces:
  `Runnable, SessionTracker`

public class LocalSessionTracker extends SessionTrackerImpl
Local session tracker.

## Nested Class Summary

### Nested classes/interfaces inherited from class SessionTrackerImpl

`SessionTrackerImpl.SessionImpl`

### Nested classes/interfaces inherited from class Thread

`Thread.State, Thread.UncaughtExceptionHandler`

### Nested classes/interfaces inherited from interface SessionTracker

`SessionTracker.Session, SessionTracker.SessionExpirer`

## Field Summary

### Fields inherited from class SessionTrackerImpl

`sessionsById, sessionsWithTimeout`

### Fields inherited from class Thread

`MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY`

## Constructor Summary

Constructors
Constructor
Description
`LocalSessionTracker(SessionTracker.SessionExpirer expirer, ConcurrentMap<Long,Integer> sessionsWithTimeouts, int tickTime, long id, ZooKeeperServerListener listener)`

## Method Summary

Modifier and Type
Method
Description
`long`
`createSession(int sessionTimeout)`
`boolean`
`isGlobalSession(long sessionId)`
`boolean`
`isLocalSession(long sessionId)`
`Set<Long>`
`localSessions()`
Get a set of local session IDs

### Methods inherited from class SessionTrackerImpl

`checkGlobalSession, checkSession, commitSession, dumpSessions, getLocalSessionCount, getSessionExpiryMap, getSessionTimeout, globalSessions, initializeNextSessionId, isLocalSessionsEnabled, isTrackingSession, removeSession, run, setOwner, setSessionClosing, shutdown, toString, touchSession, trackSession`

### Methods inherited from class ZooKeeperCriticalThread

`handleException`

### Methods inherited from class Thread

`activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, yield`

### Methods inherited from class Object

`equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### LocalSessionTracker

public LocalSessionTracker(SessionTracker.SessionExpirer expirer, ConcurrentMap<Long,Integer> sessionsWithTimeouts, int tickTime, long id, ZooKeeperServerListener listener)

## Method Details

### isLocalSession

public boolean isLocalSession(long sessionId)

### isGlobalSession

public boolean isGlobalSession(long sessionId)

### createSession

public long createSession(int sessionTimeout)

Specified by:
  `createSession` in interface `SessionTracker`
Overrides:
  `createSession` in class `SessionTrackerImpl`

### localSessions

public Set<Long> localSessions()
Description copied from interface: `SessionTracker`
Get a set of local session IDs

Specified by:
  `localSessions` in interface `SessionTracker`
Overrides:
  `localSessions` in class `SessionTrackerImpl`