public interface UserService
LsafClient.getUserService()
,
ServiceManager.getUserService()
Modifier and Type | Method and Description |
---|---|
void |
changePassword(String oldPassword,
String newPassword)
Changes the current user password.
|
User |
createUser(UserCreateInfo userInfo)
Creates a user in the system.
|
void |
deleteUser(String userId)
Deletes a user who has performed no actions in the system.
|
String |
encryptPassword(byte[] password)
Gets an encrypted version of a password.
|
Set<UserDescriptor> |
getAllUserDescriptors()
Gets the lightweight representation of all users that are defined in the system.
|
Set<User> |
getAllUsers()
Gets the full representation of all the users that are defined in the system.
|
List<AuthenticationProviderInfo> |
getAuthenticationProviderInfos()
Gets a list of available authentication providers that can be specified as part of a user account in the system.
|
String |
getCurrentUserId()
Gets the user identifier of the current user.
|
Set<LicenseType> |
getLicenseTypes()
Retrieves the license types currently configured in the system.
|
User |
getUserByUserId(String userId)
Gets the full representation of a user given their user identifier.
|
UserDescriptor |
getUserDescriptorByUserId(String userId)
Gets the lightweight representation of the user with the specified user identifier.
|
Set<UserDescriptor> |
getUserDescriptorsByUserIds(Set<String> userIds)
Gets the lightweight client representation for the specified user identifiers that can be found in the system.
|
Set<User> |
getUsersByUserIds(Set<String> userIds)
Gets the full representations for the specified user identifiers.
|
void |
lockUser(String userId)
Locks a user with the specified user identifier.
|
void |
resetPassword(String userId,
String newPassword)
Resets the password of a user.
|
User |
setDefaultAuthenticatorByUserId(String userId,
String newPassword)
Sets the specified user account to use the default authenticator and the new password specified.
|
User |
setExternalAuthenticatorByUserId(String userId,
String authenticator,
String authenticatorUsername)
Sets the external authenticator for a user.
|
void |
unlockUser(String userId)
Unlocks a user with the specified user identifier.
|
User |
updateUser(User user)
Updates a user in the system.
|
boolean |
userExists(String userId)
Determines whether a user with the specified user identifier exists in the system.
|
User createUser(UserCreateInfo userInfo) throws UserExistsException, UserPasswordException
userInfo
- creation information with values to use to create a user instance.UserExistsException
- thrown when a user with the specified user ID already exists in the system.UserPasswordException
- thrown when the initial password specified does not meet the password validation
criteria.User updateUser(User user) throws UserNotFoundException
user
- the user to update.UserNotFoundException
- thrown when a user with the specified user identifier cannot be found in the system.void deleteUser(String userId) throws UserNotFoundException, UserDeleteException
userId
- the user identifier of the user to delete from the system.UserNotFoundException
- thrown when a user with the specified user identifier cannot be found in the system.UserDeleteException
- thrown when a user cannot be deleted because they have previously logged into the
system or they are assigned resources.void changePassword(String oldPassword, String newPassword) throws UserPasswordException, AuthenticationException
oldPassword
- the old password.newPassword
- the new password.UserPasswordException
- thrown if the new password does not meet the password validation criteria.AuthenticationException
- thrown if the old password is incorrect, or the account being used is locked,
expired, or inactive.void resetPassword(String userId, String newPassword) throws UserNotFoundException, UserPasswordException
userId
- the user identifier of the user to be assigned a new password.newPassword
- the new password to assign to the user.UserNotFoundException
- thrown when a user with the user identifier cannot be found in the system.UserPasswordException
- thrown if the new password does not meet the password validation criteria.boolean userExists(String userId)
userId
- the user identifier to check.True
if a user with the user identifier exists in the system, false
otherwise.User getUserByUserId(String userId) throws UserNotFoundException
userId
- the user identifier to fetch.UserNotFoundException
- thrown when a user with the specified user ID cannot be found in the system.Set<User> getUsersByUserIds(Set<String> userIds)
userIds
- the set of user identifiers.UserDescriptor getUserDescriptorByUserId(String userId) throws UserNotFoundException
userId
- the user identifier.UserNotFoundException
- thrown when a user with the specified user identifier cannot be found in the system.Set<UserDescriptor> getUserDescriptorsByUserIds(Set<String> userIds)
userIds
- the set of user identifiers.void lockUser(String userId) throws UserNotFoundException, UserLockedException
userId
- the user identifier.UserNotFoundException
- thrown when a user with the specified user identifier cannot be found in the system.UserLockedException
- thrown if the account is already locked.void unlockUser(String userId) throws UserNotFoundException, UserUnlockedException
userId
- the user identifier.UserNotFoundException
- thrown when a user with the specified user identifier cannot be found in the system.UserUnlockedException
- thrown if the account is already unlocked.Set<User> getAllUsers()
Set<UserDescriptor> getAllUserDescriptors()
String encryptPassword(byte[] password)
password
- the clear text password.List<AuthenticationProviderInfo> getAuthenticationProviderInfos()
User setExternalAuthenticatorByUserId(String userId, String authenticator, String authenticatorUsername) throws UserNotFoundException
setDefaultAuthenticatorByUserId(String, String)
, which
will require a new password.userId
- the user identifier to set an external authenticator.authenticator
- the id of the authentication provider to use.authenticatorUsername
- (optional) the user name in which to log in to the external authentication
provider.UserNotFoundException
- thrown when a user with the specified user identifier cannot be found in the system.User setDefaultAuthenticatorByUserId(String userId, String newPassword) throws UserNotFoundException
resetPassword(String, String)
method. After the password has been reset, it
immediately expires. Therefore, when the user logs in with the new password, they will be required to change it
before accessing the system.userId
- the user identifier in which to set the default authenticator.newPassword
- the new password that is required when switching from an external authenticator provider.UserNotFoundException
- thrown when a user with the specified user identifier cannot be found in the system.Set<LicenseType> getLicenseTypes()
AccountInfo
using LicenseType.getName()
.String getCurrentUserId()
Copyright (c) 2019, SAS Institute Inc., Cary, NC, USA