public abstract class LDAPConnection extends Object
This interface is provided in order to make it easier to keep track of which JNDI DirContext methods we require and also to facilitate implementation of mock JNDI contexts for unit-testing.
Modifier | Constructor and Description |
---|---|
protected |
LDAPConnection()
Create a new LDAP connection.
|
Modifier and Type | Method and Description |
---|---|
abstract void |
createEntry(LdapName dn,
Attributes attributes)
Creates a new entry with the specified set of attributes.
|
abstract void |
deleteSubtree(LdapName dn)
Deletes the named subtree.
|
abstract boolean |
entryExists(LdapName dn)
Determines whether or not the named entry exists.
|
abstract Collection<LdapName> |
listEntries(LdapName dn,
String filter)
Lists the children of the named entry.
|
abstract void |
modifyEntry(LdapName dn,
Attributes mods)
Modifies the attributes of the named entry.
|
abstract Attributes |
readEntry(LdapName dn,
Collection<String> attrIds)
Reads the attributes of the named entry.
|
abstract void |
unbind()
Closes the LDAP connection.
|
protected LDAPConnection()
public abstract void createEntry(LdapName dn, Attributes attributes) throws NamingException
dn
- The name of the entry to be created.attributes
- The set of attributes.NamingException
- If an error occurred whilst creating the entry.public abstract void deleteSubtree(LdapName dn) throws NamingException
dn
- The name of the subtree to be deleted.NamingException
- If an error occurred whilst deleting the subtree.public abstract boolean entryExists(LdapName dn) throws NamingException
dn
- The name of the entry.true
if the entry exists.NamingException
- If an error occurred whilst making the determination.public abstract Collection<LdapName> listEntries(LdapName dn, String filter) throws NamingException
dn
- The name of the entry to list.filter
- An LDAP filter string, or null
indicating
the default filter of (objectclass=*)
.NamingException
- If an error occurred whilst listing the children.public abstract void modifyEntry(LdapName dn, Attributes mods) throws NamingException
dn
- The name of the entry to be modified.mods
- The list of attributes which need replacing.NamingException
- If an error occurred whilst applying the modifications.public abstract Attributes readEntry(LdapName dn, Collection<String> attrIds) throws NamingException
dn
- The name of the entry to be read.attrIds
- The list of attributes to be retrievd.NamingException
- If an error occurred whilst reading the entry.public abstract void unbind()
Copyright © 2010-2016 ForgeRock AS. All Rights Reserved.