Class DatabaseSessionValidator
java.lang.Object
rife.database.DbQueryManager
rife.authentication.sessionvalidators.DatabaseSessionValidator
- All Implemented Interfaces:
Cloneable,SessionValidator<DatabaseUsers,DatabaseSessions, DatabaseRemember>
public abstract class DatabaseSessionValidator
extends DbQueryManager
implements SessionValidator<DatabaseUsers,DatabaseSessions,DatabaseRemember>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DatabaseUsersprotected DatabaseRememberstatic final intstatic final intprotected DatabaseSessions -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected int_validateSession(Select sessionValidityNoRole, Select sessionValidityNoRoleRestrictAuthData, Select sessionValidityRole, Select sessionValidityRoleRestrictAuthData, ProcessSessionValidity processSessionValidity, String authId, String authData, SessionAttributes attributes) Retrieves the currently usedCredentialsManager.Retrieves the currently usedRememberManager.Retrieves the currently usedSessionManager.booleanisAccessAuthorized(int id) Indicates if the provided validity identifier is considered as valid and that the access to the secured resource is thus authorized.voidsetCredentialsManager(DatabaseUsers credentialsManager) Sets theCredentialsManagerthat will be used.voidsetRememberManager(DatabaseRemember rememberManager) Sets theRememberManagerthat will be used.voidsetSessionManager(DatabaseSessions sessionManager) Sets theSessionManagerthat will be used.Methods inherited from class rife.database.DbQueryManager
clone, 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.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface rife.authentication.SessionValidator
validateSession
-
Field Details
-
SESSION_INVALID
public static final int SESSION_INVALID- See Also:
-
SESSION_VALID
public static final int SESSION_VALID- See Also:
-
credentialsManager_
-
sessionManager_
-
rememberManager_
-
-
Constructor Details
-
DatabaseSessionValidator
-
-
Method Details
-
setCredentialsManager
Description copied from interface:SessionValidatorSets theCredentialsManagerthat will be used.- Specified by:
setCredentialsManagerin interfaceSessionValidator<DatabaseUsers,DatabaseSessions, DatabaseRemember> - Parameters:
credentialsManager- The newCredentialsManager.
-
getCredentialsManager
Description copied from interface:SessionValidatorRetrieves the currently usedCredentialsManager.- Specified by:
getCredentialsManagerin interfaceSessionValidator<DatabaseUsers,DatabaseSessions, DatabaseRemember> - Returns:
- The current
CredentialsManager.
-
setSessionManager
Description copied from interface:SessionValidatorSets theSessionManagerthat will be used.- Specified by:
setSessionManagerin interfaceSessionValidator<DatabaseUsers,DatabaseSessions, DatabaseRemember> - Parameters:
sessionManager- The newSessionManager.
-
getSessionManager
Description copied from interface:SessionValidatorRetrieves the currently usedSessionManager.- Specified by:
getSessionManagerin interfaceSessionValidator<DatabaseUsers,DatabaseSessions, DatabaseRemember> - Returns:
- The current
SessionManager.
-
setRememberManager
Description copied from interface:SessionValidatorSets theRememberManagerthat will be used.- Specified by:
setRememberManagerin interfaceSessionValidator<DatabaseUsers,DatabaseSessions, DatabaseRemember> - Parameters:
rememberManager- The newRememberManager.
-
getRememberManager
Description copied from interface:SessionValidatorRetrieves the currently usedRememberManager.- Specified by:
getRememberManagerin interfaceSessionValidator<DatabaseUsers,DatabaseSessions, DatabaseRemember> - Returns:
- The current
RememberManager.
-
isAccessAuthorized
public boolean isAccessAuthorized(int id) Description copied from interface:SessionValidatorIndicates if the provided validity identifier is considered as valid and that the access to the secured resource is thus authorized.Normally, specific business logic is only required for the situations in which access was prohibited. This method is used to make it possible to provide automatic access to the secured resource.
- Specified by:
isAccessAuthorizedin interfaceSessionValidator<DatabaseUsers,DatabaseSessions, DatabaseRemember> - Parameters:
id- The numeric identifier that is returned by thevalidateSessionmethod.- Returns:
trueif access to the secured resource was authorized; orfalseif access was prohibited.
-
_validateSession
protected int _validateSession(Select sessionValidityNoRole, Select sessionValidityNoRoleRestrictAuthData, Select sessionValidityRole, Select sessionValidityRoleRestrictAuthData, ProcessSessionValidity processSessionValidity, String authId, String authData, SessionAttributes attributes) throws SessionValidatorException - Throws:
SessionValidatorException
-