Class DatabaseSessions
java.lang.Object
rife.database.DbQueryManager
rife.authentication.sessionmanagers.DatabaseSessions
- All Implemented Interfaces:
- Cloneable,- SessionManager
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionboolean_continueSession(Update continueSession, String authId) protected long_countSessions(Select countSessions) protected void_eraseAllSessions(Delete eraseAllSessions) protected boolean_eraseSession(Delete eraseSession, String authId) protected boolean_eraseUserSessions(Delete eraseUserSessions, long userId) protected long_getSessionUserId(Select getSessionUserId, String authId) protected boolean_install(CreateTable createAuthentication, String createAuthenticationSessStartIndex) protected boolean_isSessionValid(Select sessionValidity, Select sessionValidityRestrictAuthData, String authId, String authData) protected boolean_listSessions(Select listSessions, ListSessions processor) protected void_purgeSessions(Delete purgeSession) protected booleanprotected String_startSession(Insert startSession, long userId, String authData, boolean remembered) protected boolean_wasRemembered(Select wasRemembered, String authId) abstract longCounts the number of active sessions.booleanObtains the restriction policy of the authentication ID in regard to the user's auth data.longObtains the maximum time that a user can stay inactive before an active session becomes invalid.intObtains the frequency at which the purging will happen in relationship to the scale.intObtains the scale at which the purging will happen in relationship to the frequency.abstract booleaninstall()abstract booleanremove()voidsetRestrictAuthData(boolean flag) Sets the restriction policy of the authentication ID in regard to the user's auth data.voidsetSessionDuration(long milliseconds) Sets the maximum time that a user can stay inactive before an active session becomes invalid.voidsetSessionPurgeFrequency(int frequency) Set the frequency at which the purging will happen in relationship to the scale.voidsetSessionPurgeScale(int scale) Set the scale at which the purging will happen in relationship to the frequency.Methods inherited from class rife.database.DbQueryManagerclone, executeFetchAll, executeFetchAll, executeFetchAll, executeFetchAll, executeFetchAllBeans, executeFetchAllBeans, executeFetchFirst, executeFetchFirst, executeFetchFirst, executeFetchFirst, executeFetchFirstBean, executeFetchFirstBean, executeGetFirstBoolean, executeGetFirstBoolean, executeGetFirstByte, executeGetFirstByte, executeGetFirstBytes, executeGetFirstBytes, executeGetFirstDate, executeGetFirstDate, executeGetFirstDate, executeGetFirstDate, executeGetFirstDouble, executeGetFirstDouble, executeGetFirstFloat, executeGetFirstFloat, executeGetFirstInt, executeGetFirstInt, executeGetFirstLong, executeGetFirstLong, executeGetFirstShort, executeGetFirstShort, executeGetFirstString, executeGetFirstString, executeGetFirstTime, executeGetFirstTime, executeGetFirstTime, executeGetFirstTime, executeGetFirstTimestamp, executeGetFirstTimestamp, executeGetFirstTimestamp, executeGetFirstTimestamp, executeHasResultRows, executeHasResultRows, executeQuery, executeQuery, executeResultQuery, executeUpdate, executeUpdate, executeUpdate, executeUseFirstAsciiStream, executeUseFirstAsciiStream, executeUseFirstBinaryStream, executeUseFirstBinaryStream, executeUseFirstCharacterStream, executeUseFirstCharacterStream, fetch, fetch, fetch, fetchAll, fetchAll, getConnection, getDatasource, inTransaction, inTransaction, reserveConnectionMethods inherited from class java.lang.Objectequals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface rife.authentication.SessionManagercontinueSession, eraseAllSessions, eraseSession, eraseUserSessions, getSessionUserId, isSessionValid, listSessions, purgeSessions, startSession, wasRemembered
- 
Constructor Details- 
DatabaseSessions
 
- 
- 
Method Details- 
getSessionDurationpublic long getSessionDuration()Description copied from interface:SessionManagerObtains the maximum time that a user can stay inactive before an active session becomes invalid.- Specified by:
- getSessionDurationin interface- SessionManager
- Returns:
- The maximum time of inactivity in milliseconds.
 
- 
setSessionDurationpublic void setSessionDuration(long milliseconds) Description copied from interface:SessionManagerSets the maximum time that a user can stay inactive before an active session becomes invalid.- Specified by:
- setSessionDurationin interface- SessionManager
- Parameters:
- milliseconds- The maximum time of inactivity in milliseconds.
 
- 
getRestrictAuthDatapublic boolean getRestrictAuthData()Description copied from interface:SessionManagerObtains the restriction policy of the authentication ID in regard to the user's auth data.The default is false, or no restriction.- Specified by:
- getRestrictAuthDatain interface- SessionManager
- Returns:
- trueif the authentication is restricted to one auth data; or- falseif the authentication ID can be used with any auth data
 
- 
setRestrictAuthDatapublic void setRestrictAuthData(boolean flag) Description copied from interface:SessionManagerSets the restriction policy of the authentication ID in regard to the user's auth data.The default is false, or no restriction.- Specified by:
- setRestrictAuthDatain interface- SessionManager
- Parameters:
- flag-- trueto activate the auth data restriction; or- falseotherwise
 
- 
getSessionPurgeFrequencypublic int getSessionPurgeFrequency()Description copied from interface:SessionManagerObtains the frequency at which the purging will happen in relationship to the scale.This defaults to RifeConfig.AuthenticationConfig.getSessionPurgeFrequency().- Specified by:
- getSessionPurgeFrequencyin interface- SessionManager
- Returns:
- the purge frequency
- See Also:
 
- 
setSessionPurgeFrequencypublic void setSessionPurgeFrequency(int frequency) Description copied from interface:SessionManagerSet the frequency at which the purging will happen in relationship to the scale.By default, the frequency and scale respectively are 20 and 1000, which means that the purging will have once every fifty times the authentication sessions are accessed. - Specified by:
- setSessionPurgeFrequencyin interface- SessionManager
- Parameters:
- frequency- the purge frequency
- See Also:
 
- 
getSessionPurgeScalepublic int getSessionPurgeScale()Description copied from interface:SessionManagerObtains the scale at which the purging will happen in relationship to the frequency.This defaults to RifeConfig.AuthenticationConfig.getSessionPurgeScale().- Specified by:
- getSessionPurgeScalein interface- SessionManager
- Returns:
- the purge scale
- See Also:
 
- 
setSessionPurgeScalepublic void setSessionPurgeScale(int scale) Description copied from interface:SessionManagerSet the scale at which the purging will happen in relationship to the frequency.By default, the frequency and scale respectively are 20 and 1000, which means that the purging will have once every fifty times the authentication sessions are accessed. - Specified by:
- setSessionPurgeScalein interface- SessionManager
- Parameters:
- scale- the purge scale
- See Also:
 
- 
install- Throws:
- SessionManagerException
 
- 
remove- Throws:
- SessionManagerException
 
- 
countSessionsDescription copied from interface:SessionManagerCounts the number of active sessions.- Specified by:
- countSessionsin interface- SessionManager
- Returns:
- The number of active sessions.
- Throws:
- SessionManagerException- An undefined number of exceptional cases or error situations can occur when a session is counted. They are all indicated by throwing an instance of- SessionManagerException. It's up to the implementations of this interface to give more specific meanings to these exceptions.
 
- 
_installprotected boolean _install(CreateTable createAuthentication, String createAuthenticationSessStartIndex) 
- 
_remove
- 
_purgeSessions- Throws:
- SessionManagerException
 
- 
_startSessionprotected String _startSession(Insert startSession, long userId, String authData, boolean remembered) throws SessionManagerException - Throws:
- SessionManagerException
 
- 
_isSessionValidprotected boolean _isSessionValid(Select sessionValidity, Select sessionValidityRestrictAuthData, String authId, String authData) throws SessionManagerException - Throws:
- SessionManagerException
 
- 
_continueSessionpublic boolean _continueSession(Update continueSession, String authId) throws SessionManagerException - Throws:
- SessionManagerException
 
- 
_eraseSession- Throws:
- SessionManagerException
 
- 
_wasRememberedprotected boolean _wasRemembered(Select wasRemembered, String authId) throws SessionManagerException - Throws:
- SessionManagerException
 
- 
_eraseUserSessionsprotected boolean _eraseUserSessions(Delete eraseUserSessions, long userId) throws SessionManagerException - Throws:
- SessionManagerException
 
- 
_eraseAllSessions- Throws:
- SessionManagerException
 
- 
_countSessions- Throws:
- SessionManagerException
 
- 
_getSessionUserIdprotected long _getSessionUserId(Select getSessionUserId, String authId) throws SessionManagerException - Throws:
- SessionManagerException
 
- 
_listSessionsprotected boolean _listSessions(Select listSessions, ListSessions processor) throws SessionManagerException - Throws:
- SessionManagerException
 
 
-