Class LdapMapOperationManager
- java.lang.Object
- 
- org.keycloak.models.map.storage.ldap.store.LdapMapOperationManager
 
- 
- All Implemented Interfaces:
- AutoCloseable
 
 public class LdapMapOperationManager extends Object implements AutoCloseable This class provides a set of operations to manage LDAP trees. - Author:
- Anil Saldhana, Pedro Silva
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static interfaceLdapMapOperationManager.LdapOperation<R>
 - 
Constructor SummaryConstructors Constructor Description LdapMapOperationManager(KeycloakSession session, LdapMapConfig config)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAttribute(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.voidclose()voidcreateSubContext(String name, Attributes attributes)StringdecodeEntryUUID(Object entryUUID)AttributesgetAttributes(String entryUUID, String baseDN, Set<String> returningAttributes)StringgetFilterById(String id)SearchResultlookupById(String baseDN, String id, Collection<String> returningAttributes)voidmodifyAttribute(String dn, Attribute attribute)Modifies the givenAttributeinstance using the given DN.voidmodifyAttributes(String dn, ModificationItem[] mods, LdapMapOperationDecorator decorator)voidmodifyAttributes(String dn, NamingEnumeration<Attribute> attributes)Modifies the givenAttributeinstances using the given DN.voidmodifyAttributesNaming(String dn, ModificationItem[] mods, LdapMapOperationDecorator decorator)voidremoveAttribute(String dn, Attribute attribute)Removes the givenAttributeinstance using the given DN.voidremoveEntry(String entryDn)Removes the object from the LDAP treeStringrenameEntry(String oldDn, String newDn, boolean fallback)Rename LDAPObject name (DN)List<SearchResult>search(String baseDN, String filter, Collection<String> returningAttributes, int searchScope)
 
- 
- 
- 
Constructor Detail- 
LdapMapOperationManagerpublic LdapMapOperationManager(KeycloakSession session, LdapMapConfig config) 
 
- 
 - 
Method Detail- 
modifyAttributepublic void modifyAttribute(String dn, Attribute attribute) Modifies the given Attributeinstance using the given DN. This method performs a REPLACE_ATTRIBUTE operation.
 - 
modifyAttributespublic void modifyAttributes(String dn, NamingEnumeration<Attribute> attributes) Modifies the given Attributeinstances using the given DN. This method performs a REPLACE_ATTRIBUTE operation.
 - 
removeAttributepublic void removeAttribute(String dn, Attribute attribute) Removes the given Attributeinstance using the given DN. This method performs a REMOVE_ATTRIBUTE operation.
 - 
addAttributepublic void addAttribute(String dn, Attribute attribute) Adds the given Attributeinstance using the given DN. This method performs a ADD_ATTRIBUTE operation.
 - 
removeEntrypublic void removeEntry(String entryDn) Removes the object from the LDAP tree 
 - 
renameEntrypublic String renameEntry(String oldDn, String newDn, boolean fallback) Rename LDAPObject name (DN)- Parameters:
- 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
 
 - 
searchpublic List<SearchResult> search(String baseDN, String filter, Collection<String> returningAttributes, int searchScope) throws NamingException - Throws:
- NamingException
 
 - 
lookupByIdpublic SearchResult lookupById(String baseDN, String id, Collection<String> returningAttributes) 
 - 
authenticatepublic void authenticate(String dn, String password) throws AuthenticationException Performs a simple authentication using the given DN and password to bind to the authentication context. - Throws:
- AuthenticationException- if authentication is not successful
 
 - 
modifyAttributesNamingpublic void modifyAttributesNaming(String dn, ModificationItem[] mods, LdapMapOperationDecorator decorator) throws NamingException - Throws:
- NamingException
 
 - 
modifyAttributespublic void modifyAttributes(String dn, ModificationItem[] mods, LdapMapOperationDecorator decorator) 
 - 
createSubContextpublic void createSubContext(String name, Attributes attributes) 
 - 
getAttributespublic Attributes getAttributes(String entryUUID, String baseDN, Set<String> returningAttributes) 
 - 
closepublic void close() - Specified by:
- closein interface- AutoCloseable
 
 
- 
 
-