org.apache.james.api.user.management
Interface UserManagementMBean

All Known Implementing Classes:
UserManagement

public interface UserManagementMBean

Expose user account management functionality through JMX.


Method Summary
 boolean addUser(java.lang.String userName, java.lang.String password, java.lang.String repositoryName)
          Adds a user to this mail server.
 long countUsers(java.lang.String repositoryName)
          Total count of existing users
 boolean deleteUser(java.lang.String userName, java.lang.String repositoryName)
          Deletes a user from this mail server.
 java.lang.String getAlias(java.lang.String userName, java.lang.String repositoryName)
          Retrieves the user's alias, if set
 java.lang.String getForwardAddress(java.lang.String userName, java.lang.String repositoryName)
          Retrieves the user's forward, if set
 java.util.List getUserRepositoryNames()
          Retrieves a list of the names of all available user repositories
 java.lang.String[] listAllUsers(java.lang.String repositoryName)
          List the names of all users
 boolean setAlias(java.lang.String userName, java.lang.String aliasUserName, java.lang.String repositoryName)
          Set a user's alias to whom all mail is forwarded to
 boolean setForwardAddress(java.lang.String userName, java.lang.String forwardEmailAddress, java.lang.String repositoryName)
          Set a user's forward email address to whom all mail is forwarded to
 boolean setPassword(java.lang.String userName, java.lang.String password, java.lang.String repositoryName)
          Set a user's password
 boolean unsetAlias(java.lang.String userName, java.lang.String repositoryName)
          Removes a user's alias which terminates local mail forwarding
 boolean unsetForwardAddress(java.lang.String userName, java.lang.String repositoryName)
          Removes a user's forward email address which terminates remote mail forwarding
 boolean verifyExists(java.lang.String userName, java.lang.String repositoryName)
          Check if a user exists with the given name.
 

Method Detail

addUser

boolean addUser(java.lang.String userName,
                java.lang.String password,
                java.lang.String repositoryName)
                throws UserManagementException
Adds a user to this mail server.

Parameters:
userName - The name of the user being added
password - The password of the user being added
repositoryName - The user repository, to which the operation should be applied. If NULL, the LocalUsers repository is used.
Returns:
if the operation was successfull
Throws:
UserManagementException

deleteUser

boolean deleteUser(java.lang.String userName,
                   java.lang.String repositoryName)
                   throws UserManagementException
Deletes a user from this mail server.

Parameters:
userName - The name of the user being deleted
repositoryName - The user repository, to which the operation should be applied. If NULL, the LocalUsers repository is used.
Returns:
if the operation was successfull
Throws:
UserManagementException

verifyExists

boolean verifyExists(java.lang.String userName,
                     java.lang.String repositoryName)
                     throws UserManagementException
Check if a user exists with the given name.

Parameters:
userName - The name of the user
repositoryName - The user repository, to which the operation should be applied. If NULL, the LocalUsers repository is used.
Returns:
TRUE, if the user exists
Throws:
UserManagementException

countUsers

long countUsers(java.lang.String repositoryName)
                throws UserManagementException
Total count of existing users

Parameters:
repositoryName - The user repository, to which the operation should be applied. If NULL, the LocalUsers repository is used.
Returns:
Total count of existing users
Throws:
UserManagementException

listAllUsers

java.lang.String[] listAllUsers(java.lang.String repositoryName)
                                throws UserManagementException
List the names of all users

Parameters:
repositoryName - The user repository, to which the operation should be applied. If NULL, the LocalUsers repository is used.
Returns:
List of all user names
Throws:
UserManagementException

setPassword

boolean setPassword(java.lang.String userName,
                    java.lang.String password,
                    java.lang.String repositoryName)
                    throws UserManagementException
Set a user's password

Parameters:
userName - The name of the user whose password will be changed
password - The new password
repositoryName - The user repository, to which the operation should be applied. If NULL, the LocalUsers repository is used.
Returns:
if the user has been found and the password was changed successfully
Throws:
UserManagementException

setAlias

boolean setAlias(java.lang.String userName,
                 java.lang.String aliasUserName,
                 java.lang.String repositoryName)
                 throws UserManagementException
Set a user's alias to whom all mail is forwarded to

Parameters:
userName - The name of the user whose alias is set
aliasUserName - The user becoming the new alias
repositoryName - The user repository, to which the operation should be applied. If NULL, the LocalUsers repository is used.
Returns:
if the user has been found and the password was changed successfully
Throws:
UserManagementException

unsetAlias

boolean unsetAlias(java.lang.String userName,
                   java.lang.String repositoryName)
                   throws UserManagementException
Removes a user's alias which terminates local mail forwarding

Parameters:
userName - The name of the user whose alias is unset
repositoryName - The user repository, to which the operation should be applied. If NULL, the LocalUsers repository is used.
Returns:
if the user has been found and the alias was removed
Throws:
UserManagementException

getAlias

java.lang.String getAlias(java.lang.String userName,
                          java.lang.String repositoryName)
                          throws UserManagementException
Retrieves the user's alias, if set

Parameters:
repositoryName - The user repository, to which the operation should be applied. If NULL, the LocalUsers repository is used.
Returns:
User's alias, or NULL, if no alias is set
Throws:
UserManagementException

setForwardAddress

boolean setForwardAddress(java.lang.String userName,
                          java.lang.String forwardEmailAddress,
                          java.lang.String repositoryName)
                          throws UserManagementException
Set a user's forward email address to whom all mail is forwarded to

Parameters:
userName - The name of the user whose forward is set
forwardEmailAddress - The new forward email address
repositoryName - The user repository, to which the operation should be applied. If NULL, the LocalUsers repository is used.
Returns:
if the user has been found and the password was changed successfully
Throws:
UserManagementException

unsetForwardAddress

boolean unsetForwardAddress(java.lang.String userName,
                            java.lang.String repositoryName)
                            throws UserManagementException
Removes a user's forward email address which terminates remote mail forwarding

Parameters:
userName - The name of the user whose forward is unset
repositoryName - The user repository, to which the operation should be applied. If NULL, the LocalUsers repository is used.
Returns:
if the user has been found and the forward was removed
Throws:
UserManagementException

getForwardAddress

java.lang.String getForwardAddress(java.lang.String userName,
                                   java.lang.String repositoryName)
                                   throws UserManagementException
Retrieves the user's forward, if set

Parameters:
userName - The name of the user whose forward is set
repositoryName - The user repository, to which the operation should be applied. If NULL, the LocalUsers repository is used.
Returns:
User's forward email address, or NULL, if no forward is set
Throws:
UserManagementException

getUserRepositoryNames

java.util.List getUserRepositoryNames()
Retrieves a list of the names of all available user repositories

Returns:
List of repository names


Copyright ? 2002-2009 The Apache Software Foundation. All Rights Reserved.