org.apache.jetspeed.security.impl
Class UserManagerImpl

java.lang.Object
  extended by org.apache.jetspeed.security.impl.UserManagerImpl
All Implemented Interfaces:
org.apache.jetspeed.security.UserManager

public class UserManagerImpl
extends Object
implements org.apache.jetspeed.security.UserManager

Implementation for managing users and provides access to the User.

Version:
$Id: UserManagerImpl.java 603894 2007-12-13 11:42:22Z woonsan $
Author:
David Le Strat

Field Summary
private  String anonymousUser
           
private  org.apache.jetspeed.security.AuthenticationProviderProxy atnProviderProxy
          The authenticatino provider proxy.
private  org.apache.jetspeed.security.User guest
           
private static org.apache.commons.logging.Log log
           
private  boolean rolesInheritableViaGroups
          Flag whether the principals's user group matches the user group to which the role has been mapped.
private  org.apache.jetspeed.security.spi.SecurityMappingHandler securityMappingHandler
          The security mapping handler.
 
Constructor Summary
UserManagerImpl(org.apache.jetspeed.security.SecurityProvider securityProvider)
           
UserManagerImpl(org.apache.jetspeed.security.SecurityProvider securityProvider, org.apache.jetspeed.security.HierarchyResolver roleHierarchyResolver, org.apache.jetspeed.security.HierarchyResolver groupHierarchyResolver)
           
UserManagerImpl(org.apache.jetspeed.security.SecurityProvider securityProvider, org.apache.jetspeed.security.HierarchyResolver roleHierarchyResolver, org.apache.jetspeed.security.HierarchyResolver groupHierarchyResolver, String anonymousUser)
           
UserManagerImpl(org.apache.jetspeed.security.SecurityProvider securityProvider, String anonymousUser)
           
 
Method Summary
 void addUser(String username, String password)
           
 void addUser(String username, String password, String atnProviderName)
           
 boolean authenticate(String username, String password)
           
protected  void createUser(String username, String password, String atnProviderName, boolean raw)
           
 String getAnonymousUser()
           
 org.apache.jetspeed.security.User getUser(String username)
           
 Iterator getUserNames(String filter)
           
 Iterator getUsers(String filter)
           
 Collection getUsersInGroup(String groupFullPathName)
           
 Collection getUsersInRole(String roleFullPathName)
           
 void importUser(String username, String password, boolean passThrough)
           
 void importUser(String username, String password, String atnProviderName, boolean passThrough)
           
 void removeUser(String username)
           
 void setPassword(String username, String oldPassword, String newPassword)
           
 void setPasswordEnabled(String userName, boolean enabled)
           
 void setPasswordExpiration(String userName, Date expirationDate)
           
 void setPasswordUpdateRequired(String userName, boolean updateRequired)
           
 void setRolesInheritableViaGroups(boolean rolesInheritableViaGroups)
           
 void setUserEnabled(String userName, boolean enabled)
           
 boolean userExists(String username)
           
 
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

atnProviderProxy

private org.apache.jetspeed.security.AuthenticationProviderProxy atnProviderProxy
The authenticatino provider proxy.


securityMappingHandler

private org.apache.jetspeed.security.spi.SecurityMappingHandler securityMappingHandler
The security mapping handler.


anonymousUser

private String anonymousUser

guest

private org.apache.jetspeed.security.User guest

rolesInheritableViaGroups

private boolean rolesInheritableViaGroups
Flag whether the principals's user group matches the user group to which the role has been mapped. (See SRV.12.4) If this flag is set to true, roles can be inherited to users via groups.

Constructor Detail

UserManagerImpl

public UserManagerImpl(org.apache.jetspeed.security.SecurityProvider securityProvider)
Parameters:
securityProvider - The security provider.

UserManagerImpl

public UserManagerImpl(org.apache.jetspeed.security.SecurityProvider securityProvider,
                       String anonymousUser)
Parameters:
securityProvider - The security provider.
anonymousUser - The anonymous user name

UserManagerImpl

public UserManagerImpl(org.apache.jetspeed.security.SecurityProvider securityProvider,
                       org.apache.jetspeed.security.HierarchyResolver roleHierarchyResolver,
                       org.apache.jetspeed.security.HierarchyResolver groupHierarchyResolver)
Parameters:
securityProvider - The security provider.
roleHierarchyResolver - The role hierachy resolver.
groupHierarchyResolver - The group hierarchy resolver.

UserManagerImpl

public UserManagerImpl(org.apache.jetspeed.security.SecurityProvider securityProvider,
                       org.apache.jetspeed.security.HierarchyResolver roleHierarchyResolver,
                       org.apache.jetspeed.security.HierarchyResolver groupHierarchyResolver,
                       String anonymousUser)
Parameters:
securityProvider - The security provider.
roleHierarchyResolver - The role hierachy resolver.
groupHierarchyResolver - The group hierarchy resolver.
anonymousUser - The anonymous user name
Method Detail

getAnonymousUser

public String getAnonymousUser()
Specified by:
getAnonymousUser in interface org.apache.jetspeed.security.UserManager

setRolesInheritableViaGroups

public void setRolesInheritableViaGroups(boolean rolesInheritableViaGroups)

authenticate

public boolean authenticate(String username,
                            String password)
Specified by:
authenticate in interface org.apache.jetspeed.security.UserManager
See Also:
UserManager.authenticate(java.lang.String, java.lang.String)

addUser

public void addUser(String username,
                    String password)
             throws org.apache.jetspeed.security.SecurityException
Specified by:
addUser in interface org.apache.jetspeed.security.UserManager
Throws:
org.apache.jetspeed.security.SecurityException
See Also:
UserManager.addUser(java.lang.String, java.lang.String)

addUser

public void addUser(String username,
                    String password,
                    String atnProviderName)
             throws org.apache.jetspeed.security.SecurityException
Specified by:
addUser in interface org.apache.jetspeed.security.UserManager
Throws:
org.apache.jetspeed.security.SecurityException
See Also:
UserManager.addUser(java.lang.String, java.lang.String, java.lang.String)

importUser

public void importUser(String username,
                       String password,
                       boolean passThrough)
                throws org.apache.jetspeed.security.SecurityException
Specified by:
importUser in interface org.apache.jetspeed.security.UserManager
Throws:
org.apache.jetspeed.security.SecurityException
See Also:
UserManager.importUser(java.lang.String, java.lang.String, boolean)

importUser

public void importUser(String username,
                       String password,
                       String atnProviderName,
                       boolean passThrough)
                throws org.apache.jetspeed.security.SecurityException
Specified by:
importUser in interface org.apache.jetspeed.security.UserManager
Throws:
org.apache.jetspeed.security.SecurityException
See Also:
UserManager.importUser(java.lang.String, java.lang.String, java.lang.String, boolean)

createUser

protected void createUser(String username,
                          String password,
                          String atnProviderName,
                          boolean raw)
                   throws org.apache.jetspeed.security.SecurityException
Throws:
org.apache.jetspeed.security.SecurityException
See Also:
UserManager.addUser(java.lang.String, java.lang.String, java.lang.String)

removeUser

public void removeUser(String username)
                throws org.apache.jetspeed.security.SecurityException
Specified by:
removeUser in interface org.apache.jetspeed.security.UserManager
Throws:
org.apache.jetspeed.security.SecurityException
See Also:
TODO Enforce that only administrators can do this.

userExists

public boolean userExists(String username)
Specified by:
userExists in interface org.apache.jetspeed.security.UserManager
See Also:
UserManager.userExists(java.lang.String)

getUser

public org.apache.jetspeed.security.User getUser(String username)
                                          throws org.apache.jetspeed.security.SecurityException
Specified by:
getUser in interface org.apache.jetspeed.security.UserManager
Throws:
org.apache.jetspeed.security.SecurityException
See Also:
UserManager.getUser(java.lang.String)

getUsers

public Iterator getUsers(String filter)
                  throws org.apache.jetspeed.security.SecurityException
Specified by:
getUsers in interface org.apache.jetspeed.security.UserManager
Throws:
org.apache.jetspeed.security.SecurityException
See Also:
UserManager.getUsers(java.lang.String)

getUserNames

public Iterator getUserNames(String filter)
                      throws org.apache.jetspeed.security.SecurityException
Specified by:
getUserNames in interface org.apache.jetspeed.security.UserManager
Throws:
org.apache.jetspeed.security.SecurityException
See Also:
UserManager.getUserNames(java.lang.String)

getUsersInRole

public Collection getUsersInRole(String roleFullPathName)
                          throws org.apache.jetspeed.security.SecurityException
Specified by:
getUsersInRole in interface org.apache.jetspeed.security.UserManager
Throws:
org.apache.jetspeed.security.SecurityException
See Also:
UserManager.getUsersInRole(java.lang.String)

getUsersInGroup

public Collection getUsersInGroup(String groupFullPathName)
                           throws org.apache.jetspeed.security.SecurityException
Specified by:
getUsersInGroup in interface org.apache.jetspeed.security.UserManager
Throws:
org.apache.jetspeed.security.SecurityException
See Also:
UserManager.getUsersInGroup(java.lang.String)

setPassword

public void setPassword(String username,
                        String oldPassword,
                        String newPassword)
                 throws org.apache.jetspeed.security.SecurityException
Specified by:
setPassword in interface org.apache.jetspeed.security.UserManager
Throws:
org.apache.jetspeed.security.SecurityException
See Also:
TODO Enforce that only administrators can do this.

setPasswordEnabled

public void setPasswordEnabled(String userName,
                               boolean enabled)
                        throws org.apache.jetspeed.security.SecurityException
Specified by:
setPasswordEnabled in interface org.apache.jetspeed.security.UserManager
Throws:
org.apache.jetspeed.security.SecurityException
See Also:
UserManager.setPasswordEnabled(java.lang.String, boolean)

setPasswordUpdateRequired

public void setPasswordUpdateRequired(String userName,
                                      boolean updateRequired)
                               throws org.apache.jetspeed.security.SecurityException
Specified by:
setPasswordUpdateRequired in interface org.apache.jetspeed.security.UserManager
Throws:
org.apache.jetspeed.security.SecurityException
See Also:
UserManager.setPasswordUpdateRequired(java.lang.String, boolean)

setUserEnabled

public void setUserEnabled(String userName,
                           boolean enabled)
                    throws org.apache.jetspeed.security.SecurityException
Specified by:
setUserEnabled in interface org.apache.jetspeed.security.UserManager
Throws:
org.apache.jetspeed.security.SecurityException
See Also:
UserManager.setUserEnabled(java.lang.String, boolean)

setPasswordExpiration

public void setPasswordExpiration(String userName,
                                  Date expirationDate)
                           throws org.apache.jetspeed.security.SecurityException
Specified by:
setPasswordExpiration in interface org.apache.jetspeed.security.UserManager
Throws:
org.apache.jetspeed.security.SecurityException
See Also:
UserManager.setPasswordExpiration(java.lang.String, java.sql.Date)


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