org.keycloak.storage.ldap.idm.query.internal

## Class LDAPQuery

- java.lang.Object
- - org.keycloak.storage.ldap.idm.query.internal.LDAPQuery

- All Implemented Interfaces:
    AutoCloseable

      public class LDAPQuery
      extends Object
      implements AutoCloseable

  Default IdentityQuery implementation. LDAPQuery should be closed after use in case that pagination was used (initPagination was called) Closing LDAPQuery is very important in case ldapContextManager contains VaultSecret
  Author:
    Shane Bryzak

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `LDAPQuery.PaginationContext`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `LDAPQuery(LDAPStorageProvider ldapProvider)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `LDAPQuery` | `addMappers(Collection<ComponentModel> mappers)`
    `LDAPQuery` | `addObjectClasses(Collection<String> objectClasses)`
    `LDAPQuery` | `addReturningLdapAttribute(String ldapAttributeName)`
    `LDAPQuery` | `addReturningReadOnlyLdapAttribute(String ldapAttributeName)`
    `LDAPQuery` | `addWhereCondition(Condition... condition)`
    `void` | `close()`
    `Set<Condition>` | `getConditions()`
    `LDAPObject` | `getFirstResult()`
    `LDAPStorageProvider` | `getLdapProvider()`
    `int` | `getLimit()`
    `List<ComponentModel>` | `getMappers()`
    `Set<String>` | `getObjectClasses()`
    `int` | `getOffset()`
    `LDAPQuery.PaginationContext` | `getPaginationContext()`
    `int` | `getResultCount()`
    `List<LDAPObject>` | `getResultList()`
    `Set<String>` | `getReturningLdapAttributes()`
    `Set<String>` | `getReturningReadOnlyLdapAttributes()`
    `String` | `getSearchDn()`
    `int` | `getSearchScope()`
    `Set<Sort>` | `getSorting()`
    `LDAPQuery` | `initPagination()`
    `LDAPQuery` | `setLimit(int limit)`
    `LDAPQuery` | `setOffset(int offset)`
    `LDAPQuery` | `setSearchDn(String searchDn)`
    `LDAPQuery` | `setSearchScope(int searchScope)`
    `LDAPQuery` | `sortBy(Sort... sorts)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### LDAPQuery

          public LDAPQuery(LDAPStorageProvider ldapProvider)

  - ### Method Detail

    - #### addWhereCondition

          public LDAPQuery addWhereCondition(Condition... condition)

    - #### sortBy

          public LDAPQuery sortBy(Sort... sorts)

    - #### setSearchDn

          public LDAPQuery setSearchDn(String searchDn)

    - #### addObjectClasses

          public LDAPQuery addObjectClasses(Collection<String> objectClasses)

    - #### addReturningLdapAttribute

          public LDAPQuery addReturningLdapAttribute(String ldapAttributeName)

    - #### addReturningReadOnlyLdapAttribute

          public LDAPQuery addReturningReadOnlyLdapAttribute(String ldapAttributeName)

    - #### addMappers

          public LDAPQuery addMappers(Collection<ComponentModel> mappers)

    - #### setSearchScope

          public LDAPQuery setSearchScope(int searchScope)

    - #### getSorting

          public Set<Sort> getSorting()

    - #### getSearchDn

          public String getSearchDn()

    - #### getObjectClasses

          public Set<String> getObjectClasses()

    - #### getReturningLdapAttributes

          public Set<String> getReturningLdapAttributes()

    - #### getReturningReadOnlyLdapAttributes

          public Set<String> getReturningReadOnlyLdapAttributes()

    - #### getMappers

          public List<ComponentModel> getMappers()

    - #### getSearchScope

          public int getSearchScope()

    - #### getLimit

          public int getLimit()

    - #### getOffset

          public int getOffset()

    - #### getPaginationContext

          public LDAPQuery.PaginationContext getPaginationContext()

    - #### getResultList

          public List<LDAPObject> getResultList()

    - #### getFirstResult

          public LDAPObject getFirstResult()

    - #### getResultCount

          public int getResultCount()

    - #### setOffset

          public LDAPQuery setOffset(int offset)

    - #### setLimit

          public LDAPQuery setLimit(int limit)

    - #### initPagination

          public LDAPQuery initPagination()
                                   throws NamingException

      Throws:
        `NamingException`

    - #### getConditions

          public Set<Condition> getConditions()

    - #### getLdapProvider

          public LDAPStorageProvider getLdapProvider()

    - #### close

          public void close()

      Specified by:
        `close` in interface `AutoCloseable`

Copyright © 2021 JBoss by Red Hat. All rights reserved.