LdapUserDetailsMapper now throws UnsupportedOperationException for mapUserToContext method as only subclasses of this which implement actual LDAP object classes should be used for writing to a directory.

This commit is contained in:
Luke Taylor 2007-12-06 00:12:06 +00:00
parent 22052115b6
commit 3ddcc203bf
1 changed files with 3 additions and 2 deletions

View File

@ -28,7 +28,7 @@ import org.springframework.ldap.core.DirContextOperations;
/**
* The context mapper used by the authenticators to create an ldap user object.
* The context mapper used by the LDAP authentication provider to create an LDAP user object.
*
* @author Luke Taylor
* @version $Id$
@ -89,7 +89,8 @@ public class LdapUserDetailsMapper implements UserDetailsContextMapper {
}
public void mapUserToContext(UserDetails user, DirContextAdapter ctx) {
throw new UnsupportedOperationException("LdapUserDetailsMapper only supports reading from a context. Please" +
"use a subclass if mapUserToContext() is required.");
}
/**