org.jboss.picketlink.idm.internal
Class LDAPIdentityStore

java.lang.Object
  extended by org.jboss.picketlink.idm.internal.LDAPIdentityStore
All Implemented Interfaces:
LDAPChangeNotificationHandler, IdentityStore

public class LDAPIdentityStore
extends Object
implements IdentityStore, LDAPChangeNotificationHandler

An IdentityStore implementation backed by an LDAP directory

Author:
Shane Bryzak, Anil Saldhana

Field Summary
 String COMMA
           
protected  DirContext ctx
           
 String EQUAL
           
protected  String groupDNSuffix
           
protected  String roleDNSuffix
           
protected  String userDNSuffix
           
 
Constructor Summary
LDAPIdentityStore()
           
 
Method Summary
 Group createGroup(String name, Group parent)
           
protected  void createGroupDN()
           
 Membership createMembership(Role role, User user, Group group)
           
 Role createRole(String name)
           
 User createUser(String name)
           
protected  void ensureGroupDNExists()
           
 List<Group> executeQuery(GroupQuery query, Range range)
           
 List<Membership> executeQuery(MembershipQuery query, Range range)
           
 List<Role> executeQuery(RoleQuery query, Range range)
           
 List<User> executeQuery(UserQuery query, Range range)
           
protected  String generateUserID(String firstName, String lastName)
           
 Map<String,String[]> getAttributes(Group group)
           
 Map<String,String[]> getAttributes(Role role)
           
 Map<String,String[]> getAttributes(User user)
           
 String[] getAttributeValues(Group group, String name)
           
 String[] getAttributeValues(Role role, String name)
           
 String[] getAttributeValues(User user, String name)
           
protected  String getFirstName(String name)
           
 Group getGroup(String name)
           
protected  String getLastName(String name)
           
 Membership getMembership(Role role, User user, Group group)
           
 Role getRole(String role)
           
 User getUser(String name)
           
 void handle(LDAPObjectChangedNotification notification)
          Handle an LDAPObjectChangedNotification
protected  Group parentGroup(LDAPGroup group)
           
 void removeAttribute(Group group, String name)
           
 void removeAttribute(Role role, String name)
           
 void removeAttribute(User user, String name)
           
 void removeGroup(Group group)
           
 void removeMembership(Role role, User user, Group group)
           
 void removeRole(Role role)
           
 void removeUser(User user)
           
 void setAttribute(Group group, String name, String[] values)
           
 void setAttribute(Role role, String name, String[] values)
           
 void setAttribute(User user, String name, String[] values)
           
 void setConfiguration(LDAPConfiguration configuration)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMMA

public final String COMMA
See Also:
Constant Field Values

EQUAL

public final String EQUAL
See Also:
Constant Field Values

ctx

protected DirContext ctx

userDNSuffix

protected String userDNSuffix

roleDNSuffix

protected String roleDNSuffix

groupDNSuffix

protected String groupDNSuffix
Constructor Detail

LDAPIdentityStore

public LDAPIdentityStore()
Method Detail

setConfiguration

public void setConfiguration(LDAPConfiguration configuration)

createUser

public User createUser(String name)
Specified by:
createUser in interface IdentityStore

removeUser

public void removeUser(User user)
Specified by:
removeUser in interface IdentityStore

getUser

public User getUser(String name)
Specified by:
getUser in interface IdentityStore

createGroup

public Group createGroup(String name,
                         Group parent)
Specified by:
createGroup in interface IdentityStore

removeGroup

public void removeGroup(Group group)
Specified by:
removeGroup in interface IdentityStore

getGroup

public Group getGroup(String name)
Specified by:
getGroup in interface IdentityStore

createRole

public Role createRole(String name)
Specified by:
createRole in interface IdentityStore

removeRole

public void removeRole(Role role)
Specified by:
removeRole in interface IdentityStore

getRole

public Role getRole(String role)
Specified by:
getRole in interface IdentityStore

createMembership

public Membership createMembership(Role role,
                                   User user,
                                   Group group)
Specified by:
createMembership in interface IdentityStore

removeMembership

public void removeMembership(Role role,
                             User user,
                             Group group)
Specified by:
removeMembership in interface IdentityStore

getMembership

public Membership getMembership(Role role,
                                User user,
                                Group group)
Specified by:
getMembership in interface IdentityStore

executeQuery

public List<User> executeQuery(UserQuery query,
                               Range range)
Specified by:
executeQuery in interface IdentityStore

executeQuery

public List<Group> executeQuery(GroupQuery query,
                                Range range)
Specified by:
executeQuery in interface IdentityStore

executeQuery

public List<Role> executeQuery(RoleQuery query,
                               Range range)
Specified by:
executeQuery in interface IdentityStore

executeQuery

public List<Membership> executeQuery(MembershipQuery query,
                                     Range range)
Specified by:
executeQuery in interface IdentityStore

setAttribute

public void setAttribute(User user,
                         String name,
                         String[] values)
Specified by:
setAttribute in interface IdentityStore

removeAttribute

public void removeAttribute(User user,
                            String name)
Specified by:
removeAttribute in interface IdentityStore

getAttributeValues

public String[] getAttributeValues(User user,
                                   String name)
Specified by:
getAttributeValues in interface IdentityStore

getAttributes

public Map<String,String[]> getAttributes(User user)
Specified by:
getAttributes in interface IdentityStore

setAttribute

public void setAttribute(Group group,
                         String name,
                         String[] values)
Specified by:
setAttribute in interface IdentityStore

removeAttribute

public void removeAttribute(Group group,
                            String name)
Specified by:
removeAttribute in interface IdentityStore

getAttributeValues

public String[] getAttributeValues(Group group,
                                   String name)
Specified by:
getAttributeValues in interface IdentityStore

getAttributes

public Map<String,String[]> getAttributes(Group group)
Specified by:
getAttributes in interface IdentityStore

setAttribute

public void setAttribute(Role role,
                         String name,
                         String[] values)
Specified by:
setAttribute in interface IdentityStore

removeAttribute

public void removeAttribute(Role role,
                            String name)
Specified by:
removeAttribute in interface IdentityStore

getAttributeValues

public String[] getAttributeValues(Role role,
                                   String name)
Specified by:
getAttributeValues in interface IdentityStore

getAttributes

public Map<String,String[]> getAttributes(Role role)
Specified by:
getAttributes in interface IdentityStore

getFirstName

protected String getFirstName(String name)

getLastName

protected String getLastName(String name)

generateUserID

protected String generateUserID(String firstName,
                                String lastName)

ensureGroupDNExists

protected void ensureGroupDNExists()

createGroupDN

protected void createGroupDN()

parentGroup

protected Group parentGroup(LDAPGroup group)

handle

public void handle(LDAPObjectChangedNotification notification)
Description copied from interface: LDAPChangeNotificationHandler
Handle an LDAPObjectChangedNotification

Specified by:
handle in interface LDAPChangeNotificationHandler


Copyright © 2012. All Rights Reserved.