Interface IGroupMembershipProvider
-
- All Known Implementing Classes:
AbstractGroupMembershipProvider
,DatabaseViewGroupMembershipProvider
,StandardGroupMembershipProvider
@StableMinor(version="17.0", sinceVersion="4.2") public interface IGroupMembershipProvider
Provides group membership information. A portal solution may configure a group type to use a specific implementation of this interface as a way to customize group membership definition/calculation.Membership caching is responsibility of IGroupMembershipProvider. It decides its own caching policy, using one appropriated to its membership calculation logic.
All methods of this interface are called within a transactional context and within a user session context.
The following diagram shows the lifecycle for a IGroupMembershipProvider instance and the methods called in each transition:
- Since:
- 4.2.1
- Version:
- $Revision$ $Date$
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addMember(java.lang.String groupId, java.lang.String memberId)
Add a member into a group.void
deleteGroupMembershipData(java.lang.String groupId)
Deletes all data stored for managing the membership of a group.void
deleteGroupTypeMembershipData()
Deletes all data stored for managing the membership of a group type.void
destroy()
Indicates that this membership provider will no longer be used.java.lang.String
getGroupConfigurationInterfaceId()
Returns the interface identifier for editing configurations at a group scope.java.util.Collection<java.lang.String>
getGroups(java.lang.String principalId)
Returns the groups of a principal.java.lang.String
getGroupTypeConfigurationInterfaceId()
Returns the interface identifier for editing configurations at a group type scope.java.util.Collection<java.lang.String>
getMembers(java.lang.String groupId, int filterType)
Returns the members of a group.void
init(GroupType groupType)
Initializes this membership provider to be used for the given group type.void
removeMember(java.lang.String groupId, java.lang.String memberId)
Remove a member from a group.
-
-
-
Method Detail
-
init
void init(GroupType groupType)
Initializes this membership provider to be used for the given group type.This method is the first method called after an instance creation.
- Parameters:
groupType
- the group type.- Since:
- 4.2.1
-
destroy
void destroy()
Indicates that this membership provider will no longer be used.This method may be used to clean up resources allocated in this instance. This instance is no longer used after this method is called.
- Since:
- 4.2.1
-
getGroupTypeConfigurationInterfaceId
java.lang.String getGroupTypeConfigurationInterfaceId()
Returns the interface identifier for editing configurations at a group type scope.The interface will receive the parameter groupTypeId with the identifier of the group type being configured.
Usually
deleteGroupTypeMembershipData()
will be used to delete data stored using this configuration interface.- Returns:
- the interface identifier, or null if no such configuration interface exists.
- Since:
- 4.2.1
-
getGroupConfigurationInterfaceId
java.lang.String getGroupConfigurationInterfaceId()
Returns the interface identifier for editing configurations at a group scope.The interface will receive the parameter groupId with the identifier of the group being configured.
Usually
deleteGroupMembershipData(String)
will be used to delete data stored using this configuration interface.- Returns:
- the interface identifier, or null if no such configuration interface exists.
- Since:
- 4.2.1
-
addMember
void addMember(java.lang.String groupId, java.lang.String memberId) throws PortalException
Add a member into a group.- Parameters:
groupId
- the group identifier.memberId
- the member identifier.- Throws:
java.lang.UnsupportedOperationException
- if this membership provider is read-only and does not supports adding members through this interface.PortalException
- Since:
- 4.2.1
-
removeMember
void removeMember(java.lang.String groupId, java.lang.String memberId) throws PortalException
Remove a member from a group.- Parameters:
groupId
- the group identifier.memberId
- the member identifier.- Throws:
java.lang.UnsupportedOperationException
- if this membership provider is read-only and does not supports removing members through this interface. Note that if the member ceases to exists, and, even if this method throws this exception,getMembers(String, int)
should no longer return that member as it does not exist.PortalException
- Since:
- 4.2.1
-
getMembers
java.util.Collection<java.lang.String> getMembers(java.lang.String groupId, int filterType) throws PortalException
Returns the members of a group. Only the direct members are returned.- Parameters:
groupId
- the group identifier.filterType
- defines how the result will be filtered. This may be one ofIGroupManager.FILTER_TYPE_USERS_AND_GROUPS
,IGroupManager.FILTER_TYPE_ONLY_USERS
orIGroupManager.FILTER_TYPE_ONLY_GROUPS
.- Returns:
- a collection of group's member principals identifiers, obeying the specified filter type.
- Throws:
PortalException
- Since:
- 4.2.1
-
getGroups
java.util.Collection<java.lang.String> getGroups(java.lang.String principalId) throws PortalException
Returns the groups of a principal. Only the direct groups, belonging to the group type this provider is serving, are to be returned.- Parameters:
principalId
- the principal identifier.- Returns:
- the groups identifiers.
- Throws:
PortalException
- Since:
- 4.2.1
-
deleteGroupTypeMembershipData
void deleteGroupTypeMembershipData() throws PortalException
Deletes all data stored for managing the membership of a group type. This method is called before a group type is deleted, in the same transaction in which the deletion will be performed.This allows this provider to cleanup membership, configuration or other data that it stores for managing a group type membership.
- Throws:
PortalException
- Since:
- 4.2.1
-
deleteGroupMembershipData
void deleteGroupMembershipData(java.lang.String groupId) throws PortalException
Deletes all data stored for managing the membership of a group. This method is called before a group is deleted, in the same transaction in which the deletion will be performed.This allows this provider to cleanup membership, configuration or other data that it stores for managing a group membership.
This deletion process order is illustrated in the following diagram:
- Parameters:
groupId
- the group identifier.- Throws:
PortalException
- Since:
- 4.2.1
-
-