From 78f792a1320dfe4469881bf0b30344cb2fb574a9 Mon Sep 17 00:00:00 2001 From: Robert Sanders Date: Tue, 7 Jun 2005 02:48:56 +0000 Subject: [PATCH] Wrapper around the information returned apon a successful lookup of a user (who at that point has NOT been authenticated). --- .../providers/dao/ldap/UserSearchResults.java | 100 ++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 sandbox/src/main/java/org/acegisecurity/providers/dao/ldap/UserSearchResults.java diff --git a/sandbox/src/main/java/org/acegisecurity/providers/dao/ldap/UserSearchResults.java b/sandbox/src/main/java/org/acegisecurity/providers/dao/ldap/UserSearchResults.java new file mode 100644 index 0000000000..c0f78d8aa6 --- /dev/null +++ b/sandbox/src/main/java/org/acegisecurity/providers/dao/ldap/UserSearchResults.java @@ -0,0 +1,100 @@ +/** + * + */ +package net.sf.acegisecurity.providers.dao.ldap; + +import java.util.Hashtable; + +import javax.naming.Context; +import javax.naming.directory.Attributes; +import javax.naming.directory.SearchResult; + +/** + * Encapsulates the information returned by a successful UserSearchBean + * + */ +public class UserSearchResults { + + private Attributes attributes; + + /** The full DN of the user. */ + private String ldapName; + + /** The name that should be used to log the user into the LDAP server (to test authentication). */ + private String userLoginName; + + /** Internal state: the UserSearchBean which yeilded the results. */ + private UserSearchBean userSearchBean; + + public UserSearchResults() { + super(); + } + + public UserSearchResults(SearchResult searchResult) { + super(); + setAttributes( searchResult.getAttributes() ); + } + + public UserSearchResults(SearchResult searchResult, UserSearchBean userSearchBean) { + super(); + this.userSearchBean = userSearchBean; + setAttributes( searchResult.getAttributes() ); + } + + /** + * @return Returns the attributes. + */ + public Attributes getAttributes() { + return attributes; + } + + /** + * @param attributes The attributes to set. + */ + public void setAttributes(Attributes attributes) { + this.attributes = attributes; + } + + /** + * @return Returns the name. + */ + public String getLdapName() { + return ldapName; + } + + /** + * @param name The name to set. + */ + public void setLdapName(String name) { + this.ldapName = name; + } + + /** + * @return Returns the userLoginName. + */ + public String getUserLoginName() { + return userLoginName; + } + + /** + * @param userLoginName The userLoginName to set. + */ + public void setUserLoginName(String userLoginName) { + this.userLoginName = userLoginName; + } + + /** + * @return Returns the userSearchBean. + */ + public UserSearchBean getUserSearchBean() { + return userSearchBean; + } + + /** + * @param userSearchBean The userSearchBean to set. + */ + public void setUserSearchBean(UserSearchBean userSearchBean) { + this.userSearchBean = userSearchBean; + } + +}