org.apache.jetspeed.security
Interface UserManager


public interface UserManager

Describes the interface for managing users and provides access to the User.

Author:
David Le Strat

Method Summary
 void addUser(String username, String password)
           Add a new user provided a username and password.
 void addUser(String username, String password, String atnProviderName)
           Add a new user provided a username and password in the specified authentication provider store.
 boolean authenticate(String username, String password)
           Authenticate a user.
 String getAnonymousUser()
           
 User getUser(String username)
           Get a Userfor a given username.
 Iterator getUsers(String filter)
           An iterator of Userfinding users matching the corresponding filter criteria.
 Collection getUsersInGroup(String groupFullPathName)
          A collection of User for a specific group.
 Collection getUsersInRole(String roleFullPathName)
           A collection of Userfor all the users in a specific role.
 void removeUser(String username)
           Remove a user.
 void setPassword(String username, String oldPassword, String newPassword)
           Set the user password.
 void setPasswordEnabled(String userName, boolean enabled)
           Set the enabled state of the user password credential.
 void setPasswordExpiration(String userName, Date expirationDate)
           Set the expiration date and the expired flag of the password credential.
 void setPasswordUpdateRequired(String userName, boolean updateRequired)
           Set the update required state of the user password credential.
 void setUserEnabled(String userName, boolean enabled)
          Enable or disable a user.
 boolean userExists(String username)
           Whether or not a user exists.
 

Method Detail

getAnonymousUser

public String getAnonymousUser()
Returns:
the name of the anonymous user

authenticate

public boolean authenticate(String username,
                            String password)

Authenticate a user.

Parameters:
username - The user name.
password - The user password.
Returns:
Whether or not a user is authenticated.

addUser

public void addUser(String username,
                    String password)
             throws SecurityException

Add a new user provided a username and password.

Parameters:
username - The user name.
password - The password.
Throws:
Throws - a security exception.
SecurityException

addUser

public void addUser(String username,
                    String password,
                    String atnProviderName)
             throws SecurityException

Add a new user provided a username and password in the specified authentication provider store.

Parameters:
username - The user name.
password - The password.
atnProviderName - The authentication provider name.
Throws:
Throws - a security exception.
SecurityException

removeUser

public void removeUser(String username)
                throws SecurityException

Remove a user. If there is a Preferencesnode for profile properties associated to this user, it will be removed as well.

Permissionfor this user will be removed as well.

Parameters:
username - The user name.
Throws:
Throws - a security exception.
SecurityException

userExists

public boolean userExists(String username)

Whether or not a user exists.

Parameters:
username - The user name.
Returns:
Whether or not a user exists.

getUser

public User getUser(String username)
             throws SecurityException

Get a Userfor a given username.

Parameters:
username - The username.
Returns:
The User.
Throws:
Throws - a security exception if the user cannot be found.
SecurityException

getUsers

public Iterator getUsers(String filter)
                  throws SecurityException

An iterator of Userfinding users matching the corresponding filter criteria.

Current implementation only allows for getting back all users with "" as a fitler.

TODO Complete filter implementation.

Parameters:
filter - The filter used to retrieve matching users.
Returns:
The Iterator of User.
Throws:
SecurityException

getUsersInRole

public Collection getUsersInRole(String roleFullPathName)
                          throws SecurityException

A collection of Userfor all the users in a specific role.

Parameters:
roleFullPathName - The role name full path (e.g. theRoleName.theRoleNameChild).
Returns:
A Collection of User.
Throws:
Throws - a security exception if the role does not exist.
SecurityException

getUsersInGroup

public Collection getUsersInGroup(String groupFullPathName)
                           throws SecurityException

A collection of User for a specific group.

Parameters:
groupFullPathName - The group name full path (e.g. theGroupName.theGroupChildName).
Returns:
A collection of User.
Throws:
Throws - security exception if the group does not exist.
SecurityException

setPassword

public void setPassword(String username,
                        String oldPassword,
                        String newPassword)
                 throws SecurityException

Set the user password.

Parameters:
username - The user name.
oldPassword - The old password.
newPassword - The new password.
Throws:
Throws - a security exception.
SecurityException

setPasswordUpdateRequired

public void setPasswordUpdateRequired(String userName,
                                      boolean updateRequired)
                               throws SecurityException

Set the update required state of the user password credential.

Parameters:
userName - The user name.
updateRequired - The update required state.
Throws:
Throws - a security exception.
SecurityException

setPasswordEnabled

public void setPasswordEnabled(String userName,
                               boolean enabled)
                        throws SecurityException

Set the enabled state of the user password credential.

Parameters:
userName - The user name.
enabled - The enabled state.
Throws:
Throws - a security exception.
SecurityException

setUserEnabled

public void setUserEnabled(String userName,
                           boolean enabled)
                    throws SecurityException
Enable or disable a user.

Parameters:
userName - The user name
enabled - enabled flag for the user
Throws:
SecurityException

setPasswordExpiration

public void setPasswordExpiration(String userName,
                                  Date expirationDate)
                           throws SecurityException

Set the expiration date and the expired flag of the password credential.

If a date equal or before the current date is provided, the expired flag will be set to true, otherwise to false.

Parameters:
userName - The user name.
expirationDate - The expiration date to set.
Throws:
Throws - a security exception.
SecurityException


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