Class DefaultCustomerAccountService<A extends Account,M extends AccountMember>
- java.lang.Object
-
- com.broadleafcommerce.customer.service.DefaultCustomerAccountService<A,M>
-
- All Implemented Interfaces:
CustomerAccountService<A,M>
public class DefaultCustomerAccountService<A extends Account,M extends AccountMember> extends Object implements CustomerAccountService<A,M>
-
-
Constructor Summary
Constructors Constructor Description DefaultCustomerAccountService(AccountMemberService<M> accountMemberService, AccountService<A> accountService, com.broadleafcommerce.resource.security.utils.service.AuthenticationUtils authenticationUtils)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddeleteAccountMember(String accountId, String memberId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)protected AccountMemberService<M>getAccountMemberService()protected AccountService<A>getAccountService()protected com.broadleafcommerce.resource.security.utils.service.AuthenticationUtilsgetAuthenticationUtils()MreadAccountMember(String accountId, String memberId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)org.springframework.data.domain.Page<M>readAccountMembers(String accountId, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Read theAccountMembersfor a specificAccountby id.List<A>readMyAccounts(int childAccountDepth, boolean filterParents, cz.jirutka.rsql.parser.ast.Node filters, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Reads the currently logged in user'sAccounts.MupdateAccountMember(String accountId, String memberId, @NonNull UpdateAccountMemberRequest accountMember, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)protected voidvalidateAccountIdMatchesContext(String accountId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)protected voidvalidateUserNotModifyingThemselves(@NonNull AccountMember accountMember, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
-
-
-
Constructor Detail
-
DefaultCustomerAccountService
public DefaultCustomerAccountService(AccountMemberService<M> accountMemberService, AccountService<A> accountService, com.broadleafcommerce.resource.security.utils.service.AuthenticationUtils authenticationUtils)
-
-
Method Detail
-
readAccountMembers
public org.springframework.data.domain.Page<M> readAccountMembers(String accountId, @Nullable cz.jirutka.rsql.parser.ast.Node filters, @Nullable org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Description copied from interface:CustomerAccountServiceRead theAccountMembersfor a specificAccountby id.- Specified by:
readAccountMembersin interfaceCustomerAccountService<A extends Account,M extends AccountMember>- Parameters:
accountId- Id of the parent accountfilters- RSQL filterspage- Pagination infocontextInfo- Additional multitenant and sandbox info- Returns:
- The
AccountMembersfor a specificAccountby id.
-
readAccountMember
public M readAccountMember(String accountId, String memberId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
- Specified by:
readAccountMemberin interfaceCustomerAccountService<A extends Account,M extends AccountMember>
-
updateAccountMember
public M updateAccountMember(String accountId, String memberId, @NonNull @NonNull UpdateAccountMemberRequest accountMember, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
- Specified by:
updateAccountMemberin interfaceCustomerAccountService<A extends Account,M extends AccountMember>
-
deleteAccountMember
public void deleteAccountMember(String accountId, String memberId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
- Specified by:
deleteAccountMemberin interfaceCustomerAccountService<A extends Account,M extends AccountMember>
-
readMyAccounts
public List<A> readMyAccounts(int childAccountDepth, boolean filterParents, @Nullable cz.jirutka.rsql.parser.ast.Node filters, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Description copied from interface:CustomerAccountServiceReads the currently logged in user'sAccounts. SetexcludeAccountsWithInactiveParenttotrueto filter out accounts that have a disabled parent account.- Specified by:
readMyAccountsin interfaceCustomerAccountService<A extends Account,M extends AccountMember>- Parameters:
childAccountDepth- How many levels deep of the account hierarchy of the accounts matchingidsto include in the results, e.g., how many levels of child accounts to include.-1indicates no limit.0indicates no child accounts.Default is
0.filterParents- If true, the returned list will include only accounts with active parent accounts.filters- An RSQL filter used to narrow query results. May beEmptyNodeif no filters should be applied.contextInfo- Additional multitenant and sandbox info- Returns:
- The currently logged in user's
Accounts.
-
validateUserNotModifyingThemselves
protected void validateUserNotModifyingThemselves(@NonNull @NonNull AccountMember accountMember, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
-
validateAccountIdMatchesContext
protected void validateAccountIdMatchesContext(String accountId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
-
getAccountMemberService
protected AccountMemberService<M> getAccountMemberService()
-
getAccountService
protected AccountService<A> getAccountService()
-
getAuthenticationUtils
protected com.broadleafcommerce.resource.security.utils.service.AuthenticationUtils getAuthenticationUtils()
-
-