org.apache.jetspeed.security.spi.impl
Class LdapUserSecurityHandler

java.lang.Object
  extended by org.apache.jetspeed.security.spi.impl.LdapUserSecurityHandler
All Implemented Interfaces:
org.apache.jetspeed.security.spi.UserSecurityHandler

public class LdapUserSecurityHandler
extends Object
implements org.apache.jetspeed.security.spi.UserSecurityHandler

Author:
Mike Long
See Also:
UserSecurityHandler

Field Summary
private  LdapPrincipalDao ldap
          The LdapPrincipalDao.
private static org.apache.commons.logging.Log logger
          The logger.
 
Constructor Summary
LdapUserSecurityHandler()
           Default constructor.
LdapUserSecurityHandler(LdapPrincipalDao ldap)
           
 
Method Summary
 void addUserPrincipal(org.apache.jetspeed.security.UserPrincipal userPrincipal)
           
 Principal getUserPrincipal(String uid)
           
 List getUserPrincipals(String filter)
           
 boolean isUserPrincipal(String uid)
           Lookup the user by his UID attribute on the Ldap Server.
private  void logSecurityException(org.apache.jetspeed.security.SecurityException se, String uid)
           
 void removeUserPrincipal(org.apache.jetspeed.security.UserPrincipal userPrincipal)
           
 void updateUserPrincipal(org.apache.jetspeed.security.UserPrincipal userPrincipal)
           
private  void verifyUid(String uid)
           Verify the uid.
private  void verifyUserPrincipal(org.apache.jetspeed.security.UserPrincipal userPrincipal)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static final org.apache.commons.logging.Log logger
The logger.


ldap

private LdapPrincipalDao ldap
The LdapPrincipalDao.

Constructor Detail

LdapUserSecurityHandler

public LdapUserSecurityHandler(LdapPrincipalDao ldap)
Parameters:
ldap - The LdapPrincipalDao.

LdapUserSecurityHandler

public LdapUserSecurityHandler()
                        throws NamingException,
                               org.apache.jetspeed.security.SecurityException

Default constructor.

Throws:
NamingException
org.apache.jetspeed.security.SecurityException
Method Detail

isUserPrincipal

public boolean isUserPrincipal(String uid)

Lookup the user by his UID attribute on the Ldap Server.

Specified by:
isUserPrincipal in interface org.apache.jetspeed.security.spi.UserSecurityHandler
Returns:
true if the Ldap Server finds a user with that UID; false if he is not found or some sort of NamingException occurred.
See Also:
UserSecurityHandler.isUserPrincipal(java.lang.String)

getUserPrincipal

public Principal getUserPrincipal(String uid)
Specified by:
getUserPrincipal in interface org.apache.jetspeed.security.spi.UserSecurityHandler
See Also:
UserSecurityHandler.getUserPrincipal(java.lang.String)

verifyUid

private void verifyUid(String uid)

Verify the uid.

Parameters:
uid - The uid.

logSecurityException

private void logSecurityException(org.apache.jetspeed.security.SecurityException se,
                                  String uid)
Parameters:
se - SecurityException Throws a SecurityException.
uid - The uid.

getUserPrincipals

public List getUserPrincipals(String filter)
Specified by:
getUserPrincipals in interface org.apache.jetspeed.security.spi.UserSecurityHandler
See Also:
UserSecurityHandler.getUserPrincipals(java.lang.String)

addUserPrincipal

public void addUserPrincipal(org.apache.jetspeed.security.UserPrincipal userPrincipal)
                      throws org.apache.jetspeed.security.SecurityException
Specified by:
addUserPrincipal in interface org.apache.jetspeed.security.spi.UserSecurityHandler
Throws:
org.apache.jetspeed.security.SecurityException
See Also:
UserSecurityHandler.addUserPrincipal(org.apache.jetspeed.security.UserPrincipal)

updateUserPrincipal

public void updateUserPrincipal(org.apache.jetspeed.security.UserPrincipal userPrincipal)
                         throws org.apache.jetspeed.security.SecurityException
Specified by:
updateUserPrincipal in interface org.apache.jetspeed.security.spi.UserSecurityHandler
Throws:
org.apache.jetspeed.security.SecurityException
See Also:
UserSecurityHandler.updateUserPrincipal(org.apache.jetspeed.security.UserPrincipal)

verifyUserPrincipal

private void verifyUserPrincipal(org.apache.jetspeed.security.UserPrincipal userPrincipal)
Parameters:
userPrincipal -

removeUserPrincipal

public void removeUserPrincipal(org.apache.jetspeed.security.UserPrincipal userPrincipal)
                         throws org.apache.jetspeed.security.SecurityException
Specified by:
removeUserPrincipal in interface org.apache.jetspeed.security.spi.UserSecurityHandler
Throws:
org.apache.jetspeed.security.SecurityException
See Also:
UserSecurityHandler.removeUserPrincipal(org.apache.jetspeed.security.UserPrincipal)


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