Returns the session instance to use to pass to registered {@code SessionListener}s for notification that the session has been invalidated (stopped or expired). <p/> The default implementation returns an {@link ImmutableProxiedSession ImmutableProxiedSession} instance to ensure that the specified {@code session} argument is not modified by any listeners.
Creates a new {@code Session Session} instance based on the specified (possibly {@code null}) initialization data. Implementing classes must manage the persistent state of the returned session such that it could later be acquired via the {@link #getSession(SessionKey)} method.
Returns the EventBus used to publish SessionEvents.
Notifies any interested {@link SessionListener}s that a Session has started. This method is invoked <em>after</em> the {@link #onStart onStart} method is called.
Template method that allows subclasses to react to a new session being created. <p/> This method is invoked <em>before</em> any session listeners are notified.
Publishes events on the event bus if the event bus is non-null, otherwise does nothing.
Sets the EventBus to use to publish SessionEvents.
Default main session timeout value, equal to {@code 30} minutes.
Returns the system-wide default time in milliseconds that any session may remain idle before expiring. This value is the main default for all sessions and may be overridden on a <em>per-session</em> basis by calling {@code Subject.getSession().}{@link Session#setTimeout setTimeout(long)} if so desired. <ul> <li>A negative return value means sessions never expire.</li> <li>A non-negative return value (0 or greater) means session timeout will occur as expected.</li> </ul> <p/> Unless overridden via the {@link #setGlobalSessionTimeout} method, the default value is {@link #DEFAULT_GLOBAL_SESSION_TIMEOUT}.
Sets the system-wide default time in milliseconds that any session may remain idle before expiring. This value is the main default for all sessions and may be overridden on a <em>per-session</em> basis by calling {@code Subject.getSession().}{@link Session#setTimeout setTimeout(long)} if so desired. <p/> <ul> <li>A negative return value means sessions never expire.</li> <li>A non-negative return value (0 or greater) means session timeout will occur as expected.</li> </ul> <p/> Unless overridden by calling this method, the default value is {@link #DEFAULT_GLOBAL_SESSION_TIMEOUT}.
Returns the time the associated {@code Session} started (was created).
Returns the time the associated {@code Session} last interacted with the system.
Returns {@code true} if the associated session is valid (it exists and is not stopped nor expired), {@code false} otherwise.
Returns quietly if the associated session is valid (it exists and is not stopped or expired) or throws an {@link hunt.shiro.session.InvalidSessionException} indicating that the session id is invalid. This might be preferred to be used instead of {@link #isValid} since any exception thrown will definitively explain the reason for invalidation.
Returns the time in milliseconds that the associated session may remain idle before expiring. <ul> <li>A negative return value means the session will never expire.</li> <li>A non-negative return value (0 or greater) means the session expiration will occur if idle for that length of time.</li> </ul>
Sets the time in milliseconds that the associated session may remain idle before expiring. <ul> <li>A negative return value means the session will never expire.</li> <li>A non-negative return value (0 or greater) means the session expiration will occur if idle for that length of time.</li> </ul>
Updates the last accessed time of the session identified by <code>sessionId</code>. This can be used to explicitly ensure that a session does not time out.
Returns the host name or IP string of the host where the session was started, if known. If no host name or IP was specified when starting the session, this method returns {@code null}
Explicitly stops the associated session, thereby releasing all of its resources.
Returns all attribute keys maintained by the target session or an empty collection if there are no attributes.
Returns the object bound to the associated session identified by the specified attribute key. If there is no object bound under the attribute key for the given session, {@code null} is returned.
Binds the specified {@code value} to the associated session uniquely identified by the {@code attributeKey}. If there is already a session attribute bound under the {@code attributeKey}, that existing object will be replaced by the new {@code value}. <p/> If the {@code value} parameter is null, it has the same effect as if the {@link #removeAttribute(SessionKey sessionKey, Object attributeKey)} method was called.
Removes (unbinds) the object bound to associated {@code Session} under the given {@code attributeKey}.
Sets the available {@code EventBus} that may be used for publishing and subscribing to/from events.
Abstract implementation supporting the {@link NativeSessionManager NativeSessionManager} interface, supporting {@link SessionListener SessionListener}s and application of the {@link #getGlobalSessionTimeout() globalSessionTimeout}.