WebSession instances.
| Modifier and Type | Class and Description |
|---|---|
| private class | |
| private class | |
| private static enum |
| Modifier and Type | Field and Description |
|---|---|
| private Clock | |
| private final InMemoryWebSessionStore. | |
| private static final IdGenerator | |
| private int | |
| private final Map |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Mono | createWebSession()
Implements org. |
| public Clock | |
| public int | |
| public Map | |
| public void | |
| public Mono | removeSession(String
the id of the session to remove id)Implements org. |
| public Mono | retrieveSession(String
the session to load id)Implements org. Note This method should perform an expiration check, and if it has expired remove the session and return empty. |
| public void | |
| public void | setMaxSessions(int
the maximum number of sessions maxSessions)Set the maximum number of sessions that can be stored. |
| public Mono | updateLastAccessTime(WebSession
the session to update session)Implements org. |
| clock | back to summary |
|---|---|
| private Clock clock | |
| expiredSessionChecker | back to summary |
|---|---|
| private final InMemoryWebSessionStore. | |
| idGenerator | back to summary |
|---|---|
| private static final IdGenerator idGenerator | |
| maxSessions | back to summary |
|---|---|
| private int maxSessions | |
| sessions | back to summary |
|---|---|
| private final Map<String, InMemoryWebSessionStore. | |
| InMemoryWebSessionStore | back to summary |
|---|---|
| public InMemoryWebSessionStore() | |
| createWebSession | back to summary |
|---|---|
| public Mono Implements org. Doc from org. Create a new WebSession. Note that this does nothing more than create a new instance.
The session can later be started explicitly via
| |
| getClock | back to summary |
|---|---|
| public Clock getClock() Return the configured clock for session lastAccessTime calculations. | |
| getMaxSessions | back to summary |
|---|---|
| public int getMaxSessions() Return the maximum number of sessions that can be stored.
| |
| getSessions | back to summary |
|---|---|
| public Map Return the map of sessions with an
| |
| removeExpiredSessions | back to summary |
|---|---|
| public void removeExpiredSessions() Check for expired sessions and remove them. Typically such checks are
kicked off lazily during calls to
| |
| removeSession | back to summary |
|---|---|
| public Mono Implements org. Doc from org. Remove the WebSession for the specified id. | |
| retrieveSession | back to summary |
|---|---|
| public Mono Implements org. Doc from org. Return the WebSession for the given id. Note This method should perform an expiration check, and if it has expired remove the session and return empty. This method should also update the lastAccessTime of retrieved sessions.
| |
| setClock | back to summary |
|---|---|
| public void setClock(Clock clock) Configure the This may be useful to align to different timezone or to set the clock
back in a test, e.g. By default this is
| |
| setMaxSessions | back to summary |
|---|---|
| public void setMaxSessions(int maxSessions) Set the maximum number of sessions that can be stored. Once the limit is
reached, any attempt to store an additional session will result in an
By default set to 10000.
| |
| updateLastAccessTime | back to summary |
|---|---|
| public Mono Implements org. Doc from org. Update the last accessed timestamp to "now".
| |
| Modifier and Type | Field and Description |
|---|---|
| private static final int | CHECK_PERIOD
Max time between expiration checks. |
| private Instant | |
| private final Lock |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void |
| CHECK_PERIOD | back to summary |
|---|---|
| private static final int CHECK_PERIOD Max time between expiration checks. | |
| checkTime | back to summary |
|---|---|
| private Instant checkTime | |
| lock | back to summary |
|---|---|
| private final Lock lock | |
| ExpiredSessionChecker | back to summary |
|---|---|
| private ExpiredSessionChecker() | |
| checkIfNecessary | back to summary |
|---|---|
| public void checkIfNecessary(Instant now) | |
| removeExpiredSessions | back to summary |
|---|---|
| public void removeExpiredSessions(Instant now) | |
| Modifier and Type | Field and Description |
|---|---|
| private final Map | |
| private final Instant | |
| private final AtomicReference | |
| private volatile Instant | |
| private volatile Duration | |
| private final AtomicReference |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Mono | changeSessionId()
Implements org. getId()
reflects the new session id.
|
| private boolean | |
| private void | |
| public Map | getAttributes()
Implements org. |
| public Instant | getCreationTime()
Implements org. |
| public String | getId()
Implements org. |
| public Instant | getLastAccessTime()
Implements org. |
| public Duration | getMaxIdleTime()
Implements org. lastAccessTime before a session expires.
|
| public Mono | invalidate()
Implements org. |
| public boolean | isExpired()
Implements org. true if the session expired after maxIdleTime elapsed.
|
| private boolean | |
| public boolean | isStarted()
Implements org. start() or implicitly by adding session attributes.
|
| public Mono | save()
Implements org. WebSessionStore as follows:
|
| public void | setMaxIdleTime(Duration maxIdleTime)
Implements org. lastAccessTime before a session is considered
expired.
|
| public void | start()
Implements org. save() is called.
|
| private void |
| attributes | back to summary |
|---|---|
| private final Map<String, Object> attributes | |
| creationTime | back to summary |
|---|---|
| private final Instant creationTime | |
| id | back to summary |
|---|---|
| private final AtomicReference<String> id | |
| lastAccessTime | back to summary |
|---|---|
| private volatile Instant lastAccessTime | |
| maxIdleTime | back to summary |
|---|---|
| private volatile Duration maxIdleTime | |
| state | back to summary |
|---|---|
| private final AtomicReference<InMemoryWebSessionStore. | |
| InMemoryWebSession | back to summary |
|---|---|
| public InMemoryWebSession(Instant creationTime) | |
| changeSessionId | back to summary |
|---|---|
| public Mono Implements org. Doc from org. Generate a new id for the session and update the underlying session
storage to reflect the new id. After a successful call | |
| checkExpired | back to summary |
|---|---|
| private boolean checkExpired(Instant currentTime) | |
| checkMaxSessionsLimit | back to summary |
|---|---|
| private void checkMaxSessionsLimit() | |
| getAttributes | back to summary |
|---|---|
| public Map Implements org. Doc from org. Return a map that holds session attributes.
| |
| getCreationTime | back to summary |
|---|---|
| public Instant getCreationTime() Implements org. Doc from org. Return the time when the session was created.
| |
| getId | back to summary |
|---|---|
| public String getId() Implements org. Doc from org. Return a unique session identifier.
| |
| getLastAccessTime | back to summary |
|---|---|
| public Instant getLastAccessTime() Implements org. Doc from org. Return the last time of session access as a result of user activity such
as an HTTP request. Together with
| |
| getMaxIdleTime | back to summary |
|---|---|
| public Duration getMaxIdleTime() Implements org. Doc from org. Return the maximum time after the
| |
| invalidate | back to summary |
|---|---|
| public Mono Implements org. Doc from org. Invalidate the current session and clear session storage. | |
| isExpired | back to summary |
|---|---|
| public boolean isExpired() Implements org. Doc from org. Return Typically expiration checks should be automatically made when a session
is accessed, a new
| |
| isExpired | back to summary |
|---|---|
| private boolean isExpired(Instant now) | |
| isStarted | back to summary |
|---|---|
| public boolean isStarted() Implements org. Doc from org. Whether a session with the client has been started explicitly via
| |
| save | back to summary |
|---|---|
| public Mono Implements org. Doc from org. Save the session through the
Note that this method is not intended for direct use by applications. Instead it is automatically invoked just before the response is committed. | |
| setMaxIdleTime | back to summary |
|---|---|
| public void setMaxIdleTime(Duration maxIdleTime) Implements org. Doc from org. Configure the max amount of time that may elapse after the
| |
| start | back to summary |
|---|---|
| public void start() Implements org. Doc from org. Force the creation of a session causing the session id to be sent when
| |
| updateLastAccessTime | back to summary |
|---|---|
| private void updateLastAccessTime(Instant currentTime) | |
| Modifier and Type | Field and Description |
|---|---|
| public static final InMemoryWebSessionStore. | |
| public static final InMemoryWebSessionStore. | |
| public static final InMemoryWebSessionStore. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static InMemoryWebSessionStore. | |
| public static InMemoryWebSessionStore. |
| EXPIRED | back to summary |
|---|---|
| public static final InMemoryWebSessionStore. | |
| NEW | back to summary |
|---|---|
| public static final InMemoryWebSessionStore. | |
| STARTED | back to summary |
|---|---|
| public static final InMemoryWebSessionStore. | |
| State | back to summary |
|---|---|
| private State() | |
| valueOf | back to summary |
|---|---|
| public static InMemoryWebSessionStore. | |
| values | back to summary |
|---|---|
| public static InMemoryWebSessionStore. | |