@ThreadSafe public class LDAPConnector extends Object
| Modifier and Type | Field and Description |
|---|---|
static com.unboundid.ldap.sdk.Filter |
MATCH_ANY_FILTER
Filter that matches any LDAP entry.
|
| Constructor and Description |
|---|
LDAPConnector(LDAPStoreConfiguration config,
String cacheName,
Set<String> attributes,
boolean supportAttributeOptions)
Creates a new LDAP connector.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
addEntry(com.unboundid.ldap.sdk.ReadOnlyEntry entry)
Adds the specified entry to the LDAP directory.
|
int |
countEntries()
Counts the number of entries under the base DN.
|
int |
deleteEntries()
Deletes all entries under the base DN.
|
boolean |
deleteEntry(com.unboundid.ldap.sdk.DN dn)
Deletes the specified entry from the LDAP directory.
|
boolean |
entryExists(com.unboundid.ldap.sdk.DN dn)
Checks that the specified entry exists in the LDAP directory.
|
com.unboundid.ldap.sdk.LDAPConnectionPool |
getPool()
Returns the underlying LDAP connection pool.
|
protected static boolean |
indicatesConnectionException(com.unboundid.ldap.sdk.LDAPException e)
Checks if the specified LDAP exception is caused by the LDAP server
being unavailable, disconnected or timing out.
|
protected static boolean |
indicatesConnectionException(com.unboundid.ldap.sdk.ResultCode code)
Checks if the specified LDAP result code indicates the LDAP server
is unavailable, disconnected or timing out.
|
boolean |
replaceEntry(com.unboundid.ldap.sdk.ReadOnlyEntry entry)
Replaces the specified entry in the LDAP directory.
|
void |
retrieveEntries(com.nimbusds.common.appendable.Appendable<com.unboundid.ldap.sdk.ReadOnlyEntry> appendable)
Retrieves all entries from the LDAP directory under the base DN.
|
com.unboundid.ldap.sdk.ReadOnlyEntry |
retrieveEntry(com.unboundid.ldap.sdk.DN dn)
Retrieves the specified entry from the LDAP directory.
|
void |
shutdown()
Shuts down this LDAP connector by releasing any associated resources
(LDAP connection pool).
|
public static final com.unboundid.ldap.sdk.Filter MATCH_ANY_FILTER
public LDAPConnector(LDAPStoreConfiguration config, String cacheName, Set<String> attributes, boolean supportAttributeOptions)
config - The LDAP configuration. Must not be
null.cacheName - The name of the Infinispan cache
associated with this LDAP connector.
Must not be null.attributes - The names of the supported directory
attributes. Must not be empty or
null.supportAttributeOptions - true if any of the supported
directory attributes may include
options (such as language tags), else
false.public com.unboundid.ldap.sdk.LDAPConnectionPool getPool()
public com.unboundid.ldap.sdk.ReadOnlyEntry retrieveEntry(com.unboundid.ldap.sdk.DN dn)
dn - The Distinguished Name (DN) of the entry to retrieve. Must
not be null.null if not found (or
insufficient privileges).public void retrieveEntries(com.nimbusds.common.appendable.Appendable<com.unboundid.ldap.sdk.ReadOnlyEntry> appendable)
appendable - Collects the matching directory entries. Must not
be null.public boolean entryExists(com.unboundid.ldap.sdk.DN dn)
dn - The Distinguished Name (DN) of the entry to check. Must
not be null.true if the entry exists, false if not
found (or insufficient privileges).public boolean addEntry(com.unboundid.ldap.sdk.ReadOnlyEntry entry)
entry - The entry to add. Must not be null.true if the entry was added, false if there
was a stored entry with that Distinguished Name (DN).public boolean replaceEntry(com.unboundid.ldap.sdk.ReadOnlyEntry entry)
entry - The entry to replace. Must not be null.true if the entry was found, false if
there was no stored entry with that Distinguished Name (DN).public boolean deleteEntry(com.unboundid.ldap.sdk.DN dn)
dn - The Distinguished Name (DN) of the entry to delete. Must
not be null.true if the matching directory entry was deleted,
false if not found (or insufficient privileges).protected static boolean indicatesConnectionException(com.unboundid.ldap.sdk.LDAPException e)
e - The LDAP exception. Must not be null.true if the LDAP exception is caused by the LDAP
server being unavailable, disconnected or timing out, else
false.protected static boolean indicatesConnectionException(com.unboundid.ldap.sdk.ResultCode code)
code - The LDAP result code. Must not be null.true if the LDAP result code indicates the LDAP
server is unavailable, disconnected or timing out, else
false.public int countEntries()
public int deleteEntries()
public void shutdown()
Copyright © 2016 Connect2id Ltd.. All Rights Reserved.