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 void
deleteAccountMember(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.AuthenticationUtils
getAuthenticationUtils()
M
readAccountMember(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 theAccountMembers
for a specificAccount
by 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
.M
updateAccountMember(String accountId, String memberId, @NonNull UpdateAccountMemberRequest accountMember, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
protected void
validateAccountIdMatchesContext(String accountId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
protected void
validateUserNotModifyingThemselves(@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:CustomerAccountService
Read theAccountMembers
for a specificAccount
by id.- Specified by:
readAccountMembers
in 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
AccountMembers
for a specificAccount
by id.
-
readAccountMember
public M readAccountMember(String accountId, String memberId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
- Specified by:
readAccountMember
in 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:
updateAccountMember
in 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:
deleteAccountMember
in 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:CustomerAccountService
Reads the currently logged in user'sAccounts
. SetexcludeAccountsWithInactiveParent
totrue
to filter out accounts that have a disabled parent account.- Specified by:
readMyAccounts
in interfaceCustomerAccountService<A extends Account,M extends AccountMember>
- Parameters:
childAccountDepth
- How many levels deep of the account hierarchy of the accounts matchingids
to include in the results, e.g., how many levels of child accounts to include.-1
indicates no limit.0
indicates 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 beEmptyNode
if 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()
-
-