Class AdminUserService
java.lang.Object
edu.suffolk.litlab.efspserver.services.AdminUserService
Covers all of the FirmUserManagement and UserService operations. * User Service *
AuthenticateUser * ChangePassword * ResetPassword * GetUser (User Service) * UpdateUser (User
Service) * GetNotificationPreferences * UpdateNotificationPreferences * SelfResendActivationEmail
* Firm User Management * 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 class
static class
-
Constructor Summary
ConstructorsConstructorDescriptionAdminUserService
(String jurisdiction, String env, DataSource userDs, Supplier<CodeDatabase> cdSupplier, Function<String, com.hubspot.algebra.Result<com.hubspot.algebra.NullValue, String>> passwordChecker) -
Method Summary
Modifier and TypeMethodDescriptionjakarta.ws.rs.core.Response
addRoles
(jakarta.ws.rs.core.HttpHeaders httpHeaders, String id, List<RoleLocationType> toAdd) For AddUserRole.jakarta.ws.rs.core.Response
getAll()
jakarta.ws.rs.core.Response
getNotificationPreferenceList
(jakarta.ws.rs.core.HttpHeaders httpHeaders) jakarta.ws.rs.core.Response
getNotificationPrefs
(jakarta.ws.rs.core.HttpHeaders httpHeaders) jakarta.ws.rs.core.Response
Duplicate of GetUser, but just for the roles of that user.jakarta.ws.rs.core.Response
getSelfUser
(jakarta.ws.rs.core.HttpHeaders httpHeaders) jakarta.ws.rs.core.Response
For GetUser (Firm Service).jakarta.ws.rs.core.Response
getUserList
(jakarta.ws.rs.core.HttpHeaders httpHeaders, int pageIndex, int pageSize) jakarta.ws.rs.core.Response
registerUser
(jakarta.ws.rs.core.HttpHeaders httpHeaders, RegistrationRequestType req) For RegisterUser.jakarta.ws.rs.core.Response
removeRoles
(jakarta.ws.rs.core.HttpHeaders httpHeaders, String id, List<RoleLocationType> toRm) For RemoveUserRole.jakarta.ws.rs.core.Response
removeUser
(jakarta.ws.rs.core.HttpHeaders httpHeaders, String id) For RemoveUser.jakarta.ws.rs.core.Response
resendActivationEmail
(jakarta.ws.rs.core.HttpHeaders httpHeaders, String id) jakarta.ws.rs.core.Response
resetPassword
(jakarta.ws.rs.core.HttpHeaders httpHeaders, String id, AdminUserService.ResetPasswordParams params) jakarta.ws.rs.core.Response
selfResendActivationEmail
(jakarta.ws.rs.core.HttpHeaders httpHeaders, String emailToSendTo) jakarta.ws.rs.core.Response
selfResetPassword
(jakarta.ws.rs.core.HttpHeaders httpHeaders, String emailToSend) jakarta.ws.rs.core.Response
setPassword
(jakarta.ws.rs.core.HttpHeaders httpHeaders, AdminUserService.SetPasswordParams params) jakarta.ws.rs.core.Response
updateNotificationPrefs
(jakarta.ws.rs.core.HttpHeaders httpHeaders, List<NotificationType> notifications) jakarta.ws.rs.core.Response
updateUser
(jakarta.ws.rs.core.HttpHeaders httpHeaders, UserType updatedUser) jakarta.ws.rs.core.Response
updateUserById
(jakarta.ws.rs.core.HttpHeaders httpHeaders, String id, UserType updatedUser) For UpdateUser (AdminUserService).
-
Constructor Details
-
AdminUserService
public AdminUserService(String jurisdiction, String env, DataSource userDs, 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) -
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) For RegisterUser.- Parameters:
req
-- Returns:
-
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)
-