Package lumis.portal.user
Class UserManager
- java.lang.Object
-
- lumis.portal.user.UserManager
-
- All Implemented Interfaces:
IConfigDeleter
,IUserManager
,IUserManagerSPI
public class UserManager extends java.lang.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 java.lang.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, java.lang.String userId, java.lang.String newLogin, ITransaction transaction)
Adds an alternative login for an user.void
addOrUpdate(SessionConfig sessionConfig, UserConfig userConfig, ITransaction transaction)
void
delete(SessionConfig sessionConfig, java.lang.String userId, ITransaction transaction)
Delete an user.void
deleteAlternativeLogin(SessionConfig sessionConfig, java.lang.String loginToDelete, ITransaction transaction)
Deletes an alternative login.void
deleteConfig(DeserializationContext deserializationContext, java.lang.String configId)
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(SessionConfig sessionConfig, java.lang.String userId, ITransaction transaction)
Get user configuration from userId.java.util.Collection<java.lang.String>
getAlternativeLogins(SessionConfig sessionConfig, java.lang.String userId, ITransaction transaction)
Returns the alternative logins for an user.java.util.Collection<UserConfig>
getByChannelId(SessionConfig sessionConfig, java.lang.String channelId, ITransaction transaction)
Returns the local users of the specified channeljava.util.Collection<UserConfig>
getByOrigin(SessionConfig sessionConfig, java.lang.String origin, ITransaction transaction)
Return the users, searching by the user's origin.java.lang.String
getUserId(SessionConfig sessionConfig, java.lang.String userLogin, ITransaction transaction)
Deprecated.java.lang.String
getUserIdByLogin(SessionConfig sessionConfig, java.lang.String userLogin, ITransaction transaction)
Get the id for a user with the given login.IFile
getUserProfileImageContentTypeFile(java.lang.String userId)
Returns the user's profile image content type file.IFile
getUserProfileImageFile(java.lang.String userId)
Returns the user's profile image file.java.lang.String
getUserProfileImageHref(java.lang.String userId)
Get user profile image href by user identifierjava.util.Collection<UserConfig>
getUsersByLogins(java.util.Set<java.lang.String> logins)
Get users with the given logins.void
setPassword(SessionConfig sessionConfig, java.lang.String userId, java.lang.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 java.lang.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, java.lang.String userId, java.lang.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, java.lang.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 java.lang.String getUserId(SessionConfig sessionConfig, java.lang.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 java.lang.String getUserIdByLogin(SessionConfig sessionConfig, java.lang.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, java.lang.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 java.util.Collection<UserConfig> getByChannelId(SessionConfig sessionConfig, java.lang.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 java.util.Collection<UserConfig> getByOrigin(SessionConfig sessionConfig, java.lang.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, java.lang.String configId) throws PortalException
- Specified by:
deleteConfig
in interfaceIConfigDeleter
- Throws:
PortalException
-
addAlternativeLogin
public void addAlternativeLogin(SessionConfig sessionConfig, java.lang.String userId, java.lang.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 java.util.Collection<java.lang.String> getAlternativeLogins(SessionConfig sessionConfig, java.lang.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, java.lang.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(java.lang.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(java.lang.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 java.lang.String getUserProfileImageHref(java.lang.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 java.util.List<UserConfig> findUsers(java.lang.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 java.util.Collection<UserConfig> getUsersByLogins(java.util.Set<java.lang.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)
-
-