OpenMRSUserService¶
-
public interface
OpenMRSUserService¶ Interface for handling users on the OpenMRS server.
Fields¶
PASSWORD_KEY¶
-
String
PASSWORD_KEY¶ Key to obtain password from
createUser(String,User)andupdateUser(String,User)
USER_KEY¶
-
String
USER_KEY¶ Key to obtain
UserfromcreateUser(String,User)andupdateUser(String,User)
Methods¶
changeCurrentUserPassword¶
-
void
changeCurrentUserPassword(String configName, String currentPassword, String newPassword)¶ Changes the password of the current user. Configuration with the given
configNamewill be used while performing this action.Parameters: - configName – the name of the configuration
- currentPassword – the current password
- newPassword – the new password
createUser¶
-
User
createUser(String configName, User user)¶ Creates the given
useron the OpenMRS server. Configuration with the givenconfigNamewill be used while performing this action.Parameters: - configName – the name of the configuration
- user – the user to be created
Throws: - UserAlreadyExistsException – if the user already exists
Returns: the created user
deleteUser¶
-
void
deleteUser(String configName, String uuid)¶ Deletes the user with the given
uuid. If the provider with the givenuuiddoesn’t exist an error will be logged. Configuration with the givenconfigNamewill be used while performing this action.Parameters: - configName – the name of the configuration
- uuid – the UUID of the user
Throws: - UserDeleteException – if there were problems while deleting user
getAllUsers¶
getUserByUserName¶
-
User
getUserByUserName(String configName, String userName)¶ Returns the user with the given
userName. Configuration with the givenconfigNamewill be used while performing this action.Parameters: - configName – the name of the configuration
- userName – the username of the user
Returns: the user with the given username, null if the user doesn’t exist
getUserByUuid¶
-
User
getUserByUuid(String configName, String uuid)¶ Return the user with the given
uuid. Configuration with the givenconfigNamewill be used while performing this action.Parameters: - configName – the name of the configuration
- uuid – the UUID of the user
Returns: the user with the given UUID, null if the user doesn’t exist
setNewPasswordForUser¶
-
String
setNewPasswordForUser(String configName, String username)¶ Resets the password of the user with the given
username. Configuration with the givenconfigNamewill be used while performing this action.Parameters: - configName – the name of the configuration
- username – the name of the user
Returns: the new password, null if the user doesn’t exist
updateUser¶
-
User
updateUser(String configName, User user)¶ Updates the user with the information stored in the given
user. Configuration with the givenconfigNamewill be used while performing this action.Parameters: - configName – the name of the configuration
- user – the user to be used as an update source
Returns: the update user, null if the user doesn’t exist