com.uwyn.rife.authentication.sessionvalidators
Class DatabaseSessionValidator

java.lang.Object
  extended by com.uwyn.rife.database.DbQueryManager
      extended by com.uwyn.rife.authentication.sessionvalidators.DatabaseSessionValidator
All Implemented Interfaces:
SessionValidator, Cloneable

public abstract class DatabaseSessionValidator
extends DbQueryManager
implements SessionValidator


Field Summary
protected  CredentialsManager mCredentialsManager
           
protected  RememberManager mRememberManager
           
protected  SessionManager mSessionManager
           
static int SESSION_INVALID
           
static int SESSION_VALID
           
 
Constructor Summary
protected DatabaseSessionValidator(Datasource datasource)
           
 
Method Summary
protected  int _validateSession(Select sessionValidityNoRole, Select sessionValidityNoRoleRestrictHostIp, Select sessionValidityRole, Select sessionValidityRoleRestrictHostIp, ProcessSessionValidity processSessionValidity, String authId, String hostIp, SessionAttributes attributes)
           
 CredentialsManager getCredentialsManager()
          Retrieves the currently used CredentialsManager.
 RememberManager getRememberManager()
          Retrieves the currently used RememberManager.
 SessionManager getSessionManager()
          Retrieves the currently used SessionManager.
 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(CredentialsManager credentialsManager)
          Sets the CredentialsManager that will be used.
 void setRememberManager(RememberManager rememberManager)
          Sets the RememberManager that will be used.
 void setSessionManager(SessionManager sessionManager)
          Sets the SessionManager that will be used.
 
Methods inherited from class com.uwyn.rife.database.DbQueryManager
clone, executeFetchAll, executeFetchAll, executeFetchAllBeans, executeFetchAllBeans, 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, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUseFirstAsciiStream, executeUseFirstAsciiStream, executeUseFirstBinaryStream, executeUseFirstBinaryStream, executeUseFirstCharacterStream, executeUseFirstCharacterStream, fetch, fetch, fetchAll, getConnection, getDatasource, inTransaction, reserveConnection
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.uwyn.rife.authentication.SessionValidator
validateSession
 

Field Detail

SESSION_INVALID

public static final int SESSION_INVALID
See Also:
Constant Field Values

SESSION_VALID

public static final int SESSION_VALID
See Also:
Constant Field Values

mCredentialsManager

protected CredentialsManager mCredentialsManager

mSessionManager

protected SessionManager mSessionManager

mRememberManager

protected RememberManager mRememberManager
Constructor Detail

DatabaseSessionValidator

protected DatabaseSessionValidator(Datasource datasource)
Method Detail

setCredentialsManager

public void setCredentialsManager(CredentialsManager credentialsManager)
Description copied from interface: SessionValidator
Sets the CredentialsManager that will be used.

Specified by:
setCredentialsManager in interface SessionValidator
Parameters:
credentialsManager - The new CredentialsManager.

getCredentialsManager

public CredentialsManager getCredentialsManager()
Description copied from interface: SessionValidator
Retrieves the currently used CredentialsManager.

Specified by:
getCredentialsManager in interface SessionValidator
Returns:
The current CredentialsManager.

setSessionManager

public void setSessionManager(SessionManager sessionManager)
Description copied from interface: SessionValidator
Sets the SessionManager that will be used.

Specified by:
setSessionManager in interface SessionValidator
Parameters:
sessionManager - The new SessionManager.

setRememberManager

public void setRememberManager(RememberManager rememberManager)
Description copied from interface: SessionValidator
Sets the RememberManager that will be used.

Specified by:
setRememberManager in interface SessionValidator
Parameters:
rememberManager - The new RememberManager.

getRememberManager

public RememberManager getRememberManager()
Description copied from interface: SessionValidator
Retrieves the currently used RememberManager.

Specified by:
getRememberManager in interface SessionValidator
Returns:
The current RememberManager.

getSessionManager

public SessionManager getSessionManager()
Description copied from interface: SessionValidator
Retrieves the currently used SessionManager.

Specified by:
getSessionManager in interface SessionValidator
Returns:
The current SessionManager.

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 has prohibited. This method is used to make it possible to provide automatic access to the secured resource.

Specified by:
isAccessAuthorized in interface SessionValidator
Parameters:
id - The numeric identifier that is returned by the validateSession method.
Returns:
true if access to the secured resource was authorized; or

false if access was prohibited.


_validateSession

protected int _validateSession(Select sessionValidityNoRole,
                               Select sessionValidityNoRoleRestrictHostIp,
                               Select sessionValidityRole,
                               Select sessionValidityRoleRestrictHostIp,
                               ProcessSessionValidity processSessionValidity,
                               String authId,
                               String hostIp,
                               SessionAttributes attributes)
                        throws SessionValidatorException
Throws:
SessionValidatorException


Copyright © 2001-2007 Uwyn sprl/bvba. All Rights Reserved.