Interface LdapSession

All Known Implementing Classes:
LdaptiveSessionImpl

public interface LdapSession
  • Method Details

    • isDebug

      boolean isDebug()
      if we are debugging
      Returns:
    • assignDebug

      void assignDebug(boolean isDebug)
      if we should capture debug info
      Parameters:
      inDiagnostics -
    • getDebugLog

      StringBuilder getDebugLog()
      debug log where lines are separated by newlines
      Returns:
    • list

      <R> List<R> list(Class<R> returnType, String ldapServerId, String searchDn, LdapSearchScope ldapSearchScope, String filter, String attributeName)
      run a filter, for one attribute, and return a list of that attribute typecast as a certain type note, if it is a multi-valued attributes, and there are multiple object results, it will be flattened into one list
      Type Parameters:
      R -
      Parameters:
      returnType - note, only String.class is currently supported
      ldapServerId -
      searchDn -
      ldapSearchScope -
      filter -
      attributeName -
      Returns:
      the list of results, never null
    • listInObjects

      <R> Map<String,List<R>> listInObjects(Class<R> returnType, String ldapServerId, String searchDn, LdapSearchScope ldapSearchScope, String filter, String attributeName)
      run a filter, for one attribute, and return a map of the DN key to the value of list of that attribute typecast as a certain type
      Type Parameters:
      R -
      Parameters:
      returnType - note, only String.class is currently supported
      ldapServerId -
      searchDn -
      ldapSearchScope -
      filter -
      attributeName -
      Returns:
      the list of results, never null
    • list

      List<LdapEntry> list(String ldapServerId, String searchDn, LdapSearchScope ldapSearchScope, String filter, String[] attributeNames, Integer sizeLimit)
      Run a filter and return the results.
      Parameters:
      ldapServerId -
      searchDn -
      ldapSearchScope -
      filter -
      attributeNames -
      sizeLimit - - null for no limit
      Returns:
      the list of results, never null
    • read

      List<LdapEntry> read(String ldapServerId, String searchDn, List<String> dnList, String[] attributeNames)
      Get the following entries.
      Parameters:
      ldapServerId -
      searchDn -
      dnList -
      attributeNames -
      Returns:
      the list of results, never null
    • delete

      void delete(String ldapServerId, String dn)
      Delete an entry if it exists.
      Parameters:
      ldapServerId -
      dn -
    • create

      boolean create(String ldapServerId, LdapEntry ldapEntry)
      Create entry. If entry exists, update attributes instead.
      Parameters:
      ldapServerId -
      ldapEntry -
      Returns:
      true if created, false if updated
    • move

      boolean move(String ldapServerId, String oldDn, String newDn)
      Move an object to a new dn. Assuming this would only be called if it's expected to work. i.e. If the ldap server doesn't allow this, the caller should avoid calling this and instead do a delete/re-create as appropriate.
      Parameters:
      ldapServerId -
      oldDn -
      newDn -
      Returns:
      true if moved, false if newDn exists and oldDn doesn't exist so no update
    • testConnection

      boolean testConnection(String ldapServerId)
      test a connection
      Parameters:
      ldapServerId -
      Returns:
      true if success, false or exception if not successful (error is in exception)
    • internal_modifyHelper

      void internal_modifyHelper(String ldapServerId, String dn, List<LdapModificationItem> ldapModificationItems)
      modify attributes for an object. this should be done in bulk, and if there is an error, throw it
      Parameters:
      ldapServerId -
      dn -
      ldapModificationItems -
      Throws:
      Exception - if problem
    • authenticate

      void authenticate(String ldapServerId, String userDn, String password)
      Authenticate a user
      Parameters:
      ldapServerId -
      userDn -
      password -
    • refreshConnectionsIfNeeded

      void refreshConnectionsIfNeeded(String ldapServerId)
      Check if connections need to be refreshed due to config changes
      Parameters:
      ldapServerId -