Interface LDAPConnection
- All Known Implementing Classes:
ActiveDirectoryConnectionImpl,EDirectoryConnectionImpl,JNDIConnectionImpl
public interface LDAPConnection
Provides ldap services.
The different implementations are responsible for providing support for server failover or other failure recovery
features.
-
Method Summary
Modifier and TypeMethodDescriptionvoidchangePassword(DirContext ctx, String argRDN, String oldPassword, String newPassword) booleancheckPassword(String searchbase, String login, char[] plainPassword) voidclose()Close the connection to the directory.Reads all the attribute type and values for the given entry.searchBaseEntry(String searchbase, String filter, int limit, int timeout) Performs a base object search (i.e.searchBaseEntry(String searchbase, String filter, int limit, int timeout, String[] returnAttributes) Performs a base object search (i.e.searchSubTree(String searchbase, String filter, int limit, int timeout) Performs a directory sub tree search (i.e.searchSubTree(String searchbase, String filter, int limit, int timeout, String[] returnAttributes) Performs a directory sub tree search (i.e.
-
Method Details
-
close
void close()Close the connection to the directory. All other methods of this interface should throw an exception if called after this method, but it is not guarenteed. -
searchBaseEntry
Collection searchBaseEntry(String searchbase, String filter, int limit, int timeout) throws LDAPOperationException, LDAPUnavailableException, NamingException Performs a base object search (i.e. just a search of the current entry, nothing below it), returning no attributes (i.e. just DNs);- Parameters:
searchbase- the domain name (relative to initial context in ldap) to seach from.filter- the non-null filter to use for the searchlimit- the maximum number of results to returntimeout- the maximum time to wait before abandoning the search- Returns:
- list of search results ('SearchResult's); entries matching the search filter.
- Throws:
LDAPOperationExceptionLDAPUnavailableExceptionNamingException
-
searchBaseEntry
Collection searchBaseEntry(String searchbase, String filter, int limit, int timeout, String[] returnAttributes) throws LDAPOperationException, LDAPUnavailableException, NamingException Performs a base object search (i.e. just a search of the current entry, nothing below it).- Parameters:
searchbase- the domain name (relative to initial context in ldap) to seach from.filter- the non-null filter to use for the searchlimit- the maximum number of results to returntimeout- the maximum time to wait before abandoning the searchreturnAttributes- an array of strings containing the names of attributes to search. (null = all, empty array = none)- Returns:
- list of search results ('SearchResult's); entries matching the search filter.
- Throws:
LDAPOperationExceptionLDAPUnavailableExceptionNamingException
-
searchSubTree
Collection searchSubTree(String searchbase, String filter, int limit, int timeout) throws LDAPOperationException, LDAPUnavailableException, NamingException Performs a directory sub tree search (i.e. of the next level and all subsequent levels below), returning just dns);- Parameters:
searchbase- the domain name (relative to initial context in ldap) to seach from.filter- the non-null filter to use for the searchlimit- the maximum number of results to returntimeout- the maximum time to wait before abandoning the search- Returns:
- list of search results ('SearchResult's); entries matching the search filter. WARNING - these may be RELATIVE to the seachbase.
- Throws:
LDAPOperationExceptionLDAPUnavailableExceptionNamingException
-
searchSubTree
Collection<LDAPGenericObject> searchSubTree(String searchbase, String filter, int limit, int timeout, String[] returnAttributes) throws LDAPOperationException, LDAPUnavailableException, NamingException Performs a directory sub tree search (i.e. of the next level and all subsequent levels below).- Parameters:
searchbase- the domain name (relative to initial context in ldap) to seach from.filter- the non-null filter to use for the searchlimit- the maximum number of results to returntimeout- the maximum time to wait before abandoning the searchreturnAttributes- an array of strings containing the names of attributes to search. (null = all, empty array = none)- Returns:
- list of search results ('SearchResult's); entries matching the search filter. WARNING - these may be RELATIVE to the seachbase.
- Throws:
LDAPOperationExceptionLDAPUnavailableExceptionNamingException
-
read
Attributes read(String distinguishedName) throws LDAPOperationException, LDAPUnavailableException, NamingException Reads all the attribute type and values for the given entry.- Parameters:
distinguishedName- the ldap string distinguished name of entry to be read- Returns:
- an 'Attributes' object containing a list of all Attribute objects.
- Throws:
LDAPOperationExceptionLDAPUnavailableExceptionNamingException
-
checkPassword
-
changePassword
void changePassword(DirContext ctx, String argRDN, String oldPassword, String newPassword) throws NamingException - Throws:
NamingException
-