Class LDAPUpdateExecution

  • All Implemented Interfaces:
    Execution, UpdateExecution

    public class LDAPUpdateExecution
    extends Object
    implements UpdateExecution
    Please see the user's guide for a full description of capabilties, etc. Description/Assumptions: 1. Table's name in source defines the base DN (or context) for the search. Example: Table.NameInSource=ou=people,dc=gene,dc=com 2. Column's name in source defines the LDAP attribute name. [Default] If no name in source is defined, then we attempt to use the column name as the LDAP attribute name. 3. Since all of the underlying LDAP methods for adding/deleting/updating require specification of the LDAP distinguished name (DN) to change, for all corresponding MetaMatrix operations the DN must be specified (as the sole item in the WHERE clause for UPDATE and DELETE operations, and in the list of attributes to assign values in an INSERT operation * Responsible for update/insert/delete operations against LDAP
    • Constructor Detail

      • LDAPUpdateExecution

        public LDAPUpdateExecution​(Command command,
                                   LdapContext ldapCtx)
    • Method Detail

      • execute

        public void execute()
                     throws TranslatorException
        execute generic update-class (either an update, delete, or insert) operation and returns a count of affected rows. Since underlying LDAP operations (and this connector) can modify at most one LDAP leaf context at a time, this will always return 1. It will never actually return 0, because if an operation fails, a ConnectorException will be thrown instead. Note that really it should return 0 if a delete is performed on an entry that doesn't exist (but whose parent does exist), but since the underlying LDAP operation will return success for such a delete, we just blindly return 1. To return 0 would mean performing a search for the entry first before deleting it (to confirm that it did exist prior to the delete), so right now we sacrifice accuracy here for the sake of efficiency.
        Specified by:
        execute in interface Execution
        Throws:
        TranslatorException
      • cancel

        public void cancel()
                    throws TranslatorException
        Description copied from interface: Execution
        Cancels the execution abnormally. This will happen via a different thread from the one performing the execution, so should be expected to happen in a multi-threaded scenario.
        Specified by:
        cancel in interface Execution
        Throws:
        TranslatorException
      • close

        public void close()
        Description copied from interface: Execution
        Terminates the execution normally.
        Specified by:
        close in interface Execution