org.apache.jetspeed.security.spi.impl.ldap
Class LdapMemberShipDaoImpl

java.lang.Object
  extended by org.apache.jetspeed.security.spi.impl.ldap.AbstractLdapDao
      extended by org.apache.jetspeed.security.spi.impl.ldap.LdapPrincipalDaoImpl
          extended by org.apache.jetspeed.security.spi.impl.ldap.LdapMemberShipDaoImpl
All Implemented Interfaces:
LdapMembershipDao, LdapPrincipalDao, LdapReadOnlyPrincipalDao

public class LdapMemberShipDaoImpl
extends LdapPrincipalDaoImpl
implements LdapMembershipDao


Field Summary
 
Fields inherited from class org.apache.jetspeed.security.spi.impl.ldap.AbstractLdapDao
ctx
 
Constructor Summary
LdapMemberShipDaoImpl()
           
LdapMemberShipDaoImpl(LdapBindingConfig config)
           
 
Method Summary
protected  javax.naming.directory.Attributes defineLdapAttributes(java.lang.String principalUid)
           A template method for defining the attributes for a particular LDAP class.
protected  java.lang.String[] getAttributes()
           
protected  java.util.List getAttributes(javax.naming.directory.Attribute attr)
           
protected  java.util.List getAttributes(javax.naming.directory.Attribute attr, java.lang.String filter)
           
protected  java.lang.String getDnSuffix()
           Builds the dn suffix.
protected  java.lang.String getEntryPrefix()
           A template method that returns the LDAP entry prefix of the concrete DAO.
protected  java.lang.String[] getObjectClasses()
           
protected  java.lang.String getSearchSuffix()
           A template method that returns the LDAP entry prefix of the concrete DAO.
protected  java.lang.String getUidAttributeForPrincipal()
           Builds the dn suffix.
protected  java.security.Principal makePrincipal(java.lang.String principalUid)
           Creates a GroupPrincipal object.
 java.lang.String[] searchGroupMemberShipByGroup(java.lang.String userPrincipalUid, javax.naming.directory.SearchControls cons)
           
 java.lang.String[] searchGroupMemberShipByUser(java.lang.String userPrincipalUid, javax.naming.directory.SearchControls cons)
           
 java.lang.String[] searchRoleMemberShipByRole(java.lang.String userPrincipalUid, javax.naming.directory.SearchControls cons)
           
 java.lang.String[] searchRoleMemberShipByUser(java.lang.String userPrincipalUid, javax.naming.directory.SearchControls cons)
           
 java.lang.String[] searchRolesFromGroupByGroup(java.lang.String groupPrincipalUid, javax.naming.directory.SearchControls cons)
           
 java.lang.String[] searchRolesFromGroupByRole(java.lang.String groupPrincipalUid, javax.naming.directory.SearchControls cons)
           
 java.lang.String[] searchUsersFromGroupByGroup(java.lang.String groupPrincipalUid, javax.naming.directory.SearchControls cons)
           Search user by group using the GroupMembershipAttribute.
 java.lang.String[] searchUsersFromGroupByUser(java.lang.String groupPrincipalUid, javax.naming.directory.SearchControls cons)
           Search user by group using the UserGroupMembershipAttribute.
 java.lang.String[] searchUsersFromRoleByRole(java.lang.String rolePrincipalUid, javax.naming.directory.SearchControls cons)
           Search user by role using the RoleMembershipAttribute.
 java.lang.String[] searchUsersFromRoleByUser(java.lang.String rolePrincipalUid, javax.naming.directory.SearchControls cons)
           Search user by role using the UserRoleMembershipAttribute.
 
Methods inherited from class org.apache.jetspeed.security.spi.impl.ldap.LdapPrincipalDaoImpl
convertUidToLdapAcceptableName, create, delete, find, getAttribute, getGroupDN, getGroupDN, getRoleDN, getRoleDN, getSearchDomain, getUserDN, getUserDN, parseAttr
 
Methods inherited from class org.apache.jetspeed.security.spi.impl.ldap.AbstractLdapDao
bindToServer, getGroupAttributes, getGroupFilter, getGroupFilterBase, getGroupIdAttribute, getGroupMembershipAttribute, getGroupMembershipForRoleAttribute, getGroupObjectClasses, getGroupObjectRequiredAttributeClasses, getGroupUidAttribute, getKnownAttributes, getRoleAttributes, getRoleFilter, getRoleFilterBase, getRoleGroupMembershipForRoleAttribute, getRoleIdAttribute, getRoleMembershipAttribute, getRoleObjectClasses, getRoleObjectRequiredAttributeClasses, getRoleUidAttribute, getRootContext, getSearchScope, getSubcontextName, getUidAttribute, getUserAttributes, getUserFilter, getUserFilterBase, getUserGroupMembershipAttribute, getUserIdAttribute, getUserObjectClasses, getUserPasswordAttribute, getUserRoleMembershipAttribute, getUserUidAttribute, lookupByUid, searchByWildcardedUid, searchGroupByWildcardedUid, searchRoleByWildcardedUid, setSearchControls, validateDn, validatePassword, validateUid
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.jetspeed.security.spi.impl.ldap.LdapReadOnlyPrincipalDao
lookupByUid
 

Constructor Detail

LdapMemberShipDaoImpl

public LdapMemberShipDaoImpl()
                      throws SecurityException
Throws:
SecurityException

LdapMemberShipDaoImpl

public LdapMemberShipDaoImpl(LdapBindingConfig config)
                      throws SecurityException
Throws:
SecurityException
Method Detail

searchGroupMemberShipByGroup

public java.lang.String[] searchGroupMemberShipByGroup(java.lang.String userPrincipalUid,
                                                       javax.naming.directory.SearchControls cons)
                                                throws javax.naming.NamingException
Specified by:
searchGroupMemberShipByGroup in interface LdapMembershipDao
Throws:
javax.naming.NamingException

searchGroupMemberShipByUser

public java.lang.String[] searchGroupMemberShipByUser(java.lang.String userPrincipalUid,
                                                      javax.naming.directory.SearchControls cons)
                                               throws javax.naming.NamingException
Specified by:
searchGroupMemberShipByUser in interface LdapMembershipDao
Throws:
javax.naming.NamingException

searchRoleMemberShipByRole

public java.lang.String[] searchRoleMemberShipByRole(java.lang.String userPrincipalUid,
                                                     javax.naming.directory.SearchControls cons)
                                              throws javax.naming.NamingException
Specified by:
searchRoleMemberShipByRole in interface LdapMembershipDao
Throws:
javax.naming.NamingException

searchRoleMemberShipByUser

public java.lang.String[] searchRoleMemberShipByUser(java.lang.String userPrincipalUid,
                                                     javax.naming.directory.SearchControls cons)
                                              throws javax.naming.NamingException
Specified by:
searchRoleMemberShipByUser in interface LdapMembershipDao
Throws:
javax.naming.NamingException

searchUsersFromGroupByGroup

public java.lang.String[] searchUsersFromGroupByGroup(java.lang.String groupPrincipalUid,
                                                      javax.naming.directory.SearchControls cons)
                                               throws javax.naming.NamingException
Description copied from interface: LdapMembershipDao

Search user by group using the GroupMembershipAttribute.

Specified by:
searchUsersFromGroupByGroup in interface LdapMembershipDao
Returns:
Throws:
javax.naming.NamingException - A NamingException.

searchUsersFromGroupByUser

public java.lang.String[] searchUsersFromGroupByUser(java.lang.String groupPrincipalUid,
                                                     javax.naming.directory.SearchControls cons)
                                              throws javax.naming.NamingException
Description copied from interface: LdapMembershipDao

Search user by group using the UserGroupMembershipAttribute.

Specified by:
searchUsersFromGroupByUser in interface LdapMembershipDao
Returns:
Throws:
javax.naming.NamingException - A NamingException.

searchRolesFromGroupByGroup

public java.lang.String[] searchRolesFromGroupByGroup(java.lang.String groupPrincipalUid,
                                                      javax.naming.directory.SearchControls cons)
                                               throws javax.naming.NamingException
Specified by:
searchRolesFromGroupByGroup in interface LdapMembershipDao
Throws:
javax.naming.NamingException

searchRolesFromGroupByRole

public java.lang.String[] searchRolesFromGroupByRole(java.lang.String groupPrincipalUid,
                                                     javax.naming.directory.SearchControls cons)
                                              throws javax.naming.NamingException
Specified by:
searchRolesFromGroupByRole in interface LdapMembershipDao
Throws:
javax.naming.NamingException

searchUsersFromRoleByRole

public java.lang.String[] searchUsersFromRoleByRole(java.lang.String rolePrincipalUid,
                                                    javax.naming.directory.SearchControls cons)
                                             throws javax.naming.NamingException
Description copied from interface: LdapMembershipDao

Search user by role using the RoleMembershipAttribute.

Specified by:
searchUsersFromRoleByRole in interface LdapMembershipDao
Returns:
Throws:
javax.naming.NamingException - A NamingException.

searchUsersFromRoleByUser

public java.lang.String[] searchUsersFromRoleByUser(java.lang.String rolePrincipalUid,
                                                    javax.naming.directory.SearchControls cons)
                                             throws javax.naming.NamingException
Description copied from interface: LdapMembershipDao

Search user by role using the UserRoleMembershipAttribute.

Specified by:
searchUsersFromRoleByUser in interface LdapMembershipDao
Returns:
Throws:
javax.naming.NamingException - A NamingException.

getAttributes

protected java.util.List getAttributes(javax.naming.directory.Attribute attr)
                                throws javax.naming.NamingException
Parameters:
attr -
Returns:
Throws:
javax.naming.NamingException

getAttributes

protected java.util.List getAttributes(javax.naming.directory.Attribute attr,
                                       java.lang.String filter)
                                throws javax.naming.NamingException
Parameters:
attr -
Returns:
Throws:
javax.naming.NamingException

defineLdapAttributes

protected javax.naming.directory.Attributes defineLdapAttributes(java.lang.String principalUid)

A template method for defining the attributes for a particular LDAP class.

Specified by:
defineLdapAttributes in class LdapPrincipalDaoImpl
Parameters:
principalUid - The principal uid.
Returns:
the LDAP attributes object for the particular class.

getDnSuffix

protected java.lang.String getDnSuffix()
Description copied from class: LdapPrincipalDaoImpl

Builds the dn suffix.

Specified by:
getDnSuffix in class LdapPrincipalDaoImpl
Returns:
The dn suffix.
See Also:
LdapPrincipalDaoImpl.getDnSuffix()

makePrincipal

protected java.security.Principal makePrincipal(java.lang.String principalUid)

Creates a GroupPrincipal object.

Specified by:
makePrincipal in class LdapPrincipalDaoImpl
Parameters:
principalUid - The principal uid.
Returns:
A group principal object.

getObjectClasses

protected java.lang.String[] getObjectClasses()
Specified by:
getObjectClasses in class AbstractLdapDao

getUidAttributeForPrincipal

protected java.lang.String getUidAttributeForPrincipal()
Description copied from class: LdapPrincipalDaoImpl

Builds the dn suffix.

Specified by:
getUidAttributeForPrincipal in class LdapPrincipalDaoImpl
Returns:
The dn suffix.

getAttributes

protected java.lang.String[] getAttributes()
Specified by:
getAttributes in class AbstractLdapDao

getEntryPrefix

protected java.lang.String getEntryPrefix()
Description copied from class: AbstractLdapDao

A template method that returns the LDAP entry prefix of the concrete DAO.

TODO : this should be in spring config

Specified by:
getEntryPrefix in class AbstractLdapDao
Returns:
a String containing the LDAP entry prefix name.

getSearchSuffix

protected java.lang.String getSearchSuffix()
Description copied from class: AbstractLdapDao

A template method that returns the LDAP entry prefix of the concrete DAO.

TODO : this should be in spring config

Specified by:
getSearchSuffix in class AbstractLdapDao
Returns:
a String containing the LDAP entry prefix name.


Copyright © 1999-2009 Apache Software Foundation. All Rights Reserved.