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 P
createUser(UserRegistration registration)
protected Application
getApplication(@NonNull UserRegistration registration, String applicationId)
Finds theApplication
corresponding to the given application IDprotected AuthorizationServer
getAuthorizationServer(UserRegistration registration, String serverId)
Finds theAuthorizationServer
for the given server IDprotected AuthorizedClient
getAuthorizedClient(UserRegistration registration)
Finds theAuthorizedClient
corresponding to theUserRegistration.getClientId()
.protected void
notifyRegistrationEvent(P createdUser, Map<String,Object> additionalRegistrationAttributes, Boolean preview)
protected String
prefixWithRegistrationValidationMessageKey(String errorCode)
P
registerUser(@NonNull UserRegistration registration)
Create and registers a new user from the given registration.P
registerUser(@NonNull UserRegistration registration, boolean isEmbedded)
Create and registers a new user from the given registrationP
registerUser(@NonNull UserRegistration registration, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
Deprecated.protected void
setContexts(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:UserRegistrationService
Create and registers a new user from the given registration Deprecated because ContextInfo parameter is now ignored- Specified by:
registerUser
in 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: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 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:UserRegistrationService
Create and registers a new user from the given registration- Specified by:
registerUser
in 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 theApplication
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 theAuthorizedClient
corresponding 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 theAuthorizationServer
for 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
-
-