Class AdminUserService

java.lang.Object
edu.suffolk.litlab.efsp.server.services.AdminUserService

@Produces("application/json") public class AdminUserService extends Object
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
  • Constructor Details

  • 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 URL
      updatedUser - , 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)