public interface MembershipHandler
Modifier and Type | Method and Description |
---|---|
void |
addMembershipEventListener(MembershipEventListener listener)
Use this method to register a membership event listener.
|
void |
createMembership(Membership m,
boolean broadcast)
Deprecated.
This method should no be called, use the linkMembership(..)
instead
|
Membership |
createMembershipInstance()
Deprecated.
This method should not be called, use the linkMembership
instead.
|
ListAccess<Membership> |
findAllMembershipsByGroup(Group group)
Use this method to find all the membership in a group.
|
Membership |
findMembership(String id)
Use this method to search for an mebership record with the given id
|
Membership |
findMembershipByUserGroupAndType(String userName,
String groupId,
String type)
Use this method to search for a specific membership type of an user in a
group.
|
Collection |
findMembershipsByGroup(Group group)
Deprecated.
This method should no be called, use
findAllMembershipsByGroup(Group)
instead |
Collection |
findMembershipsByUser(String userName)
Use this method to find all the memberships of an user in any group.
|
Collection |
findMembershipsByUserAndGroup(String userName,
String groupId)
Use this method to find all the memberships of an user in a group
|
void |
linkMembership(User user,
Group group,
MembershipType m,
boolean broadcast)
Use this method to create a membership record, a relation of the user,
group and membership type.
|
Membership |
removeMembership(String id,
boolean broadcast)
Use this method to remove a membership.
|
Collection |
removeMembershipByUser(String username,
boolean broadcast)
Use this method to remove all user's membership.
|
void |
removeMembershipEventListener(MembershipEventListener listener)
Use this method to unregister a membership event listener.
|
Membership createMembershipInstance()
void createMembership(Membership m, boolean broadcast) throws Exception
Exception
void linkMembership(User user, Group group, MembershipType m, boolean broadcast) throws Exception
user
- The user of the membershipgroup
- The group of the membershipm
- The MembershipType of the membershipbroadcast
- Broadcast the event if the value of the broadcast is
'true'Exception
- An exception is thrown if the method is fail to access
the database, membership type not existed or any listener fail to handle the event.Membership removeMembership(String id, boolean broadcast) throws Exception
id
- The id of the membershipbroadcast
- Broadcast the event to the registered listeners if the
broadcast event is 'true'Exception
- An exception is throwed if the method cannot access the
database or any listener fail to handle the event.Collection removeMembershipByUser(String username, boolean broadcast) throws Exception
username
- The username which user object need remove membershipsbroadcast
- Broadcast the event to the registered listeners if the
broadcast event is 'true'Exception
- An exception is throwed if the method cannot access the
database or any listener fail to handle the event.Membership findMembership(String id) throws Exception
id
- The id of the mebershipException
- An exception is throwed if the method fail to access the
database or no membership is found.Membership findMembershipByUserGroupAndType(String userName, String groupId, String type) throws Exception
userName
- The username of the user.groupId
- The group identifiertype
- The membership typeException
- Usually an exception is thrown if the method cannot
access the databaseCollection findMembershipsByUserAndGroup(String userName, String groupId) throws Exception
userName
- groupId
- Exception
- Usually an exception is thrown if the method cannot
access the database.Collection findMembershipsByUser(String userName) throws Exception
userName
- Exception
- Usually an exception is throwed if the method cannot
access the database.Collection findMembershipsByGroup(Group group) throws Exception
findAllMembershipsByGroup(Group)
insteadgroup
- Exception
ListAccess<Membership> findAllMembershipsByGroup(Group group) throws Exception
group
- Exception
void addMembershipEventListener(MembershipEventListener listener)
listener
- the listener instance.void removeMembershipEventListener(MembershipEventListener listener)
listener
- the listener instance.Copyright © 2003-2017 eXo Platform SAS. All Rights Reserved.