| | |
| | | */ |
| | | package org.opends.server.api; |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | |
| | | import java.util.HashSet; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.forgerock.opendj.config.server.ConfigException; |
| | | import org.forgerock.opendj.ldap.DN; |
| | | import org.forgerock.opendj.ldap.SearchScope; |
| | | import org.forgerock.opendj.server.config.server.GroupImplementationCfg; |
| | | import org.opends.server.core.ServerContext; |
| | | import org.forgerock.opendj.config.server.ConfigException; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.forgerock.opendj.ldap.DN; |
| | | import org.opends.server.types.Entry; |
| | | import org.opends.server.types.InitializationException; |
| | | import org.opends.server.types.MemberList; |
| | | import org.opends.server.types.Modification; |
| | | import org.opends.server.types.SearchFilter; |
| | | import org.forgerock.opendj.ldap.SearchScope; |
| | | |
| | | /** |
| | | * This class defines the set of methods that must be implemented by a |
| | |
| | | public abstract void initializeGroupImplementation(T configuration) |
| | | throws ConfigException, InitializationException; |
| | | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether the provided configuration is acceptable for |
| | | * this group implementation. It should be possible to call this |
| | |
| | | return true; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Performs any necessary finalization that may be needed whenever |
| | | * this group implementation is taken out of service within the |
| | |
| | | // No implementation is required by default. |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates a new group of this type based on the definition |
| | | * contained in the provided entry. This method must be designed so |
| | |
| | | public abstract Group<T> newInstance(ServerContext serverContext, Entry groupEntry) |
| | | throws DirectoryException; |
| | | |
| | | |
| | | |
| | | /** |
| | | * Retrieves a search filter that may be used to identify entries |
| | | * containing definitions for groups of this type in the Directory |
| | |
| | | public abstract SearchFilter getGroupDefinitionFilter() |
| | | throws DirectoryException; |
| | | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether the provided entry contains a valid definition |
| | | * for this type of group. |
| | |
| | | */ |
| | | public abstract boolean isGroupDefinition(Entry entry); |
| | | |
| | | |
| | | |
| | | /** |
| | | * Retrieves the DN of the entry that contains the definition for |
| | | * this group. |
| | |
| | | */ |
| | | public abstract DN getGroupDN(); |
| | | |
| | | |
| | | |
| | | /** |
| | | * Sets the DN of the entry that contains the definition for |
| | | * this group. |
| | |
| | | */ |
| | | public abstract void setGroupDN(DN groupDN); |
| | | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether this group supports nesting other groups, such |
| | | * that the members of the nested groups will also be considered |
| | |
| | | */ |
| | | public abstract boolean supportsNestedGroups(); |
| | | |
| | | |
| | | |
| | | /** |
| | | * Retrieves a list of the DNs of any nested groups whose members |
| | | * should be considered members of this group. |
| | |
| | | */ |
| | | public abstract List<DN> getNestedGroupDNs(); |
| | | |
| | | |
| | | |
| | | /** |
| | | * Attempts to add the provided group DN as a nested group within |
| | | * this group. The change should be committed to persistent storage |
| | |
| | | public abstract void addNestedGroup(DN nestedGroupDN) |
| | | throws UnsupportedOperationException, DirectoryException; |
| | | |
| | | |
| | | |
| | | /** |
| | | * Attempts to remove the provided group as a nested group within |
| | | * this group. The change should be committed to persistent storage |
| | |
| | | public abstract void removeNestedGroup(DN nestedGroupDN) |
| | | throws UnsupportedOperationException, DirectoryException; |
| | | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether the user with the specified DN is a member of |
| | | * this group. Note that this is a point-in-time determination and |
| | |
| | | return userDN != null && isMember(userDN, new HashSet<DN>()); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether the user with the specified DN is a member of |
| | | * this group. Note that this is a point-in-time determination and |
| | |
| | | public abstract boolean isMember(DN userDN, Set<DN> examinedGroups) |
| | | throws DirectoryException; |
| | | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether the user described by the provided user entry |
| | | * is a member of this group. Note that this is a point-in-time |
| | |
| | | return isMember(userEntry, new HashSet<DN>()); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether the user described by the provided user entry |
| | | * is a member of this group. Note that this is a point-in-time |
| | |
| | | Set<DN> examinedGroups) |
| | | throws DirectoryException; |
| | | |
| | | |
| | | |
| | | /** |
| | | * Retrieves an iterator that may be used to cursor through the |
| | | * entries of the members contained in this group. Note that this |
| | |
| | | return getMembers(null, null, null); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Retrieves an iterator that may be used to cursor through the |
| | | * entries of the members contained in this group. It may |
| | |
| | | SearchFilter filter) |
| | | throws DirectoryException; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 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 |
| | |
| | | */ |
| | | public abstract boolean mayAlterMemberList(); |
| | | |
| | | |
| | | |
| | | /** |
| | | * Attempt to make multiple changes to the group's member list. |
| | | * |
| | |
| | | public abstract void updateMembers(List<Modification> modifications) |
| | | throws UnsupportedOperationException, DirectoryException; |
| | | |
| | | |
| | | |
| | | /** |
| | | * Attempts to add the provided user as a member of this group. The |
| | | * change should be committed to persistent storage through an |
| | |
| | | public abstract void addMember(Entry userEntry) |
| | | throws UnsupportedOperationException, DirectoryException; |
| | | |
| | | |
| | | |
| | | /** |
| | | * Attempts to remove the specified user as a member of this group. |
| | | * The change should be committed to persistent storage through an |
| | |
| | | public abstract void removeMember(DN userDN) |
| | | throws UnsupportedOperationException, DirectoryException; |
| | | |
| | | |
| | | |
| | | /** |
| | | * Retrieves a string representation of this group. |
| | | * |
| | | * @return A string representation of this group. |
| | | */ |
| | | @Override |
| | | public String toString() |
| | | { |
| | | StringBuilder buffer = new StringBuilder(); |
| | |
| | | return buffer.toString(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Appends a string representation of this group to the provided |
| | | * buffer. |
| | |
| | | */ |
| | | public abstract void toString(StringBuilder buffer); |
| | | } |
| | | |