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 Details

    • DefaultCustomerAccountService

      public DefaultCustomerAccountService(AccountMemberService<M> accountMemberService, AccountService<A> accountService, com.broadleafcommerce.resource.security.utils.service.AuthenticationUtils authenticationUtils)
  • Method Details

    • 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 the AccountMembers for a specific Account by id.
      Specified by:
      readAccountMembers in interface CustomerAccountService<A extends Account,M extends AccountMember>
      Parameters:
      accountId - Id of the parent account
      filters - RSQL filters
      page - Pagination info
      contextInfo - Additional multitenant and sandbox info
      Returns:
      The AccountMembers for a specific Account by id.
    • readAccountMember

      public M readAccountMember(String accountId, String memberId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Specified by:
      readAccountMember in interface CustomerAccountService<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 interface CustomerAccountService<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 interface CustomerAccountService<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's Accounts. Set excludeAccountsWithInactiveParent to true to filter out accounts that have a disabled parent account.
      Specified by:
      readMyAccounts in interface CustomerAccountService<A extends Account,M extends AccountMember>
      Parameters:
      childAccountDepth - How many levels deep of the account hierarchy of the accounts matching ids 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 be EmptyNode 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()