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.
 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 resetPassword(String userId, String newPassword)
          Reset the password of a user.
 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.

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.


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