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
Modifier and TypeFieldDescriptionprotected DatabaseUsers
protected DatabaseRemember
static final int
static final int
protected DatabaseSessions
-
Constructor Summary
-
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
.boolean
isAccessAuthorized
(int id) Indicates if the provided validity identifier is considered as valid and that the access to the secured resource is thus authorized.void
setCredentialsManager
(DatabaseUsers credentialsManager) Sets theCredentialsManager
that will be used.void
setRememberManager
(DatabaseRemember rememberManager) Sets theRememberManager
that will be used.void
setSessionManager
(DatabaseSessions sessionManager) Sets theSessionManager
that 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, reserveConnection
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:SessionValidator
Sets theCredentialsManager
that will be used.- Specified by:
setCredentialsManager
in interfaceSessionValidator<DatabaseUsers,
DatabaseSessions, DatabaseRemember> - Parameters:
credentialsManager
- The newCredentialsManager
.
-
getCredentialsManager
Description copied from interface:SessionValidator
Retrieves the currently usedCredentialsManager
.- Specified by:
getCredentialsManager
in interfaceSessionValidator<DatabaseUsers,
DatabaseSessions, DatabaseRemember> - Returns:
- The current
CredentialsManager
.
-
setSessionManager
Description copied from interface:SessionValidator
Sets theSessionManager
that will be used.- Specified by:
setSessionManager
in interfaceSessionValidator<DatabaseUsers,
DatabaseSessions, DatabaseRemember> - Parameters:
sessionManager
- The newSessionManager
.
-
getSessionManager
Description copied from interface:SessionValidator
Retrieves the currently usedSessionManager
.- Specified by:
getSessionManager
in interfaceSessionValidator<DatabaseUsers,
DatabaseSessions, DatabaseRemember> - Returns:
- The current
SessionManager
.
-
setRememberManager
Description copied from interface:SessionValidator
Sets theRememberManager
that will be used.- Specified by:
setRememberManager
in interfaceSessionValidator<DatabaseUsers,
DatabaseSessions, DatabaseRemember> - Parameters:
rememberManager
- The newRememberManager
.
-
getRememberManager
Description copied from interface:SessionValidator
Retrieves the currently usedRememberManager
.- Specified by:
getRememberManager
in interfaceSessionValidator<DatabaseUsers,
DatabaseSessions, DatabaseRemember> - Returns:
- The current
RememberManager
.
-
isAccessAuthorized
public boolean isAccessAuthorized(int id) Description copied from interface:SessionValidator
Indicates 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:
isAccessAuthorized
in interfaceSessionValidator<DatabaseUsers,
DatabaseSessions, DatabaseRemember> - Parameters:
id
- The numeric identifier that is returned by thevalidateSession
method.- Returns:
true
if access to the secured resource was authorized; orfalse
if 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
-