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 Summary
ConstructorsConstructorDescriptionDefaultUserRegistrationService(UserService<P> userService, AuthorizedClientService<AuthorizedClient> clientService, AuthorizationServerService<AuthorizationServer> authorizationServerService, org.springframework.security.crypto.password.PasswordEncoder passwordEncoder, RegistrationValidator registrationValidator, UserRegistrationProducer userRegistrationProducer, AuthRegistrationProperties registrationProperties, ApplicationService<Application> applicationService, com.broadleafcommerce.common.extension.TypeFactory typeFactory) -
Method Summary
Modifier and TypeMethodDescriptionprotected PcreateUser(UserRegistration registration) protected ApplicationgetApplication(@NonNull UserRegistration registration, String applicationId) Finds theApplicationcorresponding to the given application IDprotected AuthorizationServergetAuthorizationServer(UserRegistration registration, String serverId) Finds theAuthorizationServerfor the given server IDprotected AuthorizedClientgetAuthorizedClient(UserRegistration registration) Finds theAuthorizedClientcorresponding to theUserRegistration.getClientId().protected voidnotifyRegistrationEvent(P createdUser, Map<String, Object> additionalRegistrationAttributes, Boolean preview) protected StringprefixWithRegistrationValidationMessageKey(String errorCode) registerUser(@NonNull UserRegistration registration) Create and registers a new user from the given registration.registerUser(@NonNull UserRegistration registration, boolean isEmbedded) Create and registers a new user from the given registrationregisterUser(@NonNull UserRegistration registration, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Deprecated.protected voidsetContexts(User user, UserRegistration userRegistration)
-
Constructor Details
-
DefaultUserRegistrationService
public DefaultUserRegistrationService(UserService<P> userService, AuthorizedClientService<AuthorizedClient> clientService, AuthorizationServerService<AuthorizationServer> authorizationServerService, org.springframework.security.crypto.password.PasswordEncoder passwordEncoder, RegistrationValidator registrationValidator, UserRegistrationProducer userRegistrationProducer, AuthRegistrationProperties registrationProperties, ApplicationService<Application> applicationService, com.broadleafcommerce.common.extension.TypeFactory typeFactory)
-
-
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:UserRegistrationServiceCreate and registers a new user from the given registration Deprecated because ContextInfo parameter is now ignored- Specified by:
registerUserin interfaceUserRegistrationService<P extends User>- Parameters:
registration- what the user filled out as their registrationcontext- ignored- Returns:
- the created user
- See Also:
-
registerUser
Description copied from interface:UserRegistrationServiceCreate and registers a new user from the given registration. Assumes this is for a Universal Login type registration form rather than embedded.- Specified by:
registerUserin interfaceUserRegistrationService<P extends User>- Parameters:
registration- what the user filled out as their registration- Returns:
- the created user
- See Also:
-
registerUser
Description copied from interface:UserRegistrationServiceCreate and registers a new user from the given registration- Specified by:
registerUserin interfaceUserRegistrationService<P extends User>- Parameters:
registration- what the user filled out as their registrationisEmbedded- Whether this is a request from an embedded form- Returns:
- the created user
- See Also:
-
prefixWithRegistrationValidationMessageKey
-
notifyRegistrationEvent
-
createUser
-
setContexts
-
getApplication
protected Application getApplication(@NonNull @NonNull UserRegistration registration, String applicationId) Finds theApplicationcorresponding 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
Finds theAuthorizedClientcorresponding to theUserRegistration.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 theAuthorizationServerfor the given server ID- Parameters:
registration- the originally received registration requestserverId- 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
-