Interface IGroupMembershipProvider
-
- All Known Implementing Classes:
AbstractGroupMembershipProvider
,DatabaseViewGroupMembershipProvider
,StandardGroupMembershipProvider
@StableMinor(version="14.2", 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: 24985 $ $Date: 2022-05-02 23:04:30 -0300 (Mon, 02 May 2022) $
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addMember(String groupId, String memberId)
Add a member into a group.void
deleteGroupMembershipData(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.String
getGroupConfigurationInterfaceId()
Returns the interface identifier for editing configurations at a group scope.Collection<String>
getGroups(String principalId)
Returns the groups of a principal.String
getGroupTypeConfigurationInterfaceId()
Returns the interface identifier for editing configurations at a group type scope.Collection<String>
getMembers(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(String groupId, 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
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
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(String groupId, String memberId) throws PortalException
Add a member into a group.- Parameters:
groupId
- the group identifier.memberId
- the member identifier.- Throws:
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(String groupId, String memberId) throws PortalException
Remove a member from a group.- Parameters:
groupId
- the group identifier.memberId
- the member identifier.- Throws:
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
Collection<String> getMembers(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
Collection<String> getGroups(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(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
-
-