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, 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:
Not all directory servers support all SASL mechanisms and
in some cases do not have them enabled by default. Check the documentation
and configuration options for the directory server you are connecting
to for this information.
The JNDI connector has a way to set a modify operation value
when the connector is in Modify mode. We 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.
throws
Exception where:
For example, if we want to add "cn=bob" to the members attribute of "cn=mygroup" you
use the method as such:
An
Exception is thrown when the underlying modify operation fails.
throws
Exception where:
For example, if we want to replace the members attribute
of "cn=mygroup" with "cn=bob" only, we use the method as such:
An
Exception is thrown when the underlying modify operation fails.
throws Exception where:
For example, if we want to remove the members attribute
of "cn=mygroup" we use the method as such:
An
Exception is thrown when the underlying modify operation fails.
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:
di.com.ibm.di.entry.Attribute.
ATTRIBUTE_DELETE
di.com.ibm.di.entry.Attribute.
ATTRIBUTE_ADD
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:
This property does not affect the behavior of the any interfaces
defined above. However, it does overwrite the existing modify
operation set by di.com.ibm.di.entry.Attribute.setOper(char
operation)
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.
JNDI overview,
Configuration
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
Setting the Modify operation
Calling the Modify Interface
Adding a value to an attribute
public void addAttributeValue(String moddn, String modattr, String modval)
thisConnector.connector.addAttributeValue("cn=mygroup","members","cn=bob");
Replacing the attribute value
public void replaceAttributeValue(String moddn, String modattr, String modval)
thisConnector.connector.replaceAttributeValue("cn=mygroup","members","cn=bob");
Removing attribute
public void removeAttribute(String moddn, String modattr)
thisConnector.connector.removeAttribute("cn=mygroup","members");
Removing a certain attribute value from an attribute
public void removeAttributeValue(String moddn, String modattr, String modval)
modify operation
Property value (String)
modify operation value
delete
add
replace
conn.setProperty("modOperation","delete");
Skip Lookup in Update and Delete mode
See also
JNDI Tutorial,
JNDI FAQ,
LDAP Connector.