Package org.apache.shiro.session.mgt
Class AbstractSessionManager
- java.lang.Object
-
- org.apache.shiro.session.mgt.AbstractSessionManager
-
- All Implemented Interfaces:
SessionManager
- Direct Known Subclasses:
AbstractNativeSessionManager
public abstract class AbstractSessionManager extends Object implements SessionManager
Base abstract class of theSessionManager
interface, enabling configuration of an application-wideglobalSessionTimeout
. Default global session timeout is30
minutes.- Since:
- 0.1
-
-
Field Summary
Fields Modifier and Type Field Description static long
DEFAULT_GLOBAL_SESSION_TIMEOUT
Default main session timeout value, equal to30
minutes.protected static long
MILLIS_PER_HOUR
protected static long
MILLIS_PER_MINUTE
protected static long
MILLIS_PER_SECOND
-
Constructor Summary
Constructors Constructor Description AbstractSessionManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getGlobalSessionTimeout()
Returns the system-wide default time in milliseconds that any session may remain idle before expiring.void
setGlobalSessionTimeout(long globalSessionTimeout)
Sets the system-wide default time in milliseconds that any session may remain idle before expiring.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.shiro.session.mgt.SessionManager
getSession, start
-
-
-
-
Field Detail
-
MILLIS_PER_SECOND
protected static final long MILLIS_PER_SECOND
- See Also:
- Constant Field Values
-
MILLIS_PER_MINUTE
protected static final long MILLIS_PER_MINUTE
- See Also:
- Constant Field Values
-
MILLIS_PER_HOUR
protected static final long MILLIS_PER_HOUR
- See Also:
- Constant Field Values
-
DEFAULT_GLOBAL_SESSION_TIMEOUT
public static final long DEFAULT_GLOBAL_SESSION_TIMEOUT
Default main session timeout value, equal to30
minutes.- See Also:
- Constant Field Values
-
-
Method Detail
-
getGlobalSessionTimeout
public long getGlobalSessionTimeout()
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 per-session basis by callingSubject.getSession().
setTimeout(long)
if so desired.- A negative return value means sessions never expire.
- A non-negative return value (0 or greater) means session timeout will occur as expected.
setGlobalSessionTimeout(long)
method, the default value isDEFAULT_GLOBAL_SESSION_TIMEOUT
.- Returns:
- the time in milliseconds that any session may remain idle before expiring.
-
setGlobalSessionTimeout
public void setGlobalSessionTimeout(long globalSessionTimeout)
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 per-session basis by callingSubject.getSession().
setTimeout(long)
if so desired.- A negative return value means sessions never expire.
- A non-negative return value (0 or greater) means session timeout will occur as expected.
DEFAULT_GLOBAL_SESSION_TIMEOUT
.- Parameters:
globalSessionTimeout
- the time in milliseconds that any session may remain idle before expiring.
-
-