Package org.teiid.translator.ldap
Class LDAPUpdateExecution
- java.lang.Object
-
- org.teiid.translator.ldap.LDAPUpdateExecution
-
- All Implemented Interfaces:
org.teiid.translator.Execution,org.teiid.translator.UpdateExecution
public class LDAPUpdateExecution extends Object implements org.teiid.translator.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 Summary
Constructors Constructor Description LDAPUpdateExecution(org.teiid.language.Command command, LdapContext ldapCtx)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcancel()voidclose()voidexecute()execute generic update-class (either an update, delete, or insert) operation and returns a count of affected rows.int[]getUpdateCounts()
-
-
-
Constructor Detail
-
LDAPUpdateExecution
public LDAPUpdateExecution(org.teiid.language.Command command, LdapContext ldapCtx)
-
-
Method Detail
-
execute
public void execute() throws org.teiid.translator.TranslatorExceptionexecute 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:
executein interfaceorg.teiid.translator.Execution- Throws:
org.teiid.translator.TranslatorException
-
getUpdateCounts
public int[] getUpdateCounts() throws org.teiid.translator.DataNotAvailableException, org.teiid.translator.TranslatorException- Specified by:
getUpdateCountsin interfaceorg.teiid.translator.UpdateExecution- Throws:
org.teiid.translator.DataNotAvailableExceptionorg.teiid.translator.TranslatorException
-
cancel
public void cancel() throws org.teiid.translator.TranslatorException- Specified by:
cancelin interfaceorg.teiid.translator.Execution- Throws:
org.teiid.translator.TranslatorException
-
close
public void close()
- Specified by:
closein interfaceorg.teiid.translator.Execution
-
-