Class DefaultUserRegistrationService<P extends User>

java.lang.Object
com.broadleafcommerce.auth.user.service.password.DefaultUserRegistrationService<P>
All Implemented Interfaces:
UserRegistrationService<P>

public class DefaultUserRegistrationService<P extends User> extends Object implements UserRegistrationService<P>
Author:
Phillip Verheyden (phillipuniverse)
  • Constructor Details

  • Method Details

    • registerUser

      @Deprecated public P registerUser(@NonNull @NonNull UserRegistration registration, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Deprecated.
      Description copied from interface: UserRegistrationService
      Create and registers a new user from the given registration Deprecated because ContextInfo parameter is now ignored
      Specified by:
      registerUser in interface UserRegistrationService<P extends User>
      Parameters:
      registration - what the user filled out as their registration
      context - ignored
      Returns:
      the created user
      See Also:
    • registerUser

      public P registerUser(@NonNull @NonNull UserRegistration registration)
      Description copied from interface: UserRegistrationService
      Create and registers a new user from the given registration. Assumes this is for a Universal Login type registration form rather than embedded.
      Specified by:
      registerUser in interface UserRegistrationService<P extends User>
      Parameters:
      registration - what the user filled out as their registration
      Returns:
      the created user
      See Also:
    • registerUser

      public P registerUser(@NonNull @NonNull UserRegistration registration, boolean isEmbedded)
      Description copied from interface: UserRegistrationService
      Create and registers a new user from the given registration
      Specified by:
      registerUser in interface UserRegistrationService<P extends User>
      Parameters:
      registration - what the user filled out as their registration
      isEmbedded - Whether this is a request from an embedded form
      Returns:
      the created user
      See Also:
    • prefixWithRegistrationValidationMessageKey

      protected String prefixWithRegistrationValidationMessageKey(String errorCode)
    • notifyRegistrationEvent

      protected void notifyRegistrationEvent(P createdUser, Map<String,Object> additionalRegistrationAttributes, Boolean preview)
    • createUser

      protected P createUser(UserRegistration registration)
    • setContexts

      protected void setContexts(User user, UserRegistration userRegistration)
    • getApplication

      protected Application getApplication(@NonNull @NonNull UserRegistration registration, String applicationId)
      Finds the Application corresponding to the given application ID
      Parameters:
      registration - the originally received registration request. Used in the event there is a validation error.
      Returns:
      the application from the datastore matching the given application ID
      Throws:
      com.broadleafcommerce.common.error.validation.ValidationException - if the application was not found
    • getAuthorizedClient

      protected AuthorizedClient getAuthorizedClient(UserRegistration registration)
      Finds the AuthorizedClient corresponding to the UserRegistration.getClientId().
      Parameters:
      registration - the originally received registration request
      Returns:
      the authorized client from the datastore matching the registration's client ID
      Throws:
      com.broadleafcommerce.common.error.validation.ValidationException - if the client was not found
    • getAuthorizationServer

      protected AuthorizationServer getAuthorizationServer(UserRegistration registration, String serverId)
      Finds the AuthorizationServer for the given server ID
      Parameters:
      registration - the originally received registration request
      serverId - the id of the authorization server to retrieve
      Returns:
      the authorization server from the datastore matching the given server ID
      Throws:
      com.broadleafcommerce.common.error.validation.ValidationException - if the authorization server was not found