| java.lang.Object org.acegisecurity.ldap.LdapTemplate
LdapTemplate | public class LdapTemplate (Code) | | LDAP equivalent of the Spring JdbcTemplate class. This is mainly intended to simplify Ldap access within Acegi
Security's LDAP-related services.
author: Ben Alex author: Luke Taylor |
Method Summary | |
public boolean | compare(String dn, String attributeName, Object value) Performs an LDAP compare operation of the value of an attribute for a particular directory entry. | public Object | execute(LdapCallback callback) | public boolean | nameExists(String dn) | public Object | retrieveEntry(String dn, LdapEntryMapper mapper, String[] attributesToRetrieve) Composes an object from the attributes of the given DN.
Parameters: dn - the directory entry which will be read Parameters: mapper - maps the attributes to the required object Parameters: attributesToRetrieve - the named attributes which will be retrieved from the directory entry. | public Set | searchForSingleAttributeValues(String base, String filter, Object[] params, String attributeName) Performs a search using the supplied filter and returns the union of the values of the named attribute
found in all entries matched by the search. | public Object | searchForSingleEntry(String base, String filter, Object[] params, LdapEntryMapper mapper) Performs a search, with the requirement that the search shall return a single directory entry, and uses
the supplied mapper to create the object from that entry. | public void | setSearchControls(SearchControls searchControls) Sets the search controls which will be used for search operations by the template. |
LdapTemplate | public LdapTemplate(InitialDirContextFactory dirContextFactory, String userDn, String password)(Code) | | Parameters: dirContextFactory - the source of DirContexts Parameters: userDn - the user name to authenticate as when obtaining new contexts Parameters: password - the user's password |
compare | public boolean compare(String dn, String attributeName, Object value)(Code) | | Performs an LDAP compare operation of the value of an attribute for a particular directory entry.
Parameters: dn - the entry who's attribute is to be used Parameters: attributeName - the attribute who's value we want to compare Parameters: value - the value to be checked against the directory value true if the supplied value matches that in the directory |
retrieveEntry | public Object retrieveEntry(String dn, LdapEntryMapper mapper, String[] attributesToRetrieve)(Code) | | Composes an object from the attributes of the given DN.
Parameters: dn - the directory entry which will be read Parameters: mapper - maps the attributes to the required object Parameters: attributesToRetrieve - the named attributes which will be retrieved from the directory entry. the object created by the mapper |
searchForSingleAttributeValues | public Set searchForSingleAttributeValues(String base, String filter, Object[] params, String attributeName)(Code) | | Performs a search using the supplied filter and returns the union of the values of the named attribute
found in all entries matched by the search. Note that one directory entry may have several values for the
attribute. Intended for role searches and similar scenarios.
Parameters: base - the DN to search in Parameters: filter - search filter to use Parameters: params - the parameters to substitute in the search filter Parameters: attributeName - the attribute who's values are to be retrieved. the set of String values for the attribute as a union of the values found in all the matching entries. |
searchForSingleEntry | public Object searchForSingleEntry(String base, String filter, Object[] params, LdapEntryMapper mapper)(Code) | | Performs a search, with the requirement that the search shall return a single directory entry, and uses
the supplied mapper to create the object from that entry.
Parameters: base - Parameters: filter - Parameters: params - Parameters: mapper - the object created by the mapper from the matching entry throws: IncorrectResultSizeDataAccessException - if no results are found or the search returns more than oneresult. |
setSearchControls | public void setSearchControls(SearchControls searchControls)(Code) | | Sets the search controls which will be used for search operations by the template.
Parameters: searchControls - the SearchControls instance which will be cached in the template. |
|
|