|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.acegisecurity.ldap.LdapTemplate
public class LdapTemplate
LDAP equivalent of the Spring JdbcTemplate class.
This is mainly intended to simplify Ldap access within Acegi Security's LDAP-related services.
| Field Summary | |
|---|---|
static String[] |
NO_ATTRS
|
| Constructor Summary | |
|---|---|
LdapTemplate(InitialDirContextFactory dirContextFactory)
|
|
LdapTemplate(InitialDirContextFactory dirContextFactory,
String userDn,
String password)
|
|
| Method Summary | |
|---|---|
boolean |
compare(String dn,
String attributeName,
Object value)
Performs an LDAP compare operation of the value of an attribute for a particular directory entry. |
Object |
execute(LdapCallback callback)
|
boolean |
nameExists(String dn)
|
Object |
retrieveEntry(String dn,
LdapEntryMapper mapper,
String[] attributesToRetrieve)
Composes an object from the attributes of the given DN. |
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. |
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. |
void |
setSearchControls(SearchControls searchControls)
Sets the search controls which will be used for search operations by the template. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String[] NO_ATTRS
| Constructor Detail |
|---|
public LdapTemplate(InitialDirContextFactory dirContextFactory)
public LdapTemplate(InitialDirContextFactory dirContextFactory,
String userDn,
String password)
dirContextFactory - the source of DirContextsuserDn - the user name to authenticate as when obtaining new contextspassword - the user's password| Method Detail |
|---|
public boolean compare(String dn,
String attributeName,
Object value)
dn - the entry who's attribute is to be usedattributeName - the attribute who's value we want to comparevalue - the value to be checked against the directory value
public Object execute(LdapCallback callback)
throws DataAccessException
DataAccessExceptionpublic boolean nameExists(String dn)
public Object retrieveEntry(String dn,
LdapEntryMapper mapper,
String[] attributesToRetrieve)
dn - the directory entry which will be readmapper - maps the attributes to the required objectattributesToRetrieve - the named attributes which will be retrieved from the directory entry.
public Set searchForSingleAttributeValues(String base,
String filter,
Object[] params,
String attributeName)
base - the DN to search infilter - search filter to useparams - the parameters to substitute in the search filterattributeName - the attribute who's values are to be retrieved.
public Object searchForSingleEntry(String base,
String filter,
Object[] params,
LdapEntryMapper mapper)
base - filter - params - mapper -
IncorrectResultSizeDataAccessException - if no results are found or the search returns more than one result.public void setSearchControls(SearchControls searchControls)
searchControls - the SearchControls instance which will be cached in the template.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||