Class AdminUserService
java.lang.Object
edu.suffolk.litlab.efsp.server.services.AdminUserService
Covers all of the FirmUserManagement and UserService operations.
User Service
- AuthenticateUser
- ChangePassword
- ResetPassword
- GetUser (User Service)
- UpdateUser (User Service)
- GetNotificationPreferences
- UpdateNotificationPreferences
- SelfResendActivationEmail
- RegisterUser: PUT on /users
- AddUserRole: POST on /users/{id}/role
- GetUser: GET on /users/{id}
- GetUserList: GET on /users
- RemoveUser: DELETE on /users/{id}
- RemoveUserRole: DELETE on /users/{id}/role
- ResendActivationEmail
- ResetUserPassword
- UpdateUser: POST on /users/{id}
- GetNotificationPreferencesList
- Author:
- brycew
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic class -
Constructor Summary
ConstructorsConstructorDescriptionAdminUserService(TylerDomain domain, Supplier<LoginDatabase> ldSupplier, Supplier<CodeDatabase> cdSupplier, Function<String, com.hubspot.algebra.Result<com.hubspot.algebra.NullValue, String>> passwordChecker) -
Method Summary
Modifier and TypeMethodDescriptionjakarta.ws.rs.core.ResponseaddRoles(jakarta.ws.rs.core.HttpHeaders httpHeaders, String id, List<RoleLocationType> toAdd) For AddUserRole.jakarta.ws.rs.core.ResponsegetAll()jakarta.ws.rs.core.ResponsegetNotificationPreferenceList(jakarta.ws.rs.core.HttpHeaders httpHeaders) jakarta.ws.rs.core.ResponsegetNotificationPrefs(jakarta.ws.rs.core.HttpHeaders httpHeaders) jakarta.ws.rs.core.ResponseDuplicate of GetUser, but just for the roles of that user.jakarta.ws.rs.core.ResponsegetSelfUser(jakarta.ws.rs.core.HttpHeaders httpHeaders) jakarta.ws.rs.core.ResponseFor GetUser (Firm Service).jakarta.ws.rs.core.ResponsegetUserList(jakarta.ws.rs.core.HttpHeaders httpHeaders, int pageIndex, int pageSize) jakarta.ws.rs.core.ResponseregisterUser(jakarta.ws.rs.core.HttpHeaders httpHeaders, RegistrationRequestType req) To register a new user.jakarta.ws.rs.core.ResponseremoveRoles(jakarta.ws.rs.core.HttpHeaders httpHeaders, String id, List<RoleLocationType> toRm) For RemoveUserRole.jakarta.ws.rs.core.ResponseremoveUser(jakarta.ws.rs.core.HttpHeaders httpHeaders, String id) For RemoveUser.jakarta.ws.rs.core.ResponseresendActivationEmail(jakarta.ws.rs.core.HttpHeaders httpHeaders, String id) jakarta.ws.rs.core.ResponseresetPassword(jakarta.ws.rs.core.HttpHeaders httpHeaders, String id, AdminUserService.ResetPasswordParams params) jakarta.ws.rs.core.ResponseselfResendActivationEmail(jakarta.ws.rs.core.HttpHeaders httpHeaders, String emailToSendTo) jakarta.ws.rs.core.ResponseselfResetPassword(jakarta.ws.rs.core.HttpHeaders httpHeaders, String emailToSend) jakarta.ws.rs.core.ResponsesetPassword(jakarta.ws.rs.core.HttpHeaders httpHeaders, AdminUserService.SetPasswordParams params) jakarta.ws.rs.core.ResponseupdateNotificationPrefs(jakarta.ws.rs.core.HttpHeaders httpHeaders, List<NotificationType> notifications) jakarta.ws.rs.core.ResponseupdateUser(jakarta.ws.rs.core.HttpHeaders httpHeaders, UserType updatedUser) jakarta.ws.rs.core.ResponseupdateUserById(jakarta.ws.rs.core.HttpHeaders httpHeaders, String id, UserType updatedUser) For UpdateUser (AdminUserService).
-
Constructor Details
-
AdminUserService
public AdminUserService(TylerDomain domain, Supplier<LoginDatabase> ldSupplier, Supplier<CodeDatabase> cdSupplier, Function<String, com.hubspot.algebra.Result<com.hubspot.algebra.NullValue, String>> passwordChecker)
-
-
Method Details
-
getAll
@GET @Path("/") public jakarta.ws.rs.core.Response getAll() -
getSelfUser
@GET @Path("/user") public jakarta.ws.rs.core.Response getSelfUser(@Context jakarta.ws.rs.core.HttpHeaders httpHeaders) -
getNotificationPrefs
@GET @Path("/user/notification-preferences") public jakarta.ws.rs.core.Response getNotificationPrefs(@Context jakarta.ws.rs.core.HttpHeaders httpHeaders) -
updateNotificationPrefs
@PATCH @Path("/user/notification-preferences") public jakarta.ws.rs.core.Response updateNotificationPrefs(@Context jakarta.ws.rs.core.HttpHeaders httpHeaders, List<NotificationType> notifications) -
selfResendActivationEmail
@POST @Path("/user/resend-activation-email") public jakarta.ws.rs.core.Response selfResendActivationEmail(@Context jakarta.ws.rs.core.HttpHeaders httpHeaders, String emailToSendTo) -
resendActivationEmail
@POST @Path("/users/{id}/resend-activation-email") public jakarta.ws.rs.core.Response resendActivationEmail(@Context jakarta.ws.rs.core.HttpHeaders httpHeaders, @PathParam("id") String id) -
resetPassword
@POST @Path("/users/{id}/password") public jakarta.ws.rs.core.Response resetPassword(@Context jakarta.ws.rs.core.HttpHeaders httpHeaders, @PathParam("id") String id, AdminUserService.ResetPasswordParams params) - Parameters:
httpHeaders- Should include the "X-API-KEY" and "TYLER-TOKEN-{jurisdiction}" headers (should be logged in as a firm admin user).id- The UUID of the user to reset the password for.params- The email and newPassword to replace the existing password. The new password should match the complexity requirements for the jurisdiction. For example:{ "email": "bob@example.com", "newPassword": "wow_new_P@ssword1"}- Returns:
- The password hash as a string, if successful
-
setPassword
@POST @Path("/user/password") public jakarta.ws.rs.core.Response setPassword(@Context jakarta.ws.rs.core.HttpHeaders httpHeaders, AdminUserService.SetPasswordParams params) -
selfResetPassword
@POST @Path("/user/password/reset") public jakarta.ws.rs.core.Response selfResetPassword(@Context jakarta.ws.rs.core.HttpHeaders httpHeaders, String emailToSend) -
getUser
@GET @Path("/users/{id}") public jakarta.ws.rs.core.Response getUser(@Context jakarta.ws.rs.core.HttpHeaders httpHeaders, @PathParam("id") String id) For GetUser (Firm Service).- Parameters:
id- The id of the user, embedded in the URL- Returns:
-
getUserList
@GET @Path("/users") public jakarta.ws.rs.core.Response getUserList(@Context jakarta.ws.rs.core.HttpHeaders httpHeaders, @QueryParam("page_index") @DefaultValue("0") int pageIndex, @QueryParam("page_size") @DefaultValue("20") int pageSize) -
updateUser
@PATCH @Path("/user") public jakarta.ws.rs.core.Response updateUser(@Context jakarta.ws.rs.core.HttpHeaders httpHeaders, UserType updatedUser) -
updateUserById
@PATCH @Path("/users/{id}") public jakarta.ws.rs.core.Response updateUserById(@Context jakarta.ws.rs.core.HttpHeaders httpHeaders, @PathParam("id") String id, UserType updatedUser) For UpdateUser (AdminUserService).- Parameters:
id- The id of the user, embedded in the URLupdatedUser- , null fields are ignored- Returns:
-
getRoles
@GET @Path("/users/{id}/roles") public jakarta.ws.rs.core.Response getRoles(@Context jakarta.ws.rs.core.HttpHeaders httpHeaders, @PathParam("id") String id) Duplicate of GetUser, but just for the roles of that user. More REST-like.- Parameters:
id- The id of the user, embedded in the URL- Returns:
-
addRoles
@POST @Path("/users/{id}/roles") public jakarta.ws.rs.core.Response addRoles(@Context jakarta.ws.rs.core.HttpHeaders httpHeaders, @PathParam("id") String id, List<RoleLocationType> toAdd) For AddUserRole.- Parameters:
id-toAdd-- Returns:
-
removeRoles
@DELETE @Path("/users/{id}/roles") public jakarta.ws.rs.core.Response removeRoles(@Context jakarta.ws.rs.core.HttpHeaders httpHeaders, @PathParam("id") String id, List<RoleLocationType> toRm) For RemoveUserRole.- Parameters:
id-toRm-- Returns:
-
registerUser
@POST @Path("/users") public jakarta.ws.rs.core.Response registerUser(@Context jakarta.ws.rs.core.HttpHeaders httpHeaders, RegistrationRequestType req) To register a new user.- Parameters:
req- the registration request: An example:{ "registrationType": "INDIVIDUAL", "email": "bob@example.com", "firstName": "Bob", "middleName": "", "lastName": "Brown", "streetAddressLine1": "123 Main St", "streetAddressLine2": "Apt 1", "city": "Boston", "stateCode": "MA", "zipCode": "02125", "countryCode": "US", "phoneNumber": "617-333-1234", "password": "MyP@ssword" }- Returns:
- The object with the user's password hash, their user ID, and their firm ID. (TODO(bryce): get example).
-
removeUser
@DELETE @Path("/users/{id}") public jakarta.ws.rs.core.Response removeUser(@Context jakarta.ws.rs.core.HttpHeaders httpHeaders, @PathParam("id") String id) For RemoveUser.- Parameters:
id- The id of the user to remove, embedded in the URL- Returns:
-
getNotificationPreferenceList
@GET @Path("/notification-options") public jakarta.ws.rs.core.Response getNotificationPreferenceList(@Context jakarta.ws.rs.core.HttpHeaders httpHeaders)
-