public interface GroupHandler
Modifier and Type | Field and Description |
---|---|
static String |
POST_CREATE_GROUP_EVENT |
static String |
POST_DELETE_GROUP_EVENT |
static String |
POST_UPDATE_GROUP_EVENT |
static String |
PRE_CREATE_GROUP_EVENT |
static String |
PRE_DELETE_GROUP_EVENT |
static String |
PRE_UPDATE_GROUP_EVENT |
Modifier and Type | Method and Description |
---|---|
void |
addChild(Group parent,
Group child,
boolean broadcast)
Use this method to create a new group.
|
void |
addGroupEventListener(GroupEventListener listener)
Use this method to register a group event listener
|
void |
createGroup(Group group,
boolean broadcast)
Deprecated.
This method should not be used , use the addChild(..) method
and pass the null as the parent if you want to add the group to
the root level.
|
Group |
createGroupInstance() |
Group |
findGroupById(String groupId)
Use this method to search for a group
|
Collection |
findGroupByMembership(String userName,
String membershipType)
Use this method to find all the groups of an user with the specified
membership type
|
Collection |
findGroups(Group parent)
Use this method to find all the children group of a group.
|
Collection |
findGroupsOfUser(String user)
use this method to look all the group that the user has at least one
membership.
|
Collection |
getAllGroups()
Use this method to get all the groups.
|
Group |
removeGroup(Group group,
boolean broadcast)
Use this method to remove a group from the group database.
|
void |
removeGroupEventListener(GroupEventListener listener)
Use this method to unregister a group event listener
|
void |
saveGroup(Group group,
boolean broadcast)
Use this method to update the properties of an existed group.
|
static final String PRE_DELETE_GROUP_EVENT
static final String POST_DELETE_GROUP_EVENT
static final String PRE_CREATE_GROUP_EVENT
static final String POST_CREATE_GROUP_EVENT
static final String PRE_UPDATE_GROUP_EVENT
static final String POST_UPDATE_GROUP_EVENT
Group createGroupInstance()
void createGroup(Group group, boolean broadcast) throws Exception
Exception
void addChild(Group parent, Group child, boolean broadcast) throws Exception
parent
- The parent group of the new group. use 'null' if you want to
create the group at the root level.child
- The group that you want to create.broadcast
- Broadcast the new group event to all the registered
listener if broadcast is trueException
- An exception is thrown if the method fail to persist the
new group or there is already one child group with the same group
name in the database or any registered listener fail to handle
the event.void saveGroup(Group group, boolean broadcast) throws Exception
group
- The group object with the updated information.broadcast
- Broadcast the event to all the registered listener if the
broadcast value is trueException
- An exception is thrown if the method cannot access the
database or any listener fail to handle the eventGroup removeGroup(Group group, boolean broadcast) throws Exception
group
- The group to be removed. The group parameter should be
obtained form the findGroupId(..) method. When the group is
removed, the memberships of the group should be removed as well.broadcast
- Broadcast the event to the registered listener if the
broadcast value is 'true'Exception
- An exception is thrown if the method fail to remove the
group from the database, the group is not existed in the
database, or any listener fail to handle the event.Collection findGroupByMembership(String userName, String membershipType) throws Exception
userName
- The user that the method should search for.membershipType
- The type of the membership. Since an user can have
one or more membership in a group, this parameter is necessary. If
the membershipType is null, it should mean any membership type.Exception
- An exception is thrown if the method cannot access the
database.Group findGroupById(String groupId) throws Exception
groupId
- the id of the group that you want to search forException
- An exception is thrown if the method cannot access the
database or more than one group is found.Collection findGroups(Group parent) throws Exception
parent
- The group that you want to search. Use null if you want to
search from the root.Exception
- An exception is thrown is the method cannot access the
databaseCollection findGroupsOfUser(String user) throws Exception
user
- The username of the userException
- An exception is thrown if the method cannot access the
database.Collection getAllGroups() throws Exception
Exception
void addGroupEventListener(GroupEventListener listener)
listener
- the group event listener instance.void removeGroupEventListener(GroupEventListener listener)
listener
- the group event listener instance.Copyright © 2003-2017 eXo Platform SAS. All Rights Reserved.