Class LDAPOperationManager
java.lang.Object
org.keycloak.storage.ldap.idm.store.ldap.LDAPOperationManager
This class provides a set of operations to manage LDAP trees.
- Author:
- Anil Saldhana, Pedro Silva
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAttribute(String dn, Attribute attribute) Adds the givenAttributeinstance using the given DN.voidauthenticate(String dn, String password) Performs a simple authentication using the given DN and password to bind to the authentication context.voidcreateSubContext(String name, Attributes attributes) decodeEntryUUID(Object entryUUID) getAttributes(String entryUUID, String baseDN, Set<String> returningAttributes) getFilterById(String id) lookupById(String baseDN, String id, Collection<String> returningAttributes) voidmodifyAttribute(String dn, Attribute attribute) Modifies the givenAttributeinstance using the given DN.voidmodifyAttributes(String dn, ModificationItem[] mods, LDAPOperationDecorator decorator) voidmodifyAttributes(String dn, NamingEnumeration<Attribute> attributes) Modifies the givenAttributeinstances using the given DN.voidmodifyAttributesNaming(String dn, ModificationItem[] mods, LDAPOperationDecorator decorator) voidpasswordModifyExtended(String dn, String password, LDAPOperationDecorator decorator) Execute the LDAP Password Modify Extended Operation to update the password for the given DN.voidremoveAttribute(String dn, Attribute attribute) Removes the givenAttributeinstance using the given DN.voidremoveEntry(String entryDn) Removes the object from the LDAP treerenameEntry(String oldDn, String newDn, boolean fallback) Rename LDAPObject name (DN)search(String baseDN, String filter, Collection<String> returningAttributes, int searchScope) searchPaginated(String baseDN, String filter, LDAPQuery identityQuery)
-
Constructor Details
-
LDAPOperationManager
-
-
Method Details
-
modifyAttribute
Modifies the given
Attributeinstance using the given DN. This method performs a REPLACE_ATTRIBUTE operation.- Parameters:
dn-attribute-
-
modifyAttributes
Modifies the given
Attributeinstances using the given DN. This method performs a REPLACE_ATTRIBUTE operation.- Parameters:
dn-attributes-
-
removeAttribute
Removes the given
Attributeinstance using the given DN. This method performs a REMOVE_ATTRIBUTE operation.- Parameters:
dn-attribute-
-
addAttribute
Adds the given
Attributeinstance using the given DN. This method performs a ADD_ATTRIBUTE operation.- Parameters:
dn-attribute-
-
removeEntry
Removes the object from the LDAP tree
-
renameEntry
Rename LDAPObject name (DN)- Parameters:
oldDn-newDn-fallback- With fallback=true, we will try to find the another DN in case of conflict. For example if there is an attempt to rename to "CN=John Doe", but there is already existing "CN=John Doe", we will try "CN=John Doe0"- Returns:
- the non-conflicting DN, which was used in the end
-
search
public List<SearchResult> search(String baseDN, String filter, Collection<String> returningAttributes, int searchScope) throws NamingException - Throws:
NamingException
-
searchPaginated
public List<SearchResult> searchPaginated(String baseDN, String filter, LDAPQuery identityQuery) throws NamingException - Throws:
NamingException
-
getFilterById
-
lookupById
-
authenticate
Performs a simple authentication using the given DN and password to bind to the authentication context.
- Parameters:
dn-password-- Throws:
AuthenticationException- if authentication is not successful
-
modifyAttributesNaming
public void modifyAttributesNaming(String dn, ModificationItem[] mods, LDAPOperationDecorator decorator) throws NamingException - Throws:
NamingException
-
modifyAttributes
-
createSubContext
-
getAttributes
-
decodeEntryUUID
-
passwordModifyExtended
Execute the LDAP Password Modify Extended Operation to update the password for the given DN.- Parameters:
dn- distinguished name of the entry.password- the new password.decorator- A decorator to apply to the ldap operation.
-