Package lumis.portal.authentication
Class AuthenticationDaoJdbc
- java.lang.Object
-
- lumis.portal.authentication.AuthenticationDaoJdbc
-
- All Implemented Interfaces:
IAuthenticationDao
public class AuthenticationDaoJdbc extends Object implements IAuthenticationDao
Authentication dao implementation.- Since:
- 4.0.0
- Version:
- $Revision: 24014 $ $Date: 2020-08-10 14:16:08 -0300 (Mon, 10 Aug 2020) $
-
-
Constructor Summary
Constructors Constructor Description AuthenticationDaoJdbc()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addUserSessionId(String userSessionId, String userId)
Add the User Session Id.Collection<SessionConfig>
clearInactiveSessions(int minutes, ITransaction transaction)
Remove sessions inactive for the specified amount of minutes.void
deleteUserSessionByUserId(String userId)
Delete the User Session Id from the user id.void
deleteUserSessionId(String userSessionId)
Delete the User Session Id.Collection<SessionConfig>
getSessionsByUserId(String userId, ITransaction transaction)
Returns a collection of active session objects for the given user.String
getUserId(String userSessionId, ITransaction transaction)
Get the user id.void
keepSessionAlive(String sessionId)
Update the last access date for the given session.boolean
validateUserLogin(String login, String password, ITransaction transaction)
Validade the user login.String
validateUserSession(String userSessionId, ITransaction transaction)
Validate the session of the user.
-
-
-
Method Detail
-
addUserSessionId
public void addUserSessionId(String userSessionId, 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(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(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 String validateUserSession(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 String getUserId(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(String login, 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(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 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 Collection<SessionConfig> getSessionsByUserId(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
-
-