public class StaticGroup extends Group<org.forgerock.opendj.server.config.server.StaticGroupImplementationCfg>
There are three variants of static groups:
groupOfNames
object class: which stores the
member list in the member
attributegroupOfEntries
object class, which also stores
the member list in the member
attributegroupOfUniqueNames
object class, which stores
the member list in the uniqueMember
attribute.Constructor and Description |
---|
StaticGroup()
Creates an uninitialized static group.
|
Modifier and Type | Method and Description |
---|---|
void |
addMember(Entry userEntry)
Attempts to add the provided user as a member of this group.
|
void |
addNestedGroup(org.forgerock.opendj.ldap.Dn nestedGroupDN)
Attempts to add the provided group DN as a nested group within
this group.
|
SearchFilter |
getGroupDefinitionFilter()
Retrieves a search filter that may be used to identify entries
containing definitions for groups of this type in the Directory
Server.
|
org.forgerock.opendj.ldap.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(org.forgerock.opendj.ldap.Dn baseDN,
org.forgerock.opendj.ldap.SearchScope scope,
SearchFilter filter)
Retrieves an iterator that may be used to cursor through the
entries of the members contained in this group.
|
List<org.forgerock.opendj.ldap.Dn> |
getNestedGroupDNs()
Retrieves a list of the DNs of any nested groups whose members
should be considered members of this group.
|
void |
initializeGroupImplementation(org.forgerock.opendj.server.config.server.StaticGroupImplementationCfg 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(org.forgerock.opendj.ldap.Dn userDN,
AtomicReference<Set<org.forgerock.opendj.ldap.Dn>> examinedGroups)
Indicates whether the user with the specified DN is a member of
this group.
|
boolean |
isMember(Entry userEntry,
AtomicReference<Set<org.forgerock.opendj.ldap.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).
|
StaticGroup |
newInstance(ServerContext serverContext,
Entry groupEntry)
Creates a new group of this type based on the definition
contained in the provided entry.
|
void |
removeMember(org.forgerock.opendj.ldap.Dn userDN)
Attempts to remove the specified user as a member of this group.
|
void |
removeNestedGroup(org.forgerock.opendj.ldap.Dn nestedGroupDN)
Attempts to remove the provided group as a nested group within
this group.
|
void |
setGroupDN(org.forgerock.opendj.ldap.Dn groupDN)
Sets the DN of the entry that contains the definition for
this group.
|
boolean |
supportsNestedGroups()
Indicates whether this group supports nesting other groups, such
that the members of the nested groups will also be considered
members of 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 StaticGroup()
GroupManager
to dynamically create a group.public void initializeGroupImplementation(org.forgerock.opendj.server.config.server.StaticGroupImplementationCfg configuration) throws org.forgerock.opendj.config.server.ConfigException, InitializationException
Group
initializeGroupImplementation
in class Group<org.forgerock.opendj.server.config.server.StaticGroupImplementationCfg>
configuration
- The configuration for this group
implementation.org.forgerock.opendj.config.server.ConfigException
- If there is a problem with the provided
configuration entry.InitializationException
- If a problem occurs while
attempting to initialize this
group implementation that is
not related to the server
configuration.public StaticGroup newInstance(ServerContext serverContext, Entry groupEntry) throws DirectoryException
Group
initializeGroupImplementation
method.newInstance
in class Group<org.forgerock.opendj.server.config.server.StaticGroupImplementationCfg>
serverContext
- The server context.groupEntry
- The entry containing the definition for the
group to be created.DirectoryException
- If a problem occurs while trying to
create the group instance.public SearchFilter getGroupDefinitionFilter() throws DirectoryException
Group
initializeGroupImplementation
method.getGroupDefinitionFilter
in class Group<org.forgerock.opendj.server.config.server.StaticGroupImplementationCfg>
DirectoryException
- If a problem occurs while trying to
locate all of the applicable group
definition entries.public boolean isGroupDefinition(Entry entry)
Group
isGroupDefinition
in class Group<org.forgerock.opendj.server.config.server.StaticGroupImplementationCfg>
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 org.forgerock.opendj.ldap.Dn getGroupDN()
Group
getGroupDN
in class Group<org.forgerock.opendj.server.config.server.StaticGroupImplementationCfg>
public void setGroupDN(org.forgerock.opendj.ldap.Dn groupDN)
Group
setGroupDN
in class Group<org.forgerock.opendj.server.config.server.StaticGroupImplementationCfg>
groupDN
- The DN of the entry that contains the
definition for this group.public boolean supportsNestedGroups()
Group
supportsNestedGroups
in class Group<org.forgerock.opendj.server.config.server.StaticGroupImplementationCfg>
true
if this group supports nesting other
groups, or false
if it does not.public List<org.forgerock.opendj.ldap.Dn> getNestedGroupDNs()
Group
getNestedGroupDNs
in class Group<org.forgerock.opendj.server.config.server.StaticGroupImplementationCfg>
public void addNestedGroup(org.forgerock.opendj.ldap.Dn nestedGroupDN) throws UnsupportedOperationException, DirectoryException
Group
addNestedGroup
in class Group<org.forgerock.opendj.server.config.server.StaticGroupImplementationCfg>
nestedGroupDN
- The DN of the group that should be added
to the set of nested groups for this
group.UnsupportedOperationException
- If this group does not
support nesting.DirectoryException
- If a problem occurs while attempting
to nest the provided group DN.public void removeNestedGroup(org.forgerock.opendj.ldap.Dn nestedGroupDN) throws UnsupportedOperationException, DirectoryException
Group
removeNestedGroup
in class Group<org.forgerock.opendj.server.config.server.StaticGroupImplementationCfg>
nestedGroupDN
- The DN of the group that should be removed
from the set of nested groups for this
group.UnsupportedOperationException
- If this group does not
support nesting.DirectoryException
- If a problem occurs while attempting
to nest the provided group DN.public boolean isMember(org.forgerock.opendj.ldap.Dn userDN, AtomicReference<Set<org.forgerock.opendj.ldap.Dn>> examinedGroups) throws DirectoryException
Group
isMember
in class Group<org.forgerock.opendj.server.config.server.StaticGroupImplementationCfg>
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.DirectoryException
- If a problem occurs while attempting
to make the determination.public boolean isMember(Entry userEntry, AtomicReference<Set<org.forgerock.opendj.ldap.Dn>> examinedGroups) throws DirectoryException
Group
isMember
in class Group<org.forgerock.opendj.server.config.server.StaticGroupImplementationCfg>
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.DirectoryException
- If a problem occurs while attempting
to make the determination.public MemberList getMembers() throws DirectoryException
Group
getMembers
in class Group<org.forgerock.opendj.server.config.server.StaticGroupImplementationCfg>
DirectoryException
- If a problem occurs while attempting
to retrieve the set of members.public MemberList getMembers(org.forgerock.opendj.ldap.Dn baseDN, org.forgerock.opendj.ldap.SearchScope scope, SearchFilter filter) throws DirectoryException
Group
getMembers
in class Group<org.forgerock.opendj.server.config.server.StaticGroupImplementationCfg>
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.DirectoryException
- If a problem occurs while attempting
to retrieve the set of members.public boolean mayAlterMemberList()
Group
mayAlterMemberList
in class Group<org.forgerock.opendj.server.config.server.StaticGroupImplementationCfg>
true
if it is possible to add members to this
group, or false
if not.public void updateMembers(List<Modification> modifications) throws UnsupportedOperationException, DirectoryException
Group
updateMembers
in class Group<org.forgerock.opendj.server.config.server.StaticGroupImplementationCfg>
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.DirectoryException
- If a problem occurs while attempting to
update the members.public void addMember(Entry userEntry) throws UnsupportedOperationException, DirectoryException
Group
addMember
in class Group<org.forgerock.opendj.server.config.server.StaticGroupImplementationCfg>
userEntry
- The entry for the user to be added as a member
of this group.UnsupportedOperationException
- If this group does not
support altering the
member list.DirectoryException
- If a problem occurs while attempting
to add the provided user as a member
of this group.public void removeMember(org.forgerock.opendj.ldap.Dn userDN) throws UnsupportedOperationException, DirectoryException
Group
removeMember
in class Group<org.forgerock.opendj.server.config.server.StaticGroupImplementationCfg>
userDN
- The DN of the user to remove as a member of this
group.UnsupportedOperationException
- If this group does not
support altering the
member list.DirectoryException
- If a problem occurs while attempting
to remove the provided user as a
member of this group.public void toString(StringBuilder buffer)
Group
Copyright © 2010-2017 ForgeRock AS. All Rights Reserved.