com.sas.hls.security.user
Interface UserService


public interface UserService

The user service provides methods to manage the life cycle of a user and to get information about a user defined in the system.


Method Summary
 User createUser(String userId, String displayName, String emailAddress, String password)
          Create a new user in the system.
 User createUserByCreateUserInfo(CreateUserInfo userInfo)
          Create a new user in the system.
 void deleteUser(String userId)
          Delete a user who has performed no actions in the system.
 Set<UserDescriptor> getAllUserDescriptors()
          Get the full client representation of all users defined in the system as UserDescriptors.
 Set<User> getAllUsers()
          Get the full client representation of all users defined in the system.
 User getUserByUserDescriptor(UserDescriptor userDescriptor)
          Get the full client representation of a user from their userDescriptor.
 User getUserByUserId(String userId)
          Get the full client representation of a user given their userId.
 UserDescriptor getUserDescriptorByUserId(String userId)
          Get the light-weight representation of the user with the specified userId.
 Set<UserDescriptor> getUserDescriptorsByUserIds(Set<String> userIds)
          Get the light-weight client representation for each provided userId who can be found in the system.
 Set<User> getUsersByUserDescriptors(Set<UserDescriptor> userDescriptors)
          Get the full client representations for each provided userDescriptor who can be found in the system.
 Set<User> getUsersByUserIds(Set<String> userIds)
          Get the full client representations for every userId who can be found in the system.
 void lockUser(String userId)
          Locks the user with the specified userId.
 void resetPassword(String userId, String newPassword)
          Reset the password of a user.
 void unlockUser(String userId)
          Unlocks the user with the specified userId.
 User updateUser(User user)
          Update a user in the system
 boolean userExists(String userId)
          Test to see if a user with the specified userId exists in the system.
 

Method Detail

createUserByCreateUserInfo

User createUserByCreateUserInfo(CreateUserInfo userInfo)
                                throws UserExistsException,
                                       UserPasswordException
Create a new user in the system.

Parameters:
userInfo - CreateUserInfo structure with values to use in the creation of a new user instance.
Returns:
The newly created user instance.
Throws:
UserExistsException - Thrown when a user with the specified userId already exists in the system.
UserPasswordException - Thrown when the initial password specified is not valid for the system.

createUser

User createUser(String userId,
                String displayName,
                String emailAddress,
                String password)
                throws UserExistsException,
                       UserPasswordException
Create a new user in the system.

Parameters:
userId - The userId of the user to create.
displayName - The displayName to be shown for the user.
emailAddress - The new user's email address.
password - The initial password value for this user.
Returns:
The newly created user instance.
Throws:
UserExistsException - Thrown when a user with the specified userId already exists in the system.
UserPasswordException - Thrown when the initial password specified is not valid for the system.

updateUser

User updateUser(User user)
                throws UserNotFoundException
Update a user in the system

Parameters:
user - The user to be updated.
Returns:
The updated user instance.
Throws:
UserNotFoundException - Thrown when a user with the specified userId can not be found in the system.

deleteUser

void deleteUser(String userId)
                throws UserNotFoundException,
                       UserDeleteException
Delete a user who has performed no actions in the system. Once a user has logged into the system, they can no longer be deleted and instead can be locked.

Parameters:
userId - The userId of the user to delete from the system.
Throws:
UserNotFoundException - Thrown when a user with the specified userId can not be found in the system.
UserDeleteException - Thrown when a user can not be deleted because they have previously logged into the system.

resetPassword

void resetPassword(String userId,
                   String newPassword)
                   throws UserNotFoundException,
                          UserPasswordException
Reset the password of a user.

Parameters:
userId - The userId of the user to be assigned a new password.
newPassword - The new password to assign to the user.
Throws:
UserNotFoundException - Thrown when a user with the specified userId can not be found in the system.
UserPasswordException - Thrown when the new password specified is not valid for the system.

userExists

boolean userExists(String userId)
Test to see if a user with the specified userId exists in the system.

Parameters:
userId - The userId to check.
Returns:
true if a user already exists with this userId in the system.

getUserByUserDescriptor

User getUserByUserDescriptor(UserDescriptor userDescriptor)
                             throws UserNotFoundException
Get the full client representation of a user from their userDescriptor.

Parameters:
userDescriptor - The userDescriptor of the user to fetch.
Returns:
The full client representation of the user.
Throws:
UserNotFoundException - Thrown when the user specified can not be found in the system.

getUserByUserId

User getUserByUserId(String userId)
                     throws UserNotFoundException
Get the full client representation of a user given their userId.

Parameters:
userId - The userId of the user to fetch.
Returns:
The user specified.
Throws:
UserNotFoundException - Thrown when a user with the specified userId can not be found in the system.

getUsersByUserIds

Set<User> getUsersByUserIds(Set<String> userIds)
Get the full client representations for every userId who can be found in the system.

Parameters:
userIds - The list of userIds of the users desired.
Returns:
The list of users that were successfully found.

getUsersByUserDescriptors

Set<User> getUsersByUserDescriptors(Set<UserDescriptor> userDescriptors)
Get the full client representations for each provided userDescriptor who can be found in the system.

Parameters:
userDescriptors - The list of userDescriptors for the users desired.
Returns:
The list of users that were successfully found.

getUserDescriptorByUserId

UserDescriptor getUserDescriptorByUserId(String userId)
                                         throws UserNotFoundException
Get the light-weight representation of the user with the specified userId.

Parameters:
userId - The userId of the desired user.
Returns:
The specified user.
Throws:
UserNotFoundException - Thrown when a user with the specified userId can not be found in the system.

getUserDescriptorsByUserIds

Set<UserDescriptor> getUserDescriptorsByUserIds(Set<String> userIds)
Get the light-weight client representation for each provided userId who can be found in the system.

Parameters:
userIds - The list of desired userIds.
Returns:
The list of userDescriptors that were successfully found.

lockUser

void lockUser(String userId)
              throws UserNotFoundException
Locks the user with the specified userId.

Parameters:
userId - The userId of the desired user.
Throws:
UserNotFoundException - Thrown when a user with the specified userId can not be found in the system.

unlockUser

void unlockUser(String userId)
                throws UserNotFoundException
Unlocks the user with the specified userId.

Parameters:
userId - The userId of the desired user.
Throws:
UserNotFoundException - Thrown when a user with the specified userId can not be found in the system.

getAllUsers

Set<User> getAllUsers()
Get the full client representation of all users defined in the system.

Returns:
Set The list of Users defined in the system

getAllUserDescriptors

Set<UserDescriptor> getAllUserDescriptors()
Get the full client representation of all users defined in the system as UserDescriptors.

Returns:
Set The list of UserDescriptors defined in the system


Copyright (c) 2014, SAS Institute Inc., Cary, NC, USA