Interface Group
-
- All Superinterfaces:
Authorizable
@ProviderType public interface Group extends Authorizable
A Group is a collection ofAuthorizable
s.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
addMember(@NotNull Authorizable authorizable)
Add a member to this Group.@NotNull Set<String>
addMembers(@NotNull String... memberIds)
Add one or more member(s) to this Group.@NotNull Iterator<Authorizable>
getDeclaredMembers()
@NotNull Iterator<Authorizable>
getMembers()
boolean
isDeclaredMember(@NotNull Authorizable authorizable)
Test whether anAuthorizable
is a declared member of this group.boolean
isMember(@NotNull Authorizable authorizable)
boolean
removeMember(@NotNull Authorizable authorizable)
Remove a member from this Group.@NotNull Set<String>
removeMembers(@NotNull String... memberIds)
Remove one or several members from this Group.-
Methods inherited from interface org.apache.jackrabbit.api.security.user.Authorizable
declaredMemberOf, getID, getPath, getPrincipal, getProperty, getPropertyNames, getPropertyNames, hasProperty, isGroup, memberOf, remove, removeProperty, setProperty, setProperty
-
-
-
-
Method Detail
-
getDeclaredMembers
@NotNull @NotNull Iterator<Authorizable> getDeclaredMembers() throws RepositoryException
- Returns:
- Iterator of
Authorizable
s which are declared members of this Group. - Throws:
RepositoryException
- If an error occurs.
-
getMembers
@NotNull @NotNull Iterator<Authorizable> getMembers() throws RepositoryException
- Returns:
- Iterator of
Authorizable
s which are members of this Group. This includes both declared members and all authorizables that are indirect group members. - Throws:
RepositoryException
- If an error occurs.
-
isDeclaredMember
boolean isDeclaredMember(@NotNull @NotNull Authorizable authorizable) throws RepositoryException
Test whether anAuthorizable
is a declared member of this group.- Parameters:
authorizable
- TheAuthorizable
to test.- Returns:
true
if the Authorizable to test is a direct member- Throws:
RepositoryException
- If an error occurs.
-
isMember
boolean isMember(@NotNull @NotNull Authorizable authorizable) throws RepositoryException
- Parameters:
authorizable
- TheAuthorizable
to test.- Returns:
- true if the Authorizable to test is a direct or indirect member of this Group.
- Throws:
RepositoryException
- If an error occurs.
-
addMember
boolean addMember(@NotNull @NotNull Authorizable authorizable) throws RepositoryException
Add a member to this Group.- Parameters:
authorizable
- TheAuthorizable
to be added as member to this group.- Returns:
- true if the
Authorizable
has successfully been added to this Group, false otherwise (e.g. unknown implementation or if it already is a member or if the passed authorizable is this group itself or for some implementation specific constraint). - Throws:
RepositoryException
- If an error occurs.
-
addMembers
@NotNull @NotNull Set<String> addMembers(@NotNull @NotNull String... memberIds) throws RepositoryException
Add one or more member(s) to this Group. Note, that an implementation may define circumstances under which this method allows to add non-existingAuthorizable
s as new members. Also an implementation may choose to (partially) postpone validation/verification utilSession.save()
.- Parameters:
memberIds
- TheId
s of the authorizables to be added as members to this group.- Returns:
- a set of those
memberIds
that could not be added or an empty set of all ids have been successfully processed. The former may include those cases where a given id cannot be resolved to an existing authorizable, one that is already member or if adding the member would create a cyclic group membership. - Throws:
RepositoryException
- If one of the specified memberIds is invalid or if some other error occurs.
-
removeMember
boolean removeMember(@NotNull @NotNull Authorizable authorizable) throws RepositoryException
Remove a member from this Group.- Parameters:
authorizable
- TheAuthorizable
to be removed from the list of group members.- Returns:
- true if the Authorizable was successfully removed. False otherwise.
- Throws:
RepositoryException
- If an error occurs.
-
removeMembers
@NotNull @NotNull Set<String> removeMembers(@NotNull @NotNull String... memberIds) throws RepositoryException
Remove one or several members from this Group. Note, that an implementation may define circumstances under which this method allows to remove members that (no longer) exist. An implementation may choose to (partially) postpone validation/verification utilSession.save()
.- Parameters:
memberIds
- TheId
s of the authorizables to be removed from the members of this group.- Returns:
- a set of those
memberIds
that could not be removed or an empty set if all ids have been successfully processed. The former may include those cases where a given id cannot be resolved to an existing authorizable. - Throws:
RepositoryException
- If one of the specified memberIds is invalid or if some other error occurs.
-
-