SessionCache. The purpose of the
SessionCache is to keep the working set of Session objects in memory so that
they may be accessed quickly, and facilitate the sharing of a Session object
amongst multiple simultaneous requests referring to the same session id.
The SessionManager coordinates the lifecycle of Session objects with
the help of the SessionCache/SessionDataStore.
SessionManager, org.eclipse.jetty.session.SessionIdManager
| Modifier and Type | Class and Description |
|---|---|
| public static enum | ManagedSession.IdState
State of the session id |
| public static enum | ManagedSession.State
Validity states of a session |
| Modifier and Type | Field and Description |
|---|---|
| private final Session. | |
| protected String | |
| protected AutoLock | |
| protected final SessionManager | |
| protected boolean | |
| protected boolean | |
| protected long | |
| protected boolean | |
| protected final SessionData | |
| protected final SessionInactivityTimer | |
| protected ManagedSession. | |
| protected Condition | |
| private final List | |
| private static final Logger | |
| public static final String | SESSION_CREATED_SECURE
Attribute set if the session is secure |
| Access | Constructor and Description |
|---|---|
| public | ManagedSession(SessionManager
the SessionHandler that manages this session manager, SessionData the session data data)Create a new session object. |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | |
| public boolean | |
| public long | Returns: the time remaining before expiry or inactivity timeoutthe time at which to calculate remaining expiry now)Calculate what the session timer setting should be based on: the time remaining before the session expires and any idle eviction time configured. |
| protected void | |
| protected void | |
| public String | encodeURI(Request request, String uri, boolean cookiesInUse)
Implements org. |
| public void | |
| public HttpCookie | |
| public < The type of the T extends Session.API | getApi()
Implements org. A |
| public Object | getAttribute(String
the attribute to get name)Implements org. |
| public Set | getAttributeNameSet()
Implements org. |
| public long | |
| public long | |
| public String | |
| public String | |
| public long | |
| public int | |
| public long | Returns: the number of active requests for this sessionReturns the current number of requests that are active in the Session. |
| public SessionData | |
| public SessionManager | |
| public String | |
| public void | invalidate()
Implements org. |
| public boolean | Returns: true if expiredthe time since the epoch in ms time)Check to see if session has expired as at the time given. |
| protected boolean | Returns: true if the session has been idle longer than the intervalthe number of seconds sec)Check if the Session has been idle longer than a number of seconds. |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public AutoLock | |
| public void | |
| public void | |
| protected void | onSessionAttributeUpdate(String
name of the attribute name, Object new value of the attribute newValue, Object previous value of the attribute oldValue)Call binding and attribute listeners based on the new and old values of the attribute. |
| public void | |
| pack-priv void | |
| pack-priv void | |
| public Object | removeAttribute(String
the attribute to remove name)Implements org. |
| public void | renewId(Request
the Request associated with the call to change id. request, Response The response which may be updated with the new session identity. response)Implements org. |
| public Object | setAttribute(String
the attribute to set name, Object the value to set. A null value is equivalent to removing the attribute. value)Implements org. |
| public void | |
| public void | setMaxInactiveInterval(int
The period in secs in which the session will remain valid (unless explicitly invalidated)
when not accessed by any requests. secs)Implements org. |
| public void | |
| public String | |
| protected void |
| _api | back to summary |
|---|---|
| private final Session. | |
| _extendedId | back to summary |
|---|---|
| protected String _extendedId | |
| _lock | back to summary |
|---|---|
| protected AutoLock _lock | |
| _manager | back to summary |
|---|---|
| protected final SessionManager _manager | |
| _needSetCookie | back to summary |
|---|---|
| protected boolean _needSetCookie | |
| _newSession | back to summary |
|---|---|
| protected boolean _newSession | |
| _requests | back to summary |
|---|---|
| protected long _requests | |
| _resident | back to summary |
|---|---|
| protected boolean _resident | |
| _sessionData | back to summary |
|---|---|
| protected final SessionData _sessionData | |
| _sessionInactivityTimer | back to summary |
|---|---|
| protected final SessionInactivityTimer _sessionInactivityTimer | |
| _state | back to summary |
|---|---|
| protected ManagedSession. | |
| _stateChangeCompleted | back to summary |
|---|---|
| protected Condition _stateChangeCompleted | |
| _valueListenerList | back to summary |
|---|---|
| private final List<Session. | |
| LOG | back to summary |
|---|---|
| private static final Logger LOG | |
| SESSION_CREATED_SECURE | back to summary |
|---|---|
| public static final String SESSION_CREATED_SECURE
Deprecated
Attribute set if the session is secure | |
| ManagedSession | back to summary |
|---|---|
| public ManagedSession(SessionManager manager, SessionData data) Create a new session object. The session could be an entirely new session, or could be being re-inflated from persistent store.
| |
| access | back to summary |
|---|---|
| public boolean access(long time) | |
| beginInvalidate | back to summary |
|---|---|
public boolean beginInvalidate()
| |
| calculateInactivityTimeout | back to summary |
|---|---|
| public long calculateInactivityTimeout(long now) Calculate what the session timer setting should be based on: the time remaining before the session expires and any idle eviction time configured. The timer value will be the lesser of the above.
| |
| checkValidForRead | back to summary |
|---|---|
| protected void checkValidForRead() throws IllegalStateException Chech that the session data can be read.
| |
| checkValidForWrite | back to summary |
|---|---|
| protected void checkValidForWrite() throws IllegalStateException Check that the session can be modified.
| |
| encodeURI | back to summary |
|---|---|
| public String encodeURI(Request request, String uri, boolean cookiesInUse) Implements org.
| |
| finishInvalidate | back to summary |
|---|---|
| public void finishInvalidate() throws IllegalStateException Call HttpSessionAttributeListeners as part of invalidating a Session.
| |
| generateSetCookie | back to summary |
|---|---|
| public HttpCookie generateSetCookie(String name, Map<String, String> attributes) | |
| getApi | back to summary |
|---|---|
| public <T extends Session. Implements org. A
| |
| getAttribute | back to summary |
|---|---|
| public Object getAttribute(String name) Implements org. Doc from org. Get an attribute | |
| getAttributeNameSet | back to summary |
|---|---|
| public Set Implements org. Doc from org. Get the immutable set of attribute names. | |
| getCookieSetTime | back to summary |
|---|---|
| public long getCookieSetTime() | |
| getCreationTime | back to summary |
|---|---|
| public long getCreationTime() throws IllegalStateException | |
| getExtendedId | back to summary |
|---|---|
| public String getExtendedId() Implements org.
| |
| getId | back to summary |
|---|---|
| public String getId() Implements org.
| |
| getLastAccessedTime | back to summary |
|---|---|
| public long getLastAccessedTime() Implements org.
| |
| getMaxInactiveInterval | back to summary |
|---|---|
| public int getMaxInactiveInterval() Implements org.
| |
| getRequests | back to summary |
|---|---|
| public long getRequests() Returns the current number of requests that are active in the Session.
| |
| getSessionData | back to summary |
|---|---|
| public SessionData getSessionData() | |
| getSessionManager | back to summary |
|---|---|
| public SessionManager getSessionManager() | |
| getVHost | back to summary |
|---|---|
| public String getVHost() | |
| invalidate | back to summary |
|---|---|
| public void invalidate() Implements org. Called by users to invalidate a session, or called by the access method as a request enters the session if the session has expired, or called by manager as a result of scavenger expiring session
| |
| isExpiredAt | back to summary |
|---|---|
| public boolean isExpiredAt(long time) Check to see if session has expired as at the time given.
| |
| isIdleLongerThan | back to summary |
|---|---|
| protected boolean isIdleLongerThan(int sec) Check if the Session has been idle longer than a number of seconds.
| |
| isInvalidOrInvalidating | back to summary |
|---|---|
| public boolean isInvalidOrInvalidating() | |
| isNew | back to summary |
|---|---|
| public boolean isNew() throws IllegalStateException Implements org.
| |
| isResident | back to summary |
|---|---|
| public boolean isResident() | |
| isSetCookieNeeded | back to summary |
|---|---|
| public boolean isSetCookieNeeded() | |
| isValid | back to summary |
|---|---|
| public boolean isValid() Implements org.
| |
| lock | back to summary |
|---|---|
| public AutoLock lock() Grab the lock on the session
| |
| onIdChanged | back to summary |
|---|---|
| public void onIdChanged() | |
| onSessionActivation | back to summary |
|---|---|
| public void onSessionActivation() Call the activation listeners. This must be called holding the lock. | |
| onSessionAttributeUpdate | back to summary |
|---|---|
| protected void onSessionAttributeUpdate(String name, Object newValue, Object oldValue) Call binding and attribute listeners based on the new and old values of the attribute.
| |
| onSessionPassivation | back to summary |
|---|---|
| public void onSessionPassivation() Call the passivation listeners. This must be called holding the lock | |
| onSetCookieGenerated | back to summary |
|---|---|
| pack-priv void onSetCookieGenerated() Set the time that the cookie was set and clear the idChanged flag. | |
| release | back to summary |
|---|---|
| pack-priv void release() | |
| removeAttribute | back to summary |
|---|---|
| public Object removeAttribute(String name) Implements org. Doc from org. Remove an attribute | |
| renewId | back to summary |
|---|---|
| public void renewId(Request request, Response response) Implements org. Force a change to the id of a session.
| |
| setAttribute | back to summary |
|---|---|
| public Object setAttribute(String name, Object value) Implements org. Doc from org. Set an attribute | |
| setExtendedId | back to summary |
|---|---|
| public void setExtendedId(String extendedId) | |
| setMaxInactiveInterval | back to summary |
|---|---|
| public void setMaxInactiveInterval(int secs) Implements org.
| |
| setResident | back to summary |
|---|---|
| public void setResident(boolean resident) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| use | back to summary |
|---|---|
| protected void use() | |
| Modifier and Type | Field and Description |
|---|---|
| public static final ManagedSession. | |
| public static final ManagedSession. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static ManagedSession. | |
| public static ManagedSession. |
| CHANGING | back to summary |
|---|---|
| public static final ManagedSession. | |
| SET | back to summary |
|---|---|
| public static final ManagedSession. | |
| IdState | back to summary |
|---|---|
| private IdState() | |
| valueOf | back to summary |
|---|---|
| public static ManagedSession. | |
| values | back to summary |
|---|---|
| public static ManagedSession. | |
| Modifier and Type | Field and Description |
|---|---|
| public static final ManagedSession. | |
| public static final ManagedSession. | |
| public static final ManagedSession. | |
| public static final ManagedSession. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static ManagedSession. | |
| public static ManagedSession. |
| CHANGING | back to summary |
|---|---|
| public static final ManagedSession. | |
| INVALID | back to summary |
|---|---|
| public static final ManagedSession. | |
| INVALIDATING | back to summary |
|---|---|
| public static final ManagedSession. | |
| VALID | back to summary |
|---|---|
| public static final ManagedSession. | |
| State | back to summary |
|---|---|
| private State() | |
| valueOf | back to summary |
|---|---|
| public static ManagedSession. | |
| values | back to summary |
|---|---|
| public static ManagedSession. | |