public class LDAPOperationManager extends Object
This class provides a set of operations to manage LDAP trees.
A different LdapContext is used to perform authentication. The reason is that while managing the ldap tree
information bindings are not allowed. Also, instead of creating a new LdapContext each time we reuse it.
| Constructor and Description |
|---|
LDAPOperationManager(LDAPIdentityStoreConfiguration config) |
| Modifier and Type | Method and Description |
|---|---|
void |
addAttribute(String dn,
Attribute attribute)
Adds the given
Attribute instance using the given DN. |
boolean |
authenticate(String dn,
String password)
Performs a simple authentication using the ginve DN and password to bind to the authentication context.
|
boolean |
checkAttributePresence(String attributeName)
Ask the ldap server for the schema for the attribute.
|
void |
createSubContext(String name,
Attributes attributes) |
String |
decodeEntryUUID(Object entryUUID) |
void |
destroySubcontext(String dn)
Destroys a subcontext with the given DN from the LDAP tree.
|
Attributes |
getAttributes(String entryUUID,
String baseDN,
LDAPMappingConfiguration mappingConfiguration) |
String |
getFilterById(String baseDN,
String id) |
boolean |
isManagedAttribute(String attributeName)
Checks if the attribute with the given name is a managed attributes.
|
<T> T |
lookup(String dn)
Looks up a entry on the LDAP tree with the given DN.
|
NamingEnumeration<SearchResult> |
lookupById(String baseDN,
String id,
LDAPMappingConfiguration mappingConfiguration) |
void |
modifyAttribute(String dn,
Attribute attribute)
Modifies the given
Attribute instance using the given DN. |
void |
removeAttribute(String dn,
Attribute attribute)
Removes the given
Attribute instance using the given DN. |
<T> List<T> |
removeEntryById(String baseDN,
String id)
Searches the LDAP tree.
|
NamingEnumeration<SearchResult> |
search(String baseDN,
String filter,
LDAPMappingConfiguration mappingConfiguration) |
public LDAPOperationManager(LDAPIdentityStoreConfiguration config) throws NamingException
NamingExceptionpublic void modifyAttribute(String dn, Attribute attribute)
Modifies the given Attribute instance using the given DN. This method performs a REPLACE_ATTRIBUTE
operation.
dn - attribute - public void removeAttribute(String dn, Attribute attribute)
Removes the given Attribute instance using the given DN. This method performs a REMOVE_ATTRIBUTE
operation.
dn - attribute - public void addAttribute(String dn, Attribute attribute)
Adds the given Attribute instance using the given DN. This method performs a ADD_ATTRIBUTE operation.
dn - attribute - public <T> T lookup(String dn)
Looks up a entry on the LDAP tree with the given DN.
dn - NamingExceptionpublic <T> List<T> removeEntryById(String baseDN, String id)
Searches the LDAP tree.
baseDN - attributesToSearch - public NamingEnumeration<SearchResult> search(String baseDN, String filter, LDAPMappingConfiguration mappingConfiguration) throws NamingException
NamingExceptionpublic NamingEnumeration<SearchResult> lookupById(String baseDN, String id, LDAPMappingConfiguration mappingConfiguration)
public void destroySubcontext(String dn)
Destroys a subcontext with the given DN from the LDAP tree.
dn - public boolean isManagedAttribute(String attributeName)
Checks if the attribute with the given name is a managed attributes. Managed attributes are the ones defined in the underlying schema or those defined in the managed attribute list.
attributeName - public boolean checkAttributePresence(String attributeName)
Ask the ldap server for the schema for the attribute.
attributeName - public boolean authenticate(String dn, String password)
Performs a simple authentication using the ginve DN and password to bind to the authentication context.
dn - password - public void createSubContext(String name, Attributes attributes)
public Attributes getAttributes(String entryUUID, String baseDN, LDAPMappingConfiguration mappingConfiguration)
Copyright © 2014. All Rights Reserved.