public interface UserHandler
Modifier and Type | Field and Description |
---|---|
static String |
POST_CREATE_USER_EVENT |
static String |
POST_DELETE_USER_EVENT |
static String |
POST_UPDATE_USER_EVENT |
static String |
PRE_CREATE_USER_EVENT |
static String |
PRE_DELETE_USER_EVENT |
static String |
PRE_UPDATE_USER_EVENT |
Modifier and Type | Method and Description |
---|---|
void |
addUserEventListener(UserEventListener listener)
This method is used to register an user event listener
|
boolean |
authenticate(String username,
String password)
Check if the username and the password of an user is valid.
|
void |
createUser(User user,
boolean broadcast)
This method is used to persist a new user object.
|
User |
createUserInstance()
Deprecated.
This method create an User instance that implement the User
interface. The user instance is not persisted yet
|
User |
createUserInstance(String username)
This method create an User instance that implement the User interface.
|
ListAccess<User> |
findAllUsers()
This method is used to get all the users in the database
|
User |
findUserByName(String userName) |
org.exoplatform.commons.utils.PageList<User> |
findUsers(org.exoplatform.services.organization.Query query)
Deprecated.
use
findUsersByQuery(Query) instead |
org.exoplatform.commons.utils.PageList<User> |
findUsersByGroup(String groupId)
Deprecated.
use
findUsersByGroupId(String) instead |
ListAccess<User> |
findUsersByGroupId(String groupId)
This method should search and return the list of the users in a given
group.
|
ListAccess<User> |
findUsersByQuery(org.exoplatform.services.organization.Query query)
This method search for the users accordding to a search criteria, the query
|
org.exoplatform.commons.utils.PageList<User> |
getUserPageList(int pageSize)
Deprecated.
use
findAllUsers() instead |
User |
removeUser(String userName,
boolean broadcast)
Remove an user and broadcast the event to all the registerd listener.
|
void |
removeUserEventListener(UserEventListener listener)
This method is used to unregister an user event listener
|
void |
saveUser(User user,
boolean broadcast)
This method is used to update an existing User object
|
static final String PRE_DELETE_USER_EVENT
static final String POST_DELETE_USER_EVENT
static final String PRE_CREATE_USER_EVENT
static final String POST_CREATE_USER_EVENT
static final String PRE_UPDATE_USER_EVENT
static final String POST_UPDATE_USER_EVENT
User createUserInstance()
User createUserInstance(String username)
username
- Username for new user instance.void createUser(User user, boolean broadcast) throws Exception
user
- The user object to savebroadcast
- If the broadcast value is true , then the UserHandler
should broadcast the event to all the listener that register with
the organization service. For example, the portal service register
an user event listener with the organization service. when a new
account is created, a portal configuration should be created for
the new user account at the same time. In this case the portal
user event listener will be called in the createUser method.Exception:
- The exception can be throwed if the the UserHandler
cannot persist the user object or any listeners fail to handle
the user event.Exception
void saveUser(User user, boolean broadcast) throws Exception
user
- The user object to updatebroadcast
- If the broadcast is true , then all the user event
listener that register with the organization service will be
calledException
- The exception can be throwed if the the UserHandler
cannot save the user object or any listeners fail to handle the
user event.User removeUser(String userName, boolean broadcast) throws Exception
userName
- The user should be removed from the user databasebroadcast
- If broadcast is true, the the delete user event should be
broadcasted to all registered listenerException
User findUserByName(String userName) throws Exception
userName
- the user that the user handler should search forException
- The exception is throwed if the method fail to access the
user database or more than one user object with the same username
is found@Deprecated org.exoplatform.commons.utils.PageList<User> findUsersByGroup(String groupId) throws Exception
findUsersByGroupId(String)
insteadgroupId
- id of the group. The return users list should be in this
groupException
ListAccess<User> findUsersByGroupId(String groupId) throws Exception
groupId
- id of the group. The return users list should be in this
groupException
- any exception@Deprecated org.exoplatform.commons.utils.PageList<User> getUserPageList(int pageSize) throws Exception
findAllUsers()
insteadpageSize
- The number of user in each pageException
ListAccess<User> findAllUsers() throws Exception
Exception
- any exception@Deprecated org.exoplatform.commons.utils.PageList<User> findUsers(org.exoplatform.services.organization.Query query) throws Exception
findUsersByQuery(Query)
insteadquery
- The query object contains the search criteria.Exception
- throw exception if the service cannot access the databaseListAccess<User> findUsersByQuery(org.exoplatform.services.organization.Query query) throws Exception
query
- The query object contains the search criteria.Exception
- throw exception if the service cannot access the databaseboolean authenticate(String username, String password) throws Exception
username
- the name of user to authenticatepassword
- the password of user to authenticateException
- throw an exception if cannot access the databasevoid addUserEventListener(UserEventListener listener)
listener
- the user event listener to registervoid removeUserEventListener(UserEventListener listener)
listener
- the user event listener to unregisterCopyright © 2003-2017 eXo Platform SAS. All Rights Reserved.