Package lumis.portal.authentication
Class AuthenticationDaoJdbc
- java.lang.Object
-
- lumis.portal.authentication.AuthenticationDaoJdbc
-
- All Implemented Interfaces:
IAuthenticationDao
public class AuthenticationDaoJdbc extends java.lang.Object implements IAuthenticationDao
Authentication dao implementation.- Since:
- 4.0.0
- Version:
- $Revision$ $Date$
-
-
Constructor Summary
Constructors Constructor Description AuthenticationDaoJdbc()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addUserSessionId(java.lang.String userSessionId, java.lang.String userId)
Add the User Session Id.java.util.Collection<SessionConfig>
clearInactiveSessions(int minutes, ITransaction transaction)
Remove sessions inactive for the specified amount of minutes.void
deleteUserSessionByUserId(java.lang.String userId)
Delete the User Session Id from the user id.void
deleteUserSessionId(java.lang.String userSessionId)
Delete the User Session Id.java.util.Collection<SessionConfig>
getSessionsByUserId(java.lang.String userId, ITransaction transaction)
Returns a collection of active session objects for the given user.java.lang.String
getUserId(java.lang.String userSessionId, ITransaction transaction)
Get the user id.void
keepSessionAlive(java.lang.String sessionId)
Update the last access date for the given session.boolean
validateUserLogin(java.lang.String login, java.lang.String password, ITransaction transaction)
Validade the user login.java.lang.String
validateUserSession(java.lang.String userSessionId, ITransaction transaction)
Validate the session of the user.
-
-
-
Method Detail
-
addUserSessionId
public void addUserSessionId(java.lang.String userSessionId, java.lang.String userId) throws DaoException, PortalException
Description copied from interface:IAuthenticationDao
Add the User Session Id.- Specified by:
addUserSessionId
in interfaceIAuthenticationDao
- Throws:
DaoException
PortalException
-
deleteUserSessionId
public void deleteUserSessionId(java.lang.String userSessionId) throws DaoException, PortalException
Description copied from interface:IAuthenticationDao
Delete the User Session Id.- Specified by:
deleteUserSessionId
in interfaceIAuthenticationDao
- Throws:
DaoException
PortalException
-
deleteUserSessionByUserId
public void deleteUserSessionByUserId(java.lang.String userId) throws DaoException, PortalException
Description copied from interface:IAuthenticationDao
Delete the User Session Id from the user id.- Specified by:
deleteUserSessionByUserId
in interfaceIAuthenticationDao
- Throws:
DaoException
PortalException
-
validateUserSession
public java.lang.String validateUserSession(java.lang.String userSessionId, ITransaction transaction) throws DaoException, PortalException
Description copied from interface:IAuthenticationDao
Validate the session of the user.- Specified by:
validateUserSession
in interfaceIAuthenticationDao
- Parameters:
userSessionId
- the user session id.transaction
- the transaction for persistence access.- Returns:
- the userId if the user's session is valid, or null if it is not valid.
- Throws:
DaoException
PortalException
-
getUserId
public java.lang.String getUserId(java.lang.String userSessionId, ITransaction transaction) throws DaoException, PortalException
Description copied from interface:IAuthenticationDao
Get the user id.- Specified by:
getUserId
in interfaceIAuthenticationDao
- Returns:
- a String.
- Throws:
DaoException
PortalException
-
validateUserLogin
public boolean validateUserLogin(java.lang.String login, java.lang.String password, ITransaction transaction) throws DaoException, PortalException
Description copied from interface:IAuthenticationDao
Validade the user login.- Specified by:
validateUserLogin
in interfaceIAuthenticationDao
- Returns:
- true if the User's login is valid and false otherwise.
- Throws:
DaoException
PortalException
-
keepSessionAlive
public void keepSessionAlive(java.lang.String sessionId) throws PortalException
Description copied from interface:IAuthenticationDao
Update the last access date for the given session.- Specified by:
keepSessionAlive
in interfaceIAuthenticationDao
- Throws:
DaoException
PortalException
-
clearInactiveSessions
public java.util.Collection<SessionConfig> clearInactiveSessions(int minutes, ITransaction transaction) throws DaoException, PortalException
Description copied from interface:IAuthenticationDao
Remove sessions inactive for the specified amount of minutes.- Specified by:
clearInactiveSessions
in interfaceIAuthenticationDao
- Parameters:
minutes
- amount of minutes.transaction
- transaction for persistence access.- Returns:
- the sessions cleared.
- Throws:
DaoException
PortalException
-
getSessionsByUserId
public java.util.Collection<SessionConfig> getSessionsByUserId(java.lang.String userId, ITransaction transaction) throws PortalException
Description copied from interface:IAuthenticationDao
Returns a collection of active session objects for the given user.- Specified by:
getSessionsByUserId
in interfaceIAuthenticationDao
- Returns:
- Throws:
PortalException
-
-