GigaSpaces XAP 9.7.2 API

com.gigaspaces.security.directory
Interface UserManager


public interface UserManager

The main interface for managing user details.

Since:
7.0.1
Author:
Moran Avigdor
See Also:
DirectoryManager

Method Summary
 void createUser(UserDetails userDetails)
          Create a new user with the specified userDetails.
 void deleteUser(String username)
          Delete an existing user represented by the specified username.
 UserDetails getUser(String username)
          Retrieve the user details by username.
 boolean isReadOnly()
          Indicates that this manager is for read-only purposes, and that any invocation of a destructive operation will throw an AccessDeniedException.
 Map<String,UserDetails> mapUsers()
          Returns a map containing mapping between username and user-details.
 void updateUser(UserDetails userDetails)
          Updates the user details, excluding the username which must remain the same.
 boolean userExists(String username)
          Queries for presence of a user by username.
 

Method Detail

isReadOnly

boolean isReadOnly()
Indicates that this manager is for read-only purposes, and that any invocation of a destructive operation will throw an AccessDeniedException.

Returns:
true if read-only access is allowed.

createUser

void createUser(UserDetails userDetails)
                throws UserAlreadyExistsException,
                       UserDataAccessException,
                       AccessDeniedException
Create a new user with the specified userDetails.

Parameters:
userDetails - new user details to store.
Throws:
UserAlreadyExistsException - if the user details represent a non-unique user
UserDataAccessException - if could not store the specified user details.
AccessDeniedException - if read-only access is allowed.

deleteUser

void deleteUser(String username)
                throws UserNotFoundException,
                       UserDataAccessException,
                       AccessDeniedException
Delete an existing user represented by the specified username.

Parameters:
username - an existing user name.
Throws:
UserNotFoundException - if the user was not found.
UserDataAccessException - if could not delete the specified user details.
AccessDeniedException - if read-only access is allowed.

getUser

UserDetails getUser(String username)
                    throws UserNotFoundException,
                           UserDataAccessException
Retrieve the user details by username.

Parameters:
username - an existing user to retrieve.
Returns:
the user details of the specified user.
Throws:
UserNotFoundException - if the user was not found.
UserDataAccessException - if could not retrieve the specified user details.

mapUsers

Map<String,UserDetails> mapUsers()
                                 throws UserDataAccessException
Returns a map containing mapping between username and user-details.

Returns:
a mapping between username and user-details.
Throws:
UserDataAccessException - if could not retrieve user-details to map.

updateUser

void updateUser(UserDetails userDetails)
                throws UserNotFoundException,
                       UserDataAccessException,
                       AccessDeniedException
Updates the user details, excluding the username which must remain the same. In order to update a username, a user must be removed and re-created. A password on the other hand, may require encryption, only if it was modified.

Parameters:
userDetails - the user details to update.
Throws:
UserNotFoundException - if the user was not found.
UserDataAccessException - if could not update the user details.
AccessDeniedException - if read-only access is allowed.

userExists

boolean userExists(String username)
                   throws UserDataAccessException
Queries for presence of a user by username.

Parameters:
username - the user to check existence for.
Returns:
true if the user exists; false otherwise.
Throws:
UserDataAccessException - if could not query for the specified user.

GigaSpaces XAP 9.7.2 API

Copyright © GigaSpaces.