Class FilterBasedLdapUserSearch

java.lang.Object
com.codename1.backend.security.ldap.FilterBasedLdapUserSearch
All Implemented Interfaces:
LdapUserSearch

public final class FilterBasedLdapUserSearch extends Object implements LdapUserSearch

Finds a user by a filter under a search base, with the user name in place of {0} -- escaped, so a name of * or x)(uid=* matches only itself.

new FilterBasedLdapUserSearch("ou=people", "(uid={0})", contextSource)
  • Constructor Details

    • FilterBasedLdapUserSearch

      public FilterBasedLdapUserSearch(String searchBase, String searchFilter, LdapContextSource contextSource)
      Parameters:
      searchBase - relative to the context source's base; empty for the base itself
  • Method Details

    • setSearchSubtree

      public void setSearchSubtree(boolean searchSubtree)
      Whether to look below the search base too; true by default, as Spring's.
    • setReturningAttributes

      public void setReturningAttributes(String... attributes)
      The attributes to read; all by default.
    • setSearchTimeLimit

      public void setSearchTimeLimit(int seconds)
    • searchForUser

      public LdapEntry searchForUser(String username) throws IOException
      Description copied from interface: LdapUserSearch
      The user's entry, or null when there is none.
      Specified by:
      searchForUser in interface LdapUserSearch
      Throws:
      IOException - when the directory cannot be asked, or several entries match