|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.jetspeed.security.spi.impl.ldap.AbstractLdapDao
org.apache.jetspeed.security.spi.impl.ldap.LdapPrincipalDaoImpl
org.apache.jetspeed.security.spi.impl.ldap.LdapUserPrincipalDaoImpl
| Field Summary | |
private static String |
GROUP_ATTR_NAME
The group attribute name. |
private static org.apache.commons.logging.Log |
LOG
The logger. |
| Fields inherited from class org.apache.jetspeed.security.spi.impl.ldap.LdapPrincipalDaoImpl |
UID_ATTR_NAME |
| Fields inherited from class org.apache.jetspeed.security.spi.impl.ldap.AbstractLdapDao |
ctx, defaultDnSuffix, rootContext, rootDn, rootPassword |
| Constructor Summary | |
LdapUserPrincipalDaoImpl()
Default constructor. |
|
LdapUserPrincipalDaoImpl(String ldapServerName,
String rootDn,
String rootPassword,
String rootContext,
String defaultDnSuffix)
Initializes the dao. |
|
| Method Summary | |
void |
addGroup(String userPrincipalUid,
String groupPrincipalUid)
Add a user to a group. |
protected Attributes |
defineLdapAttributes(String principalUid)
A template method for defining the attributes for a particular LDAP class. |
private List |
getAttributes(Attribute attr)
|
private Attributes |
getFirstUser(NamingEnumeration results)
|
private String[] |
getGroups(NamingEnumeration results,
String uid)
Get the groups. |
String[] |
getGroupUidsForUser(String userPrincipalUid)
Return an array of the group principal UIDS that belong to a specific user. |
protected String |
getObjectClass()
A template method that returns the LDAP object class of the concrete DAO. |
String[] |
getUserUidsForGroup(String groupPrincipalUid)
Return an array of the user principal UIDS that belong to a group. |
protected Principal |
makePrincipal(String principalUid)
Creates a GroupPrincipal object. |
private void |
modifyUserGroup(String userPrincipalUid,
String groupPrincipalUid,
int operationType)
Replace or delete the user group attribute. |
void |
removeGroup(String userPrincipalUid,
String groupPrincipalUid)
Remove a user from a group. |
private NamingEnumeration |
searchUserByGroup(String groupPrincipalUid,
SearchControls cons)
Search user by group. |
| Methods inherited from class org.apache.jetspeed.security.spi.impl.ldap.LdapPrincipalDaoImpl |
convertUidFromLdapAcceptableName, convertUidToLdapAcceptableName, create, delete, find, getAttribute |
| Methods inherited from class org.apache.jetspeed.security.spi.impl.ldap.AbstractLdapDao |
bindToServer, getSubcontextName, lookupByUid, searchByWildcardedUid, 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.LdapPrincipalDao |
create, delete, find |
| Methods inherited from interface org.apache.jetspeed.security.spi.impl.ldap.LdapReadOnlyPrincipalDao |
lookupByUid |
| Field Detail |
private static final org.apache.commons.logging.Log LOG
private static final String GROUP_ATTR_NAME
| Constructor Detail |
public LdapUserPrincipalDaoImpl()
throws NamingException,
org.apache.jetspeed.security.SecurityException
Default constructor.
NamingException - A NamingException.
org.apache.jetspeed.security.SecurityException - A SecurityException.
public LdapUserPrincipalDaoImpl(String ldapServerName,
String rootDn,
String rootPassword,
String rootContext,
String defaultDnSuffix)
throws NamingException,
org.apache.jetspeed.security.SecurityException
Initializes the dao.
ldapServerName - The server name.rootDn - The root domain.rootPassword - The root password.rootContext - The root context.defaultDnSuffix - The default suffix.
NamingException - A NamingException.
org.apache.jetspeed.security.SecurityException - A SecurityException.| Method Detail |
public void addGroup(String userPrincipalUid,
String groupPrincipalUid)
throws org.apache.jetspeed.security.SecurityException
LdapUserPrincipalDaoAdd a user to a group.
addGroup in interface LdapUserPrincipalDaouserPrincipalUid - The user principal.groupPrincipalUid - The group principal.
org.apache.jetspeed.security.SecurityException - A SecurityException.LdapUserPrincipalDao.addGroup(java.lang.String, java.lang.String)
private void modifyUserGroup(String userPrincipalUid,
String groupPrincipalUid,
int operationType)
throws org.apache.jetspeed.security.SecurityException
Replace or delete the user group attribute.
userPrincipalUid - groupPrincipalUid - operationType - whether to replace or remove the specified user
group from the user
org.apache.jetspeed.security.SecurityException - A SecurityException.
public void removeGroup(String userPrincipalUid,
String groupPrincipalUid)
throws org.apache.jetspeed.security.SecurityException
LdapUserPrincipalDaoRemove a user from a group.
removeGroup in interface LdapUserPrincipalDaouserPrincipalUid - The user principal.groupPrincipalUid - The group principal.
org.apache.jetspeed.security.SecurityException - A SecurityException.LdapUserPrincipalDao.removeGroup(java.lang.String, java.lang.String)protected Attributes defineLdapAttributes(String principalUid)
A template method for defining the attributes for a particular LDAP class.
defineLdapAttributes in class LdapPrincipalDaoImplprincipalUid - The principal uid.
protected Principal makePrincipal(String principalUid)
Creates a GroupPrincipal object.
makePrincipal in class LdapPrincipalDaoImplprincipalUid - The principal uid.
protected String getObjectClass()
A template method that returns the LDAP object class of the concrete DAO.
getObjectClass in class AbstractLdapDao
public String[] getUserUidsForGroup(String groupPrincipalUid)
throws org.apache.jetspeed.security.SecurityException
Return an array of the user principal UIDS that belong to a group.
getUserUidsForGroup in interface LdapUserPrincipalDaogroupPrincipalUid - The group principal uid.
org.apache.jetspeed.security.SecurityException - A SecurityException.
private NamingEnumeration searchUserByGroup(String groupPrincipalUid,
SearchControls cons)
throws NamingException
Search user by group.
groupPrincipalUid - cons -
NamingException - A NamingException.
public String[] getGroupUidsForUser(String userPrincipalUid)
throws org.apache.jetspeed.security.SecurityException
LdapUserPrincipalDaoReturn an array of the group principal UIDS that belong to a specific user.
getGroupUidsForUser in interface LdapUserPrincipalDaouserPrincipalUid -
org.apache.jetspeed.security.SecurityException
private String[] getGroups(NamingEnumeration results,
String uid)
throws NamingException
Get the groups.
results - uid -
NamingException
private Attributes getFirstUser(NamingEnumeration results)
throws NamingException
results -
NamingException
private List getAttributes(Attribute attr)
throws NamingException
attr -
NamingException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||