|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.jetspeed.security.spi.impl.ldap.AbstractLdapDao org.apache.jetspeed.security.spi.impl.ldap.LdapPrincipalDaoImpl
public abstract class LdapPrincipalDaoImpl
LdapPrincipalDao
Field Summary | |
---|---|
private static org.apache.commons.logging.Log |
logger
The logger. |
Fields inherited from class org.apache.jetspeed.security.spi.impl.ldap.AbstractLdapDao |
---|
ctx |
Constructor Summary | |
---|---|
LdapPrincipalDaoImpl()
Default constructor. |
|
LdapPrincipalDaoImpl(LdapBindingConfig ldapConfig)
Initializes the dao. |
Method Summary | |
---|---|
private void |
buildPrincipal(Collection principals,
SearchResult searchResult)
|
private Principal[] |
convertPrincipalListToArray(Collection principals)
Converts a list of principals to an array of principals. |
String |
convertUidToLdapAcceptableName(String fullPath)
Converts the uid to an ldap acceptable name. |
private String |
convertUidWithoutSlashes(String uid)
Returns a well formed uid for LDAP. |
void |
create(String principalUid)
Makes a new ldap entry for the specified principal. |
protected abstract Attributes |
defineLdapAttributes(String principalUid)
A template method for defining the attributes for a particular LDAP class. |
void |
delete(String principalUid)
Deletes a ldap entry for the specified principal. |
private void |
enumerateOverSearchResults(NamingEnumeration searchResults,
Collection principals)
Build the user principal by enumerating through the search results. |
Principal[] |
find(String principalUid,
String principalType)
Search the ldap directory for the principal. |
protected Attribute |
getAttribute(String attributeName,
Attributes userAttributes)
|
protected abstract String |
getDnSuffix()
Builds the dn suffix. |
protected String |
getGroupDN(String groupPrincipalUid)
|
protected String |
getGroupDN(String groupPrincipalUid,
boolean includeBaseDN)
|
protected String |
getRoleDN(String rolePrincipalUid)
|
protected String |
getRoleDN(String rolePrincipalUid,
boolean includeBaseDN)
|
protected String |
getSearchDomain()
The domain in wich to perform a search |
protected abstract String |
getUidAttributeForPrincipal()
Builds the dn suffix. |
protected String |
getUserDN(String userPrincipalUid)
|
protected String |
getUserDN(String userPrincipalUid,
boolean includeBaseDN)
|
protected abstract Principal |
makePrincipal(String principalUid)
A template method for creating a concrete principal object. |
protected String[] |
parseAttr(String attr,
String replace)
|
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 |
Field Detail |
---|
private static final org.apache.commons.logging.Log logger
Constructor Detail |
---|
public LdapPrincipalDaoImpl() throws org.apache.jetspeed.security.SecurityException
Default constructor.
org.apache.jetspeed.security.SecurityException
- A SecurityException
.public LdapPrincipalDaoImpl(LdapBindingConfig ldapConfig) throws org.apache.jetspeed.security.SecurityException
Initializes the dao.
ldapConfig
- Holds the ldap binding configuration.
org.apache.jetspeed.security.SecurityException
- A SecurityException
.Method Detail |
---|
protected abstract Principal makePrincipal(String principalUid)
A template method for creating a concrete principal object.
principalUid
- The principal uid.
protected abstract Attributes defineLdapAttributes(String principalUid)
A template method for defining the attributes for a particular LDAP class.
principalUid
- The principal uid.
public void create(String principalUid) throws org.apache.jetspeed.security.SecurityException
LdapPrincipalDao
Makes a new ldap entry for the specified principal.
create
in interface LdapPrincipalDao
principalUid
- The principal uid.
org.apache.jetspeed.security.SecurityException
- Throws a SecurityException
.LdapPrincipalDao.create(java.lang.String)
protected abstract String getDnSuffix()
Builds the dn suffix.
protected abstract String getUidAttributeForPrincipal()
Builds the dn suffix.
public void delete(String principalUid) throws org.apache.jetspeed.security.SecurityException
LdapPrincipalDao
Deletes a ldap entry for the specified principal.
delete
in interface LdapPrincipalDao
principalUid
- The principal uid.
org.apache.jetspeed.security.SecurityException
- Throws a SecurityException
.LdapPrincipalDao.delete(java.lang.String)
public String convertUidToLdapAcceptableName(String fullPath)
LdapPrincipalDao
Converts the uid to an ldap acceptable name.
convertUidToLdapAcceptableName
in interface LdapPrincipalDao
fullPath
- The uid.
LdapPrincipalDao.convertUidToLdapAcceptableName(java.lang.String)
private String convertUidWithoutSlashes(String uid)
Returns a well formed uid for LDAP.
uid
- The uid.
public Principal[] find(String principalUid, String principalType) throws org.apache.jetspeed.security.SecurityException
LdapPrincipalDao
Search the ldap directory for the principal.
find
in interface LdapPrincipalDao
principalUid
- The uid value of the principal.principalType
- The type of principal.
org.apache.jetspeed.security.SecurityException
LdapPrincipalDao.find(java.lang.String,
java.lang.String)
private Principal[] convertPrincipalListToArray(Collection principals)
Converts a list of principals to an array of principals.
principals
- The list of principals.
private void enumerateOverSearchResults(NamingEnumeration searchResults, Collection principals) throws NamingException
Build the user principal by enumerating through the search results.
searchResults
- The NamingEnumeration
of results.principals
- The collection of user principals.
NamingException
- Throws a NamingException
.private void buildPrincipal(Collection principals, SearchResult searchResult) throws NamingException
principals
- The collection of principals.searchResult
- The SearchResult
NamingException
- Throws a NamingException
.protected Attribute getAttribute(String attributeName, Attributes userAttributes) throws NamingException
attributeName
- The attribute name.userAttributes
- The user Attributes
.
Attribute
.
NamingException
- Throws a NamingException
.protected String getSearchDomain()
AbstractLdapDao
The domain in wich to perform a search
TODO : this should be in spring config
getSearchDomain
in class AbstractLdapDao
protected String[] parseAttr(String attr, String replace)
protected String getGroupDN(String groupPrincipalUid)
protected String getGroupDN(String groupPrincipalUid, boolean includeBaseDN)
protected String getRoleDN(String rolePrincipalUid)
protected String getRoleDN(String rolePrincipalUid, boolean includeBaseDN)
protected String getUserDN(String userPrincipalUid)
protected String getUserDN(String userPrincipalUid, boolean includeBaseDN)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |