public class VirtualStaticGroup extends Group<VirtualStaticGroupImplementationCfg>
Constructor and Description |
---|
VirtualStaticGroup()
Creates a new, uninitialized virtual static group instance.
|
VirtualStaticGroup(Dn groupEntryDN,
Dn targetGroupDN)
Creates a new virtual static group instance with the provided information.
|
Modifier and Type | Method and Description |
---|---|
Filter |
getGroupDefinitionFilter()
Retrieves a search filter that may be used to identify entries containing definitions for groups of this type in
the Directory Server.
|
Dn |
getGroupDN()
Retrieves the DN of the entry that contains the definition for this group.
|
MemberList |
getMembers()
Retrieves an iterator that may be used to cursor through the entries of the members contained in this group.
|
MemberList |
getMembers(Dn baseDN,
SearchScope scope,
Filter filter)
Retrieves an iterator that may be used to cursor through the entries of the members contained in this group.
|
Set<Dn> |
getNestedGroupDNs()
Retrieves a set of the DNs of any nested groups whose members should be considered members of this group.
|
Dn |
getTargetGroupDN()
Retrieves the DN of the target group for this virtual static group.
|
void |
initializeGroupImplementation(VirtualStaticGroupImplementationCfg configuration)
Initializes a "shell" instance of this group implementation that may be used to identify and instantiate
instances of this type of group in the directory data.
|
boolean |
isGroupDefinition(Entry entry)
Indicates whether the provided entry contains a valid definition for this type of group.
|
boolean |
isMember(Dn userDN,
AtomicReference<Set<Dn>> examinedGroups)
Indicates whether the user with the specified DN is a member of this group.
|
boolean |
isMember(Entry userEntry,
AtomicReference<Set<Dn>> examinedGroups)
Indicates whether the user described by the provided user entry is a member of this group.
|
boolean |
mayAlterMemberList()
Indicates whether it is possible to alter the member list for this group (e.g., in order to add members to the
group or remove members from it).
|
VirtualStaticGroup |
newInstance(ServerContext serverContext,
Entry groupEntry)
Creates a new group of this type based on the definition contained in the provided entry.
|
void |
setGroupDN(Dn groupDN)
Sets the DN of the entry that contains the definition for this group.
|
void |
toString(StringBuilder buffer)
Appends a string representation of this group to the provided buffer.
|
void |
updateMembers(List<Modification> modifications)
Attempt to make multiple changes to the group's member list.
|
finalizeGroupImplementation, isConfigurationAcceptable, isMember, isMember, toString
public VirtualStaticGroup()
public VirtualStaticGroup(Dn groupEntryDN, Dn targetGroupDN)
groupEntryDN
- The DN of the entry that holds the definition for this group. It must not be null
.targetGroupDN
- The DN of the target group that will provide membership information. It must not be null
.public void initializeGroupImplementation(VirtualStaticGroupImplementationCfg configuration)
Group
initializeGroupImplementation
in class Group<VirtualStaticGroupImplementationCfg>
configuration
- The configuration for this group implementation.public VirtualStaticGroup newInstance(ServerContext serverContext, Entry groupEntry) throws LdapException
Group
initializeGroupImplementation
method.newInstance
in class Group<VirtualStaticGroupImplementationCfg>
serverContext
- The server context.groupEntry
- The entry containing the definition for the group to be created.LdapException
- If a problem occurs while trying to create the group instance.public Filter getGroupDefinitionFilter()
Group
initializeGroupImplementation
method.getGroupDefinitionFilter
in class Group<VirtualStaticGroupImplementationCfg>
public boolean isGroupDefinition(Entry entry)
Group
isGroupDefinition
in class Group<VirtualStaticGroupImplementationCfg>
entry
- The entry for which to make the determination.true
if the provided entry does contain a valid definition for this type of group, or
false
if it does not.public Dn getGroupDN()
Group
getGroupDN
in class Group<VirtualStaticGroupImplementationCfg>
public void setGroupDN(Dn groupDN)
Group
setGroupDN
in class Group<VirtualStaticGroupImplementationCfg>
groupDN
- The DN of the entry that contains the definition for this group.public Dn getTargetGroupDN()
public Set<Dn> getNestedGroupDNs()
Group
getNestedGroupDNs
in class Group<VirtualStaticGroupImplementationCfg>
public boolean isMember(Dn userDN, AtomicReference<Set<Dn>> examinedGroups) throws LdapException
Group
isMember
in class Group<VirtualStaticGroupImplementationCfg>
userDN
- The DN of the user for which to make the determination.examinedGroups
- A set of groups that have already been examined in the process of making the determination. This
provides a mechanism to prevent infinite recursion due to circular references (e.g., two groups
include each other as nested groups). Each time a group instance is checked, its DN should be added to
the list, and any DN already contained in the list should be skipped. The use of an atomic reference
allow to lazily create the Set to optimize memory when there is no nested groups.true
if the specified user is currently a member of this group, or false
if not.LdapException
- If a problem occurs while attempting to make the determination.public boolean isMember(Entry userEntry, AtomicReference<Set<Dn>> examinedGroups) throws LdapException
Group
isMember
in class Group<VirtualStaticGroupImplementationCfg>
userEntry
- The entry for the user for which to make the determination.examinedGroups
- A set of groups that have already been examined in the process of making the determination. This
provides a mechanism to prevent infinite recursion due to circular references (e.g., two groups
include each other as nested groups). Each time a group instance is checked, its DN should be added to
the list, and any DN already contained in the list should be skipped. The use of an atomic reference
allow to lazily create the Set to optimize memory when there is no nested groups.true
if the specified user is currently a member of this group, or false
if not.LdapException
- If a problem occurs while attempting to make the determination.public MemberList getMembers() throws LdapException
Group
getMembers
in class Group<VirtualStaticGroupImplementationCfg>
LdapException
- If a problem occurs while attempting to retrieve the set of members.public MemberList getMembers(Dn baseDN, SearchScope scope, Filter filter) throws LdapException
Group
getMembers
in class Group<VirtualStaticGroupImplementationCfg>
baseDN
- The base DN that should be used when determining whether a given entry will be returned. If this is
null
, then all entries will be considered in the scope of the criteria.scope
- The scope that should be used when determining whether a given entry will be returned. It must not be
null
if the provided base DN is not null
. The scope will be ignored if no base DN is
provided.filter
- The filter that should be used when determining whether a given entry will be returned. If this is
null
, then any entry in the scope of the criteria will be included in the results.LdapException
- If a problem occurs while attempting to retrieve the set of members.public boolean mayAlterMemberList()
Group
mayAlterMemberList
in class Group<VirtualStaticGroupImplementationCfg>
true
if it is possible to add members to this group, or false
if not.public void updateMembers(List<Modification> modifications) throws UnsupportedOperationException
Group
updateMembers
in class Group<VirtualStaticGroupImplementationCfg>
modifications
- The list of modifications being made to the group, which may include changes to non-member attributes.UnsupportedOperationException
- If this group does not support altering the member list.public void toString(StringBuilder buffer)
Group
toString
in class Group<VirtualStaticGroupImplementationCfg>
buffer
- The buffer to which the string representation should be appended.Copyright 2010-2022 ForgeRock AS.