org.apache.shiro.session.mgt
Class AbstractSessionManager

java.lang.Object
  extended by 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 the SessionManager interface, enabling configuration of an application-wide globalSessionTimeout. Default global session timeout is 30 minutes.

Since:
0.1

Field Summary
static long DEFAULT_GLOBAL_SESSION_TIMEOUT
          Default main session timeout value, equal to 30 minutes.
protected static long MILLIS_PER_HOUR
           
protected static long MILLIS_PER_MINUTE
           
protected static long MILLIS_PER_SECOND
           
 
Constructor Summary
AbstractSessionManager()
           
 
Method Summary
 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 to 30 minutes.

See Also:
Constant Field Values
Constructor Detail

AbstractSessionManager

public AbstractSessionManager()
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 calling Subject.getSession().setTimeout(long) if so desired.

Unless overridden via the setGlobalSessionTimeout(long) method, the default value is DEFAULT_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 calling Subject.getSession().setTimeout(long) if so desired.

Unless overridden by calling this method, the default value is DEFAULT_GLOBAL_SESSION_TIMEOUT.

Parameters:
globalSessionTimeout - the time in milliseconds that any session may remain idel before expiring.


Copyright © 2004-2014 The Apache Software Foundation. All Rights Reserved.