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 getUserNames(String filter)
           An iterator of user names, finding users matching the corresponding filter criteria.
 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 importUser(String username, String password, boolean passThrough)
           Import a new user with username and password and allow to bypass the enconding algorithm
 void importUser(String username, String password, String atnProviderName, boolean passThrough)
           Import a new user with username and password in the specified authentication provider store and allow to bypass the enconding algorithm
 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

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

authenticate

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

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

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

importUser

void importUser(String username,
                String password,
                boolean passThrough)
                throws SecurityException

Import a new user with username and password and allow to bypass the enconding algorithm

Parameters:
username - The user name.
password - The password.
passThrough - If true the provided password will not be validated/encoded
Throws:
Throws - a security exception.
SecurityException

importUser

void importUser(String username,
                String password,
                String atnProviderName,
                boolean passThrough)
                throws SecurityException

Import a new user with username and password in the specified authentication provider store and allow to bypass the enconding algorithm

Parameters:
username - The user name.
password - The password.
atnProviderName - The authentication provider name.
passThrough - If true the provided password will not be validated/encoded
Throws:
Throws - a security exception.
SecurityException

removeUser

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

boolean userExists(String username)

Whether or not a user exists.

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

getUser

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

Iterator getUsers(String filter)
                  throws SecurityException

An iterator of Userfinding users matching the corresponding filter criteria.

TODO Complete filter implementation.

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

getUserNames

Iterator getUserNames(String filter)
                      throws SecurityException

An iterator of user names, finding users matching the corresponding filter criteria.

TODO Complete filter implementation.

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

getUsersInRole

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

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

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

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

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

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

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-2007 Apache Software Foundation. All Rights Reserved.