Class DefaultAccountUpdateRequestHandler
java.lang.Object
com.broadleafcommerce.auth.user.service.DefaultAccountUpdateRequestHandler
- All Implemented Interfaces:
AccountUpdateRequestHandler
public class DefaultAccountUpdateRequestHandler
extends Object
implements AccountUpdateRequestHandler
Process an
CustomerAccountUpdateRequest to respond to updates of an account's status or
parent.- Author:
- Cade Rea (cade-rea)
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefaultAccountUpdateRequestHandler(AccountRoleService<AccountRole> accountRoleService, CustomerAccountService<CustomerAccount> customerAccountService, UserService<User> userService, com.broadleafcommerce.common.extension.TypeFactory typeFactory) -
Method Summary
Modifier and TypeMethodDescriptionprotected AccountRoleService<AccountRole>protected CustomerAccountService<CustomerAccount>protected com.broadleafcommerce.common.extension.TypeFactoryprotected UserService<User>voidhandle(CustomerAccountUpdateRequest request) For the given Account, activate or deactivate all AccountRoles for all Users.protected voidhandleAccount(@NonNull CustomerAccountUpdateRequest request) protected voidhandleDeleteOrUpdate(@NonNull CustomerAccount account, @NonNull CustomerAccountUpdateRequest request) Handles the case where an account exists matching theCustomerAccountUpdateRequest.getAccountId().protected voidhandleIgnoreOrCreate(@NonNull CustomerAccountUpdateRequest request) Handles the case where no account exists matching theCustomerAccountUpdateRequest.getAccountId().protected voidhandleRoles(CustomerAccountUpdateRequest request) protected static booleanisActive(CustomerAccountUpdateRequest request) protected static booleanisDeleted(CustomerAccountUpdateRequest request)
-
Field Details
-
ACCOUNT_STATUS_ACTIVE
- See Also:
-
ACCOUNT_STATUS_DELETED
- See Also:
-
-
Constructor Details
-
DefaultAccountUpdateRequestHandler
public DefaultAccountUpdateRequestHandler(AccountRoleService<AccountRole> accountRoleService, CustomerAccountService<CustomerAccount> customerAccountService, UserService<User> userService, com.broadleafcommerce.common.extension.TypeFactory typeFactory)
-
-
Method Details
-
handle
For the given Account, activate or deactivate all AccountRoles for all Users. If an account has been deleted, remove all AccountRoles for that account from all Users.- Specified by:
handlein interfaceAccountUpdateRequestHandler- Parameters:
request- Data about the account status change.
-
handleRoles
-
handleAccount
-
handleIgnoreOrCreate
Handles the case where no account exists matching theCustomerAccountUpdateRequest.getAccountId(). If the status isACCOUNT_STATUS_DELETED, then nothing will be done. Otherwise, a new account will be created.- Parameters:
request- Data about the account status change.- Since:
- Authentication Services 2.3.0, Release Train 2.3.0
-
handleDeleteOrUpdate
protected void handleDeleteOrUpdate(@NonNull @NonNull CustomerAccount account, @NonNull @NonNull CustomerAccountUpdateRequest request) Handles the case where an account exists matching theCustomerAccountUpdateRequest.getAccountId(). If the status isACCOUNT_STATUS_DELETED, then the account will be deleted. Otherwise, the account will be updated.- Parameters:
request- Data about the account status change.- Since:
- Authentication Services 2.3.0, Release Train 2.3.0
-
isDeleted
-
isActive
-
getAccountRoleService
-
getCustomerAccountService
-
getUserService
-
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
-