Package lumis.portal.user
Class UserManager
- java.lang.Object
-
- lumis.portal.user.UserManager
-
- All Implemented Interfaces:
IConfigDeleter
,IUserManager
,IUserManagerSPI
public class UserManager extends Object implements IUserManagerSPI
Class responsible for managing operations on the portal users.- Since:
- 4.0.0
- Version:
- $Revision: 23574 $ $Date: 2020-02-10 15:52:11 -0300 (Mon, 10 Feb 2020) $
-
-
Constructor Summary
Constructors Constructor Description UserManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description String
add(SessionConfig sessionConfig, UserConfig userConfig, ITransaction transaction)
Adds a user to the portal and returns the identifier of the user added.void
addAlternativeLogin(SessionConfig sessionConfig, String userId, String newLogin, ITransaction transaction)
Adds an alternative login for an user.void
addOrUpdate(SessionConfig sessionConfig, UserConfig userConfig, ITransaction transaction)
void
delete(SessionConfig sessionConfig, String userId, ITransaction transaction)
Delete an user.void
deleteAlternativeLogin(SessionConfig sessionConfig, String loginToDelete, ITransaction transaction)
Deletes an alternative login.void
deleteConfig(DeserializationContext deserializationContext, String configId)
List<UserConfig>
findUsers(String query, boolean includeFrameworkUsers, int maxResults)
Find users by user login or user name, given a search query.UserConfig
get(SessionConfig sessionConfig, String userId, ITransaction transaction)
Get user configuration from userId.Collection<String>
getAlternativeLogins(SessionConfig sessionConfig, String userId, ITransaction transaction)
Returns the alternative logins for an user.Collection<UserConfig>
getByChannelId(SessionConfig sessionConfig, String channelId, ITransaction transaction)
Returns the local users of the specified channelCollection<UserConfig>
getByOrigin(SessionConfig sessionConfig, String origin, ITransaction transaction)
Return the users, searching by the user's origin.String
getUserId(SessionConfig sessionConfig, String userLogin, ITransaction transaction)
Deprecated.String
getUserIdByLogin(SessionConfig sessionConfig, String userLogin, ITransaction transaction)
Get the id for a user with the given login.IFile
getUserProfileImageContentTypeFile(String userId)
Returns the user's profile image content type file.IFile
getUserProfileImageFile(String userId)
Returns the user's profile image file.String
getUserProfileImageHref(String userId)
Get user profile image href by user identifierCollection<UserConfig>
getUsersByLogins(Set<String> logins)
Get users with the given logins.void
setPassword(SessionConfig sessionConfig, String userId, String password, ITransaction transaction)
Set a new password for the uservoid
update(SessionConfig sessionConfig, UserConfig userConfig, ITransaction transaction)
Update the user configuration.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface lumis.portal.user.IUserManagerSPI
findUsers
-
-
-
-
Method Detail
-
addOrUpdate
public void addOrUpdate(SessionConfig sessionConfig, UserConfig userConfig, ITransaction transaction) throws ManagerException, PortalException
- Specified by:
addOrUpdate
in interfaceIUserManager
- Throws:
ManagerException
PortalException
-
add
public String add(SessionConfig sessionConfig, UserConfig userConfig, ITransaction transaction) throws ManagerException, PortalException
Description copied from interface:IUserManager
Adds a user to the portal and returns the identifier of the user added. If the userId is not provided, a new userId is created.- Specified by:
add
in interfaceIUserManager
- Returns:
- a String Identifier of the user added
- Throws:
ManagerException
PortalException
-
update
public void update(SessionConfig sessionConfig, UserConfig userConfig, ITransaction transaction) throws ManagerException, PortalException
Description copied from interface:IUserManager
Update the user configuration.- Specified by:
update
in interfaceIUserManager
- Throws:
ManagerException
PortalException
-
setPassword
public void setPassword(SessionConfig sessionConfig, String userId, String password, ITransaction transaction) throws ManagerException, PortalException
Description copied from interface:IUserManager
Set a new password for the user- Specified by:
setPassword
in interfaceIUserManager
- Throws:
ManagerException
PortalException
-
get
public UserConfig get(SessionConfig sessionConfig, String userId, ITransaction transaction) throws ManagerException, PortalException
Description copied from interface:IUserManager
Get user configuration from userId.- Specified by:
get
in interfaceIUserManager
- Returns:
- an UserConfig.
- Throws:
ManagerException
PortalException
-
getUserId
@Deprecated public String getUserId(SessionConfig sessionConfig, String userLogin, ITransaction transaction) throws ManagerException, PortalException
Deprecated.Description copied from interface:IUserManager
Get the userId from the userLogin- Specified by:
getUserId
in interfaceIUserManager
- Returns:
- an UserConfig.
- Throws:
ManagerException
PortalException
-
getUserIdByLogin
public String getUserIdByLogin(SessionConfig sessionConfig, String userLogin, ITransaction transaction) throws ManagerException, PortalException
Description copied from interface:IUserManager
Get the id for a user with the given login.- Specified by:
getUserIdByLogin
in interfaceIUserManager
- Parameters:
sessionConfig
- the current user session information.userLogin
- the login.transaction
- the transaction for persistence access.- Returns:
- the userId.
- Throws:
ManagerException
PortalException
-
delete
public void delete(SessionConfig sessionConfig, String userId, ITransaction transaction) throws ManagerException, PortalException
Description copied from interface:IUserManager
Delete an user.- Specified by:
delete
in interfaceIUserManager
- Throws:
ManagerException
PortalException
-
getByChannelId
public Collection<UserConfig> getByChannelId(SessionConfig sessionConfig, String channelId, ITransaction transaction) throws ManagerException, PortalException
Description copied from interface:IUserManager
Returns the local users of the specified channel- Specified by:
getByChannelId
in interfaceIUserManager
- Returns:
- an aray of UserConfig.
- Throws:
ManagerException
PortalException
-
getByOrigin
public Collection<UserConfig> getByOrigin(SessionConfig sessionConfig, String origin, ITransaction transaction) throws ManagerException, PortalException
Description copied from interface:IUserManager
Return the users, searching by the user's origin.- Specified by:
getByOrigin
in interfaceIUserManager
- Parameters:
sessionConfig
- the user session information.origin
- the origin.transaction
- the transaction for persistence access.- Returns:
- the UserConfig instances, or an empty collection if none was found.
- Throws:
DaoException
PortalException
ManagerException
-
deleteConfig
public void deleteConfig(DeserializationContext deserializationContext, String configId) throws PortalException
- Specified by:
deleteConfig
in interfaceIConfigDeleter
- Throws:
PortalException
-
addAlternativeLogin
public void addAlternativeLogin(SessionConfig sessionConfig, String userId, String newLogin, ITransaction transaction) throws PortalException
Description copied from interface:IUserManager
Adds an alternative login for an user.- Specified by:
addAlternativeLogin
in interfaceIUserManager
- Parameters:
sessionConfig
- the user session information.userId
- the user id.newLogin
- the new alternative login.transaction
- the transaction for persistence access.- Throws:
PortalException
-
getAlternativeLogins
public Collection<String> getAlternativeLogins(SessionConfig sessionConfig, String userId, ITransaction transaction) throws PortalException
Description copied from interface:IUserManager
Returns the alternative logins for an user.- Specified by:
getAlternativeLogins
in interfaceIUserManager
- Parameters:
sessionConfig
- the user session information.userId
- the user id.transaction
- the transaction for persistence access.- Throws:
PortalException
-
deleteAlternativeLogin
public void deleteAlternativeLogin(SessionConfig sessionConfig, String loginToDelete, ITransaction transaction) throws PortalException
Description copied from interface:IUserManager
Deletes an alternative login.- Specified by:
deleteAlternativeLogin
in interfaceIUserManager
- Parameters:
sessionConfig
- the user session information.loginToDelete
- the login to be deleted.transaction
- the transaction for persistence access.- Throws:
PortalException
-
getUserProfileImageFile
public IFile getUserProfileImageFile(String userId)
Description copied from interface:IUserManagerSPI
Returns the user's profile image file.- Specified by:
getUserProfileImageFile
in interfaceIUserManagerSPI
- Parameters:
userId
- the user identifier.- Returns:
- the user's profile image file.
-
getUserProfileImageContentTypeFile
public IFile getUserProfileImageContentTypeFile(String userId)
Description copied from interface:IUserManagerSPI
Returns the user's profile image content type file.- Specified by:
getUserProfileImageContentTypeFile
in interfaceIUserManagerSPI
- Parameters:
userId
- the user identifier.- Returns:
- the user's profile image content type file.
-
getUserProfileImageHref
public String getUserProfileImageHref(String userId)
Description copied from interface:IUserManagerSPI
Get user profile image href by user identifier- Specified by:
getUserProfileImageHref
in interfaceIUserManagerSPI
- Parameters:
userId
- the user identifier- Returns:
- user profile image href
-
findUsers
public List<UserConfig> findUsers(String query, boolean includeFrameworkUsers, int maxResults) throws PortalException
Description copied from interface:IUserManagerSPI
Find users by user login or user name, given a search query.- Specified by:
findUsers
in interfaceIUserManagerSPI
- 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.
- Throws:
PortalException
- See Also:
IUserDao.findUsers(String, boolean, int)
-
getUsersByLogins
public Collection<UserConfig> getUsersByLogins(Set<String> logins) throws PortalException
Description copied from interface:IUserManagerSPI
Get users with the given logins.- Specified by:
getUsersByLogins
in interfaceIUserManagerSPI
- Parameters:
logins
- logins for getting users- Returns:
- List of users with the given logins.
- Throws:
PortalException
- See Also:
IUserDao.getUsersByLogins(Set)
-
-