5 changed files with 13 additions and 124 deletions
@ -1,30 +0,0 @@
@@ -1,30 +0,0 @@
|
||||
package org.acegisecurity.ldap; |
||||
|
||||
import net.sf.ldaptemplate.ContextSource; |
||||
|
||||
import javax.naming.directory.DirContext; |
||||
|
||||
import org.springframework.dao.DataAccessException; |
||||
|
||||
/** |
||||
* A version of InitialDirContextFactory that implements the ldaptemplate ContextSource interface. |
||||
* |
||||
* DefaultInitialDirContextFactory should be modified to implement this when it is possible to |
||||
* introduce a dependency on ldaptemplate in the main code. |
||||
* |
||||
* @author Luke |
||||
* @version $Id$ |
||||
*/ |
||||
public class ContextSourceInitialDirContextFactory extends DefaultInitialDirContextFactory implements ContextSource { |
||||
public ContextSourceInitialDirContextFactory(String providerUrl) { |
||||
super(providerUrl); |
||||
} |
||||
|
||||
public DirContext getReadOnlyContext() throws DataAccessException { |
||||
return newInitialDirContext(); |
||||
} |
||||
|
||||
public DirContext getReadWriteContext() throws DataAccessException { |
||||
return newInitialDirContext(); |
||||
} |
||||
} |
||||
@ -1,25 +0,0 @@
@@ -1,25 +0,0 @@
|
||||
package org.acegisecurity.userdetails; |
||||
|
||||
/** |
||||
* An extension of the {@link UserDetailsService} which provides the ability |
||||
* to create new users and update existing ones. |
||||
* |
||||
* @author Luke |
||||
* @version $Id$ |
||||
*/ |
||||
public interface UserDetailsManager extends UserDetailsService { |
||||
|
||||
/** |
||||
* Save details for the supplied user, or update |
||||
* |
||||
* @param user |
||||
*/ |
||||
void createUser(UserDetails user); |
||||
|
||||
void updateUser(UserDetails user); |
||||
|
||||
void deleteUser(String username); |
||||
|
||||
boolean userExists(String username); |
||||
|
||||
} |
||||
@ -1,50 +0,0 @@
@@ -1,50 +0,0 @@
|
||||
package org.acegisecurity.userdetails.ldap; |
||||
|
||||
/** |
||||
* @author Luke |
||||
* @version $Id$ |
||||
*/ |
||||
public class InetOrgPerson extends LdapUserDetailsImpl { |
||||
String sn; |
||||
String cn; |
||||
|
||||
public String getSn() { |
||||
return sn; |
||||
} |
||||
|
||||
public String getCn() { |
||||
return cn; |
||||
} |
||||
|
||||
public static class Essence extends LdapUserDetailsImpl.Essence { |
||||
|
||||
public Essence() { |
||||
} |
||||
|
||||
public Essence(InetOrgPerson copyMe) { |
||||
super(copyMe); |
||||
} |
||||
|
||||
LdapUserDetailsImpl createTarget() { |
||||
return new InetOrgPerson(); |
||||
} |
||||
|
||||
public void setSn(String sn) { |
||||
((InetOrgPerson)instance).sn = sn; |
||||
} |
||||
|
||||
public void setCn(String cn) { |
||||
((InetOrgPerson)instance).cn = cn; |
||||
} |
||||
} |
||||
|
||||
public static void main(String[] args) { |
||||
InetOrgPerson.Essence p = new InetOrgPerson.Essence(); |
||||
|
||||
p.setSn("Scobbie"); |
||||
|
||||
InetOrgPerson immutablePerson = (InetOrgPerson)p.createUserDetails(); |
||||
System.out.println(immutablePerson.getSn()); |
||||
|
||||
} |
||||
} |
||||
Loading…
Reference in new issue