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
Constructors Constructor Description 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 Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected 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)PregisterUser(@NonNull UserRegistration registration)Create and registers a new user from the given registration.PregisterUser(@NonNull UserRegistration registration, boolean isEmbedded)Create and registers a new user from the given registrationPregisterUser(@NonNull UserRegistration registration, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)Deprecated.protected voidsetContexts(User user, UserRegistration userRegistration)
-
-
-
Constructor Detail
-
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 Detail
-
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:
RegistrationValidator
-
registerUser
public P registerUser(@NonNull @NonNull UserRegistration registration)
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:
RegistrationValidator
-
registerUser
public P registerUser(@NonNull @NonNull UserRegistration registration, boolean isEmbedded)
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:
RegistrationValidator
-
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 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
protected AuthorizedClient getAuthorizedClient(UserRegistration registration)
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
-
-