Package lumis.portal.user
Class UserDaoJdbc
- java.lang.Object
-
- lumis.portal.user.UserDaoJdbc
-
-
Constructor Summary
Constructors Constructor Description UserDaoJdbc()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(UserConfig userConfig, ITransaction transaction)
Add the user.void
addAlternativeLogin(java.lang.String userId, java.lang.String newLogin, ITransaction transaction)
Adds an alternative login to a user.void
delete(java.lang.String userId, ITransaction transaction)
Delete the user.void
deleteAlternativeLogin(java.lang.String loginToDelete, ITransaction transaction)
Deletes an alternative login.java.util.List<UserConfig>
findUsers(java.lang.String query, boolean includeFrameworkUsers, int maxResults)
Find users by user login or user name, given a search query.UserConfig
get(java.lang.String userId, ITransaction transaction)
get the user.java.util.Collection<java.lang.String>
getAllUserIds(ITransaction transaction)
Returns all user ids.java.util.Collection<java.lang.String>
getAlternativeLogins(java.lang.String userId, ITransaction transaction)
Returns the alternative logins of an user.java.util.Collection<java.lang.String>
getByChannelId(java.lang.String channelId, ITransaction transaction)
Return the local users IDs of the specified channeljava.util.Collection<java.lang.String>
getByOrigin(java.lang.String origin, ITransaction transaction)
Return the user ids, searching by the user's origin.java.lang.String
getUserIdByLogin(java.lang.String login, ITransaction transaction)
Get the id of the user.java.util.Collection<UserConfig>
getUsersByLogins(java.util.Set<java.lang.String> logins)
Get users with the given logins.void
setPassword(java.lang.String userId, java.lang.String password, ITransaction transaction)
Sets a new password for the uservoid
update(UserConfig userConfig, ITransaction transaction)
Update the user.void
updateLoginHistory(java.lang.String userId, boolean loginSuccess)
Updates persistence information about a user login history.
-
-
-
Method Detail
-
get
public UserConfig get(java.lang.String userId, ITransaction transaction) throws DaoException, PortalException
Description copied from interface:IUserDao
get the user.- Specified by:
get
in interfaceIUserDao
- Returns:
- Throws:
DaoException
PortalException
-
getUserIdByLogin
public java.lang.String getUserIdByLogin(java.lang.String login, ITransaction transaction) throws DaoException, PortalException
Description copied from interface:IUserDao
Get the id of the user.- Specified by:
getUserIdByLogin
in interfaceIUserDao
- Returns:
- Throws:
DaoException
PortalException
-
add
public void add(UserConfig userConfig, ITransaction transaction) throws DaoException, PortalException
Description copied from interface:IUserDao
Add the user.- Specified by:
add
in interfaceIUserDao
- Throws:
DaoException
PortalException
-
update
public void update(UserConfig userConfig, ITransaction transaction) throws DaoException, PortalException
Description copied from interface:IUserDao
Update the user.- Specified by:
update
in interfaceIUserDao
- Throws:
DaoException
PortalException
-
setPassword
public void setPassword(java.lang.String userId, java.lang.String password, ITransaction transaction) throws DaoException, PortalException
Description copied from interface:IUserDao
Sets a new password for the user- Specified by:
setPassword
in interfaceIUserDao
- Throws:
DaoException
PortalException
-
updateLoginHistory
public void updateLoginHistory(java.lang.String userId, boolean loginSuccess) throws PortalException
Description copied from interface:IUserDao
Updates persistence information about a user login history. This method is to be called after a login attempt.Note: This method uses its own transaction.
- Specified by:
updateLoginHistory
in interfaceIUserDao
- Parameters:
userId
- the user identifier.loginSuccess
-true
if the login attempt was successful,false
otherwise.- Throws:
PortalException
-
delete
public void delete(java.lang.String userId, ITransaction transaction) throws DaoException, PortalException
Description copied from interface:IUserDao
Delete the user.- Specified by:
delete
in interfaceIUserDao
- Throws:
DaoException
PortalException
-
getByChannelId
public java.util.Collection<java.lang.String> getByChannelId(java.lang.String channelId, ITransaction transaction) throws DaoException, PortalException
Description copied from interface:IUserDao
Return the local users IDs of the specified channel- Specified by:
getByChannelId
in interfaceIUserDao
- Returns:
- Throws:
DaoException
PortalException
-
addAlternativeLogin
public void addAlternativeLogin(java.lang.String userId, java.lang.String newLogin, ITransaction transaction) throws PortalException
Description copied from interface:IUserDao
Adds an alternative login to a user.- Specified by:
addAlternativeLogin
in interfaceIUserDao
- Parameters:
userId
- the user id.newLogin
- the alternative login to be added.transaction
- the transaction for persistence access.- Throws:
PortalException
-
getAlternativeLogins
public java.util.Collection<java.lang.String> getAlternativeLogins(java.lang.String userId, ITransaction transaction) throws PortalException
Description copied from interface:IUserDao
Returns the alternative logins of an user.- Specified by:
getAlternativeLogins
in interfaceIUserDao
- Parameters:
userId
- the user id.transaction
- the transaction for persistence access.- Returns:
- a collection with the alternative logins of the user.
- Throws:
PortalException
-
deleteAlternativeLogin
public void deleteAlternativeLogin(java.lang.String loginToDelete, ITransaction transaction) throws PortalException
Description copied from interface:IUserDao
Deletes an alternative login.- Specified by:
deleteAlternativeLogin
in interfaceIUserDao
- Parameters:
loginToDelete
- the alternative login to be deleted.transaction
- the transaction for persistence access.- Throws:
PortalException
-
getByOrigin
public java.util.Collection<java.lang.String> getByOrigin(java.lang.String origin, ITransaction transaction) throws DaoException, PortalException
Description copied from interface:IUserDao
Return the user ids, searching by the user's origin.- Specified by:
getByOrigin
in interfaceIUserDao
- Parameters:
origin
- the origin.transaction
- the transaction for persistence access.- Returns:
- the user ids, or an empty collection if none was found.
- Throws:
DaoException
PortalException
-
getAllUserIds
public java.util.Collection<java.lang.String> getAllUserIds(ITransaction transaction) throws PortalException
Description copied from interface:IUserDao
Returns all user ids.- Specified by:
getAllUserIds
in interfaceIUserDao
- Parameters:
transaction
- the transaction for persistence access.- Returns:
- the user ids, or an empty collection if none was found.
- Throws:
PortalException
-
findUsers
public java.util.List<UserConfig> findUsers(java.lang.String query, boolean includeFrameworkUsers, int maxResults) throws PortalException
Description copied from interface:IUserDao
Find users by user login or user name, given a search query.- Specified by:
findUsers
in interfaceIUserDao
- Parameters:
query
- query used to search usersincludeFrameworkUsers
- indicates if framework users must also be returnedmaxResults
- amount of users to return- Returns:
- List of users which matches the search query with the given parameters, ordered by user name.
- Throws:
PortalException
-
getUsersByLogins
public java.util.Collection<UserConfig> getUsersByLogins(java.util.Set<java.lang.String> logins) throws PortalException
Description copied from interface:IUserDao
Get users with the given logins.- Specified by:
getUsersByLogins
in interfaceIUserDao
- Parameters:
logins
- logins for getting users- Returns:
- List of users with the given logins, ordered by user name.
- Throws:
PortalException
-
-