|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opends.server.admin.client.ldap.LDAPConnection
org.opends.server.admin.client.ldap.JNDIDirContextAdaptor
public final class JNDIDirContextAdaptor
An LDAP connection adaptor which maps LDAP requests onto an underlying JNDI connection context.
Method Summary | |
---|---|
static JNDIDirContextAdaptor |
adapt(javax.naming.directory.DirContext dirContext)
Adapts the provided JNDI DirContext . |
void |
createEntry(javax.naming.ldap.LdapName dn,
javax.naming.directory.Attributes attributes)
Creates a new entry with the specified set of attributes. |
void |
deleteSubtree(javax.naming.ldap.LdapName dn)
Deletes the named subtree. |
boolean |
entryExists(javax.naming.ldap.LdapName dn)
Determines whether or not the named entry exists. |
java.util.Collection<javax.naming.ldap.LdapName> |
listEntries(javax.naming.ldap.LdapName dn,
java.lang.String filter)
Lists the children of the named entry. |
void |
modifyEntry(javax.naming.ldap.LdapName dn,
javax.naming.directory.Attributes mods)
Modifies the attributes of the named entry. |
javax.naming.directory.Attributes |
readEntry(javax.naming.ldap.LdapName dn,
java.util.Collection<java.lang.String> attrIds)
Reads the attributes of the named entry. |
static JNDIDirContextAdaptor |
simpleBind(java.lang.String host,
int port,
java.lang.String name,
java.lang.String password)
Creates a new JNDI connection adaptor by performing a simple bind operation to the specified LDAP server. |
void |
unbind()
Closes the LDAP connection. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static JNDIDirContextAdaptor adapt(javax.naming.directory.DirContext dirContext)
DirContext
.
dirContext
- The JNDI connection.
public static JNDIDirContextAdaptor simpleBind(java.lang.String host, int port, java.lang.String name, java.lang.String password) throws CommunicationException, AuthenticationNotSupportedException, AuthenticationException
host
- The host.port
- The port.name
- The LDAP bind DN.password
- The LDAP bind password.
CommunicationException
- If the client cannot contact the server due to an
underlying communication problem.
AuthenticationNotSupportedException
- If the server does not support simple authentication.
AuthenticationException
- If authentication failed for some reason, usually due
to invalid credentials.public void createEntry(javax.naming.ldap.LdapName dn, javax.naming.directory.Attributes attributes) throws javax.naming.NamingException
createEntry
in class LDAPConnection
dn
- The name of the entry to be created.attributes
- The set of attributes.
javax.naming.NamingException
- If an error occurred whilst creating the entry.public void deleteSubtree(javax.naming.ldap.LdapName dn) throws javax.naming.NamingException
deleteSubtree
in class LDAPConnection
dn
- The name of the subtree to be deleted.
javax.naming.NamingException
- If an error occurred whilst deleting the subtree.public boolean entryExists(javax.naming.ldap.LdapName dn) throws javax.naming.NamingException
entryExists
in class LDAPConnection
dn
- The name of the entry.
true
if the entry exists.
javax.naming.NamingException
- If an error occurred whilst making the determination.public java.util.Collection<javax.naming.ldap.LdapName> listEntries(javax.naming.ldap.LdapName dn, java.lang.String filter) throws javax.naming.NamingException
listEntries
in class LDAPConnection
dn
- The name of the entry to list.filter
- An LDAP filter string, or null
indicating
the default filter of (objectclass=*)
.
javax.naming.NamingException
- If an error occurred whilst listing the children.public void modifyEntry(javax.naming.ldap.LdapName dn, javax.naming.directory.Attributes mods) throws javax.naming.NamingException
modifyEntry
in class LDAPConnection
dn
- The name of the entry to be modified.mods
- The list of attributes which need replacing.
javax.naming.NamingException
- If an error occurred whilst applying the modifications.public javax.naming.directory.Attributes readEntry(javax.naming.ldap.LdapName dn, java.util.Collection<java.lang.String> attrIds) throws javax.naming.NamingException
readEntry
in class LDAPConnection
dn
- The name of the entry to be read.attrIds
- The list of attributes to be retrievd.
javax.naming.NamingException
- If an error occurred whilst reading the entry.public void unbind()
unbind
in class LDAPConnection
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |