public class GroupCache extends Object
Constructor and Description |
---|
GroupCache(DirectoryService dirService)
Creates a static group cache.
|
Modifier and Type | Method and Description |
---|---|
Set<String> |
getGroups(String memberDn)
Gets the set of groups a user is a member of.
|
void |
groupAdded(String name,
org.apache.directory.api.ldap.model.entry.Entry entry)
Adds a groups members to the cache.
|
void |
groupDeleted(org.apache.directory.api.ldap.model.name.Dn name,
org.apache.directory.api.ldap.model.entry.Entry entry)
Deletes a group's members from the cache.
|
void |
groupModified(org.apache.directory.api.ldap.model.name.Dn name,
List<org.apache.directory.api.ldap.model.entry.Modification> mods,
org.apache.directory.api.ldap.model.entry.Entry entry,
org.apache.directory.api.ldap.model.schema.SchemaManager schemaManager)
Modifies the cache to reflect changes via modify operations to the group entries.
|
void |
groupModified(org.apache.directory.api.ldap.model.name.Dn name,
org.apache.directory.api.ldap.model.entry.ModificationOperation modOp,
org.apache.directory.api.ldap.model.entry.Entry mods)
Modifies the cache to reflect changes via modify operations to the group entries.
|
boolean |
groupRenamed(org.apache.directory.api.ldap.model.name.Dn oldName,
org.apache.directory.api.ldap.model.name.Dn newName) |
boolean |
isPrincipalAnAdministrator(String principalDn)
An optimization.
|
public GroupCache(DirectoryService dirService) throws org.apache.directory.api.ldap.model.exception.LdapException
dirService
- the directory service coreorg.apache.directory.api.ldap.model.exception.LdapException
- if there are failures on initializationpublic void groupAdded(String name, org.apache.directory.api.ldap.model.entry.Entry entry) throws org.apache.directory.api.ldap.model.exception.LdapException
name
- the user provided name for the group entryentry
- the group entry's attributesorg.apache.directory.api.ldap.model.exception.LdapException
- if there are problems accessing the attr valuespublic void groupDeleted(org.apache.directory.api.ldap.model.name.Dn name, org.apache.directory.api.ldap.model.entry.Entry entry) throws org.apache.directory.api.ldap.model.exception.LdapException
name
- the normalized Dn of the group entryentry
- the attributes of entry being deletedorg.apache.directory.api.ldap.model.exception.LdapException
- If we wasn't able to delete the entry from the cachepublic void groupModified(org.apache.directory.api.ldap.model.name.Dn name, List<org.apache.directory.api.ldap.model.entry.Modification> mods, org.apache.directory.api.ldap.model.entry.Entry entry, org.apache.directory.api.ldap.model.schema.SchemaManager schemaManager) throws org.apache.directory.api.ldap.model.exception.LdapException
name
- the normalized name of the group entry modifiedmods
- the modification operations being performedentry
- the group entry being modifiedschemaManager
- The SchemaManager instanceorg.apache.directory.api.ldap.model.exception.LdapException
- if there are problems accessing attribute valuespublic void groupModified(org.apache.directory.api.ldap.model.name.Dn name, org.apache.directory.api.ldap.model.entry.ModificationOperation modOp, org.apache.directory.api.ldap.model.entry.Entry mods) throws org.apache.directory.api.ldap.model.exception.LdapException
name
- the normalized name of the group entry modifiedmodOp
- the modify operation being performedmods
- the modifications being performedorg.apache.directory.api.ldap.model.exception.LdapException
- if there are problems accessing attribute valuespublic final boolean isPrincipalAnAdministrator(String principalDn)
principalDn
- the normalized Dn of the user to check if they are an adminpublic Set<String> getGroups(String memberDn) throws org.apache.directory.api.ldap.model.exception.LdapException
memberDn
- the member (user) to get the groups fororg.apache.directory.api.ldap.model.exception.LdapException
- if there are problems accessing attribute valuespublic boolean groupRenamed(org.apache.directory.api.ldap.model.name.Dn oldName, org.apache.directory.api.ldap.model.name.Dn newName)
Copyright © 2003–2023 The Apache Software Foundation. All rights reserved.