Class LDAPConnection


  • public class LDAPConnection
    extends Object
    • Constructor Detail

      • LDAPConnection

        public LDAPConnection​(org.pentaho.di.core.logging.LogChannelInterface logInterface,
                              org.pentaho.di.core.variables.VariableSpace variableSpace,
                              LdapMeta meta,
                              Collection<String> binaryAttributes)
                       throws org.pentaho.di.core.exception.KettleException
        Construct a new LDAP Connection
        Throws:
        org.pentaho.di.core.exception.KettleException
    • Method Detail

      • connect

        public void connect()
                     throws org.pentaho.di.core.exception.KettleException
        Connect to LDAP server
        Throws:
        org.pentaho.di.core.exception.KettleException
      • connect

        public void connect​(String username,
                            String password)
                     throws org.pentaho.di.core.exception.KettleException
        Connect to LDAP server
        Parameters:
        username - : username
        password - : password
        Throws:
        org.pentaho.di.core.exception.KettleException
      • setSortingAttributesKeys

        public void setSortingAttributesKeys​(String[] value)
      • addSortingAttributes

        public void addSortingAttributes​(String value)
      • getSortingAttributes

        public List<String> getSortingAttributes()
      • setTimeLimit

        public void setTimeLimit​(int timeLimit)
      • getTimeLimit

        public int getTimeLimit()
      • SetPagingSize

        public void SetPagingSize​(int value)
      • search

        public void search​(String searchBase,
                           String filter,
                           int limitRows,
                           String[] attributeReturned,
                           int searchScope)
                    throws org.pentaho.di.core.exception.KettleException
        Throws:
        org.pentaho.di.core.exception.KettleException
      • delete

        public int delete​(String dn,
                          boolean checkEntry)
                   throws org.pentaho.di.core.exception.KettleException
        Throws:
        org.pentaho.di.core.exception.KettleException
      • update

        public int update​(String dn,
                          String[] attributes,
                          String[] values,
                          boolean checkEntry)
                   throws org.pentaho.di.core.exception.KettleException
        Throws:
        org.pentaho.di.core.exception.KettleException
      • add

        public int add​(String dn,
                       String[] attributes,
                       String[] values,
                       String multValuedSeparator,
                       boolean checkEntry)
                throws org.pentaho.di.core.exception.KettleException
        Throws:
        org.pentaho.di.core.exception.KettleException
      • insert

        public void insert​(String dn,
                           String[] attributes,
                           String[] values,
                           String multValuedSeparator)
                    throws org.pentaho.di.core.exception.KettleException
        Insert record in LDAP based on DN
        Parameters:
        dn - : Distinguished Name (Key for lookup)
        attributes - : contains all the attributes to set for insert
        values - : contains all the values for attributes
        multValuedSeparator - : multi-valued attributes separator
        Throws:
        org.pentaho.di.core.exception.KettleException
      • upsert

        public int upsert​(String dn,
                          String[] attributes,
                          String[] values,
                          String[] attributesToUpdate,
                          String[] valuesToUpdate,
                          String multValuedSeparator)
                   throws org.pentaho.di.core.exception.KettleException
        Upsert record in LDAP First we will check if the entry exist based on DN If we can not find it, we will create it otherwise, we will perform an update
        Parameters:
        dn - : Distinguished Name (Key for lookup)
        attributes - : contains all the attributes to set for insert
        values - : contains all the values for attributes
        attributesToUpdate - : contains attributes to update
        valuesToUpdate - : contains values for attributes to update
        multValuedSeparator - : multi-valued attributes separator
        Returns:
        status : STATUS_INSERTED, STATUS_UPDATED or STATUS_SKIPPED
        Throws:
        org.pentaho.di.core.exception.KettleException
      • rename

        public void rename​(String oldDn,
                           String newDn,
                           boolean deleteRDN)
                    throws org.pentaho.di.core.exception.KettleException
        Rename an entry
        Parameters:
        oldDn - Distinguished name of the entry to rename
        newDn - target Distinguished name (new)
        deleteRDN - To specify whether you want to keep the old name attribute when you use rename entry true : do not keep the old value (defaut) false : keep the old value as an attribute
        Throws:
        org.pentaho.di.core.exception.KettleException
      • close

        public void close()
                   throws org.pentaho.di.core.exception.KettleException
        Close the LDAP connection
        Throws:
        org.pentaho.di.core.exception.KettleException
      • getAttributes

        public Attributes getAttributes()
                                 throws org.pentaho.di.core.exception.KettleException
        Throws:
        org.pentaho.di.core.exception.KettleException
      • getFields

        public org.pentaho.di.core.row.RowMeta getFields​(String searchBase)
                                                  throws org.pentaho.di.core.exception.KettleException
        Throws:
        org.pentaho.di.core.exception.KettleException