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(TM) runtime can reach them, for
example, in the /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
Field Summary
Fields inherited from class com.ibm.di.connector.Connector
getAttributeSyntax(javax.naming.directory.DirContext schema,
java.lang.String attributeName)
Gets an Attribute Syntax from the schema of the DirContext.
putEntry(Entry entry)
Adds a new entry to the data source.
java.util.Vector<java.lang.Object>
queryObjectClassAttributes(java.lang.String objectClass)
Look up an objectclass in the schema of the DirContext.
java.lang.Object
querySchema(java.lang.Object source)
Query the Schema.
void
removeAttribute(java.lang.String moddn,
java.lang.String modattr)
removeAttribute : removes the attribute
void
removeAttributeValue(java.lang.String moddn,
java.lang.String modattr,
java.lang.String modval)
removeAttributeValue: removes a given attribute value from an entry
void
replaceAttributeValue(java.lang.String moddn,
java.lang.String modattr,
java.lang.String modval)
replaceAttributeValue: replaces a given attribute with a certain value
void
selectEntries()
Prepare the Connector for sequential read.
entry - An Entry populated with values that are to be sent to the LDAP
server.
Throws:
java.lang.Exception - If there is no distinguished name
modEntry
public void modEntry(Entry entry,
SearchCriteria search)
throws java.lang.Exception
Modifies an existing entry. The new entry data is given by the entry
parameter and the search criteria specifies which entry to modify. This
call is equivalent to modEntry(entry, search, findEntry(search))
Modify an Object in the DirContext. The supplied entry should contain a
$dn Attribute with the distinguished name. If it does not, then either
the SearchCriteria must be $dn equals some value, or the old Entry must
contain a $dn Attribute. If the $dn Attribute in entry and old are
different, we will try to rename the object in the DirContext. The easy
way to use this method is to populate entry with the values you want to
modify, and in particular supply a distinguished name. $dn Attribute, and
let search and old be null.
entry - An Entry containing the new values to be set in the LDAP
Server
search - Only used if there is no $dn Attribute in entry.
old - The old values, used to supply $dn if not present in Entry.
Throws:
java.lang.Exception - If no distinguished name can be found
deleteEntry
public void deleteEntry(Entry entry,
SearchCriteria search)
throws java.lang.Exception
Delete an entry. The distinguished name is provided by the $dn Attribute
in the entry parameter. If not found there. the SearchCriteria. must be
of the form $dn equals value.
Find an entry matching a SearchCriteria. Returns an entry if exactly one
match is found. If more than one Entry is found, getFindEntryCount() will
say how many matches were found.