The JNDI Connector provides access to a variety of JNDI services; it uses the javax.naming and javax.naming.directory packages to work with different directory services. To reach a specific system, you must install the JNDI driver for that system, for example com.sun.jndi.ldap.LdapCtxFactory for LDAP. The driver is typically distributed as one or more jar or zip files. Place these file in a place where the Java runtime can reach them, for example, in the TDI_install_dir/lib/ext directory.
This Connector supports Delta Tagging at the Attribute level. This means that provided a previous Connector in the AssemblyLine has provided Delta information at the Attribute level, the JNDI Connector will be able to use it in order to make the changes needed in the target JNDI directory.
When using the JNDI Connector for querying an LDAP Server, a SizeLimitExceededException may occur if the number of entries satisfying the search criteria is greater than the maximum limit set by the LDAP Server. To work around this situation, either increase the LDAP Server's maximum result limit, or set the java.naming.batchsize provider parameter to some value smaller than the maximum limit of the server. For more information on the java.naming.batchsize parameter refer to: http://java.sun.com/products/jndi/tutorial/ldap/search/batch.html
The Connector needs the following parameters:
java.naming.security.authentication:DIGEST-MD5
For
more information on SASL authentication and parameters see: http://java.sun.com/products/jndi/tutorial/ldap/security/sasl.html.
java.naming.batchsize=100
The JNDI connector has a way to set a modify operation value when the connector is in Modify mode. You can also use the simple connector interface to directly add, remove or replace attribute values and attributes instead of setting modify operation.
There is no Config Editor provided to set the modify operation. You must manually add the operation value to each attribute in the work entry of the JNDI connector in Modify mode using the following interface:
The resulting attribute has the set difference of its prior value set and the specified value set. If no values are specified, it deletes the entire attribute. If the attribute does not exist, or if some or all members of the specified value set do not exist, this absence might be ignored and the operation succeeds, or an Exception might be thrown to indicate the absence. Removal of the last value might remove the attribute if the attribute is required to have at least one value.
If the attribute already exists, this constant replaces all existing values with new specified values. If the attribute does not exist, this constant creates it. If no value is specified, this constant deletes all the values of the attribute. Removal of the last value might remove the attribute if the attribute is required to have at least one value. This is the default modify operation.
If the attribute does not exist, this constant creates the attribute. The resulting attribute has a union of the specified value set and the prior value set.
public void addAttributeValue(String moddn, String modattr, String modval)
throws Exception where:
For example, if you want to add "cn=bob" to the members attribute of "cn=mygroup" you use the method as such:
thisConnector.connector.addAttributeValue("cn=mygroup","members","cn=bob");
An Exception is thrown when the underlying modify operation fails.
public void replaceAttributeValue(String moddn, String modattr, String modval)
throws Exception where:
For example, if you want to replace the members attribute of "cn=mygroup" with "cn=bob" only, you use the method as such:
thisConnector.connector.replaceAttributeValue("cn=mygroup","members","cn=bob");
An Exception is thrown when the underlying modify operation fails.
public void removeAttribute(String moddn, String modattr)
throws Exception where:
For example, if you want to remove the members attribute of "cn=mygroup" you use the method as such:
thisConnector.connector.removeAttribute("cn=mygroup","members");
An Exception is thrown when the underlying modify operation fails.
public void removeAttributeValue(String moddn, String modattr, String modval)
throws Exception where:
An Exception is thrown when the underlying modify operation fails.
modify operation can be set per Modify request. It causes modify operation for all attributes in the modify request entry to be set to the proper modify operation value. Property values and matching modify operation values:
Property value (String) | modify operation value |
---|---|
delete |
di.com.ibm.di.entry.Attribute. ATTRIBUTE_DELETE |
add |
di.com.ibm.di.entry.Attribute. ATTRIBUTE_ADD |
replace |
di.com.ibm.di.entry.Attribute. ATTRIBUTE_REPLACE |
This property can be set at any time while the Connector is running by setting the property modOperation from the scripts:
conn.setProperty("modOperation","delete");
The JNDI Connector supports the Skip Lookup general option in Update or Delete mode. When it is selected, no search is performed prior to actual update and delete operations. It requires a name parameter (for example, $dn for LDAP) to be specified in order to operate properly.