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

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

public class LdapUserSecurityHandler
extends Object
implements UserSecurityHandler

Author:
Mike Long
See Also:
UserSecurityHandler

Field Summary
private  LdapPrincipalDao ldap
          The LdapPrincipalDao.
private static org.apache.commons.logging.Log LOG
          The logger.
 
Constructor Summary
LdapUserSecurityHandler()
           Default constructor.
LdapUserSecurityHandler(LdapPrincipalDao ldap)
           
 
Method Summary
 void addUserPrincipal(org.apache.jetspeed.security.UserPrincipal userPrincipal)
           Adds a new user principal in the backing store.
 Principal getUserPrincipal(String uid)
           Gets the user principal for the given user name.
 List getUserPrincipals(String filter)
           Gets the an iterator of user principals for a given 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)
           Removes the user principal.
 void updateUserPrincipal(org.apache.jetspeed.security.UserPrincipal userPrincipal)
           Updates the user principal in the backing store.
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

LOG

private static final org.apache.commons.logging.Log LOG
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.

Method Detail

isUserPrincipal

public boolean isUserPrincipal(String uid)

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

Specified by:
isUserPrincipal in interface UserSecurityHandler
Parameters:
uid -
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)
Description copied from interface: UserSecurityHandler

Gets the user principal for the given user name.

Specified by:
getUserPrincipal in interface UserSecurityHandler
Parameters:
uid - The user name.
Returns:
The Principal

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)
Description copied from interface: UserSecurityHandler

Gets the an iterator of user principals for a given filter.

Specified by:
getUserPrincipals in interface UserSecurityHandler
Parameters:
filter - The filter.
Returns:
The list of Principal
See Also:
UserSecurityHandler.getUserPrincipals(java.lang.String)

addUserPrincipal

public void addUserPrincipal(org.apache.jetspeed.security.UserPrincipal userPrincipal)
                      throws org.apache.jetspeed.security.SecurityException
Description copied from interface: UserSecurityHandler

Adds a new user principal in the backing store.

Specified by:
addUserPrincipal in interface UserSecurityHandler
Parameters:
userPrincipal - The new UserPrincipal.
Throws:
org.apache.jetspeed.security.SecurityException - Throws a 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
Description copied from interface: UserSecurityHandler

Updates the user principal in the backing store.

Specified by:
updateUserPrincipal in interface UserSecurityHandler
Parameters:
userPrincipal - The UserPrincipal.
Throws:
org.apache.jetspeed.security.SecurityException - Throws a 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
Description copied from interface: UserSecurityHandler

Removes the user principal.

Specified by:
removeUserPrincipal in interface UserSecurityHandler
Parameters:
userPrincipal - The UserPrincipal.
Throws:
org.apache.jetspeed.security.SecurityException - Throws a SecurityException.
See Also:
UserSecurityHandler.removeUserPrincipal(org.apache.jetspeed.security.UserPrincipal)


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