12.20. LDAP Translator
12.20.1. LDAP Translator Copy linkLink copied to clipboard!
org.teiid.translator.ldap.LDAPExecutionFactory class and known by the translator type name ldap.
Note
ldap data source in the JBoss EAP instance. See the Red Hat JBoss Data Virtualization Administration and Configuration Guide for more configuration information.
12.20.2. LDAP Translator: Execution Properties Copy linkLink copied to clipboard!
| Name | Description | Default |
|---|---|---|
| SearchDefaultBaseDN | Default Base DN for LDAP Searches | null |
| SearchDefaultScope | Default Scope for LDAP Searches. Can be one of SUBTREE_SCOPE, OBJECT_SCOPE, ONELEVEL_SCOPE. | ONELEVEL_SCOPE |
| RestrictToObjectClass | Restrict Searches to objectClass named in the Name field for a table | false |
| UsePagination | Use a PagedResultsControl to page through large results. This is not supported by all directory servers. | false |
| ExceptionOnSizeLimitExceeded | Set to true to throw an exception when a SizeLimitExceededException is received and a LIMIT is not properly enforced. | false |
Note
create foreign table ldap_groups (objectClass string[], DN string, name string options (nameinsource 'cn'), uniqueMember string[]) options (nameinsource 'ou=groups,dc=teiid,dc=org', updatable true)
insert into ldap_groups (objectClass, DN, name, uniqueMember) values (('top', 'groupOfUniqueNames'), 'cn=a,ou=groups,dc=teiid,dc=org', 'a', ('cn=Sam Smith,ou=people,dc=teiid,dc=org',))
12.20.3. LDAP Translator: Native Queries Copy linkLink copied to clipboard!
CREATE FOREIGN PROCEDURE proc (arg1 integer, arg2 string) OPTIONS ("teiid_rel:native-query" 'search;context-name=corporate;filter=(&(objectCategory=person)(objectClass=user)(!cn=$2));count-limit=5;timeout=$1;search-scope=ONELEVEL_SCOPE;attributes=uid,cn') returns (col1 string, col2 string);
Note
12.20.4. LDAP Translator: Native Procedure Copy linkLink copied to clipboard!
Warning
12.20.5. LDAP Translator Example: Search Copy linkLink copied to clipboard!
Example 12.7. Search Example
SELECT x.* FROM (call pm1.native('search;context-name=corporate;filter=(objectClass=*);count-limit=5;timeout=6;search-scope=ONELEVEL_SCOPE;attributes=uid,cn')) w,
ARRAYTABLE(w.tuple COLUMNS "uid" string , "cn" string) AS x
|
Name
|
Description
|
Required
|
|---|---|---|
|
context-name
|
LDAP Context name
|
Yes
|
|
filter
|
query to filter the records in the context
|
No
|
|
count-limit
|
limit the number of results. same as using LIMIT
|
No
|
|
timeout
|
Time out the query if not finished in given milliseconds
|
No
|
|
search-scope
|
LDAP search scope, one of SUBTREE_SCOPE, OBJECT_SCOPE, ONELEVEL_SCOPE
|
No
|
|
attributes
|
attributes to retrieve
|
Yes
|
12.20.6. LDAP Translator Example: Delete Copy linkLink copied to clipboard!
Example 12.8. Delete Example
SELECT x.* FROM (call pm1.native('delete;uid=doe,ou=people,o=teiid.org')) w,
ARRAYTABLE(w.tuple COLUMNS "updatecount" integer) AS x
12.20.7. LDAP Translator Example: Create and Update Copy linkLink copied to clipboard!
Example 12.9. Create Example
SELECT x.* FROM
(call pm1.native('create;uid=doe,ou=people,o=teiid.org;attributes=one,two,three', 'one', 2, 3.0)) w,
ARRAYTABLE(w.tuple COLUMNS "update_count" integer) AS x
Example 12.10. Update Example
SELECT x.* FROM
(call pm1.native('update;uid=doe,ou=people,o=teiid.org;attributes=one,two,three', 'one', 2, 3.0)) w,
ARRAYTABLE(w.tuple COLUMNS "update_count" integer) AS x
Important
vdb.xml file. See Section 12.6, “Override Execution Properties”.
12.20.8. LDAP Connector Capabilities Support Copy linkLink copied to clipboard!
SELECT firstname, lastname, guid
FROM public_views.people
WHERE
(lastname='Jones' and firstname IN ('Michael', 'John'))
OR
guid > 600000
SELECTclause support- select individual element support (firstname, lastname, guid)
FROMsupportWHEREclause criteria support- nested criteria support
- AND, OR support
- Compare criteria (Greater-than) support
INsupport
12.20.9. LDAP Connector Capabilities Support List Copy linkLink copied to clipboard!
SELECTqueriesSELECTelement pushdown (for example, individual attribute selection)ANDcriteria- Compare criteria (e.g. <, <=, >, >=, =, !=)
INcriteriaLIKEcriteria.ORcriteriaINSERT,UPDATE,DELETEstatements (must meet Modeling requirements)
SELECTqueries
- Functions
- Aggregates
BETWEENCriteria- Case Expressions
- Aliased Groups
- Correlated Subqueries
EXISTSCriteria- Joins
- Inline views
IS NULLcriteriaNOTcriteriaORDER BY- Quantified compare criteria
- Row Offset
- Searched Case Expressions
- Select Distinct
- Select Literals
UNION- XA Transactions
ldap translator in the vdb.xml file.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<vdb name="ldapVDB" version="1">
<model name="HRModel">
<source name="local" translator-name="ldap" connection-jndi-name="java:/ldapDS"/>
</model>
</vdb>
standalone-teiid.xml file. See a example in JBOSS-HOME/docs/teiid/datasources/ldap.
<resource-adapter id="ldapQS">
<module slot="main" id="org.jboss.teiid.resource-adapter.ldap"/>
<connection-definitions>
<connection-definition class-name="org.teiid.resource.adapter.ldap.LDAPManagedConnectionFactory" jndi-name="java:/ldapDS" enabled="true" use-java-context="true" pool-name="ldapDS">
<config-property name="LdapAdminUserPassword">
redhat
</config-property>
<config-property name="LdapAdminUserDN">
cn=Manager,dc=example,dc=com
</config-property>
<config-property name="LdapUrl">
ldap://localhost:389
</config-property>
</connection-definition>
</connection-definitions>
</resource-adapter>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<vdb name="ldapVDB" version="1">
<model name="HRModel">
<metadata type="DDL"><![CDATA[
CREATE FOREIGN TABLE HR_Group (
DN string options (nameinsource 'dn'),
SN string options (nameinsource 'sn'),
UID string options (nameinsource 'uid'),
MAIL string options (nameinsource 'mail'),
NAME string options (nameinsource 'cn')
) OPTIONS(nameinsource 'ou=HR,dc=example,dc=com', updatable true);
</metadata>
</model>
</vdb>
SELECT * FROM HR_Group
12.20.10. LDAP Attribute Datatype Support Copy linkLink copied to clipboard!
java.lang.String and byte[], and do not support the ability to return any other attribute value type. The LDAP Connector currently supports attribute value types of java.lang.String only. Therefore, all attributes are modeled using the String datatype in Teiid Designer.
CONVERT functions.
CONVERT functions are not supported by the underlying LDAP system, they will be evaluated in JBoss Data Virtualization. Therefore, if any criteria is evaluated against a converted datatype, that evaluation cannot be pushed to the data source, since the native type is String.
Note
12.20.11. LDAP: Testing Your Connector Copy linkLink copied to clipboard!
12.20.12. LDAP: Console Deployment Issues Copy linkLink copied to clipboard!
If you receive an exception when you synchronize the server and your LDAP Connector is the only service that does not start, it means that there was a problem starting the connector. Verify whether you have correctly typed in your connector properties to resolve this issue.