Interface AccountMemberService<M extends AccountMember>

  • All Superinterfaces:
    com.broadleafcommerce.data.tracking.core.service.CrudEntityService<M>, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService<M>
    All Known Implementing Classes:
    DefaultAccountMemberService

    public interface AccountMemberService<M extends AccountMember>
    extends com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService<M>
    Service API for AccountMembers. Supported by AccountMemberRepository.
    Author:
    Chris Kittrell (ckittrell)
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      org.springframework.data.domain.Page<M> readAllByAccountId​(String accountId, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Reads all of the AccountMember relationships in the database associated with the given account context ID.
      M readByIdAndAccountId​(String id, String accountId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Finds the AccountMember which has the given ID and parent account ID.
      M registerAccountMember​(String accountId, RegisterAccountMemberRequest registerAccountMemberRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Relates a Customer with the Account identified by the accountId.
      M updateAccountMember​(String accountId, String accountMemberId, UpdateAccountMemberRequest updateRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Updates the relationship between an Account & a Customer - ie an AccountMember.
      • Methods inherited from interface com.broadleafcommerce.data.tracking.core.service.CrudEntityService

        create, createAll, createAllAllowingPartialSuccess, delete, readAll, readAll, readAll, readAllByContextId, readByContextId, replace, replaceAll, replaceAllAllowingPartialSuccess, update, updateAll, updateAllAllowingPartialSuccess, updateSort
      • Methods inherited from interface com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService

        readAll, readAll, readAll, readAll
    • Method Detail

      • readAllByAccountId

        org.springframework.data.domain.Page<M> readAllByAccountId​(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)
        Reads all of the AccountMember relationships in the database associated with the given account context ID.
        Parameters:
        accountId - the account context ID to find the relationships for
        filters - additional filters to apply in the query. Should be EmptyNode if no additional filters should be applied.
        page - the requested page of results from the database
        contextInfo - the context to query within
        Returns:
        the AccountMember relationships in the database that match the given account context ID
      • registerAccountMember

        M registerAccountMember​(String accountId,
                                RegisterAccountMemberRequest registerAccountMemberRequest,
                                @Nullable
                                com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
        Relates a Customer with the Account identified by the accountId. If the customer cannot be found, then one is created.
        Parameters:
        accountId - Id of the Account that the RegisterAccountMemberRequest.customerRef should be related to
        registerAccountMemberRequest - The payload that describes the requested relationship between the customer & the account
        context - The context of the user's request
        Returns:
        The registered AccountMember
        Throws:
        com.broadleafcommerce.data.tracking.core.exception.EntityMissingException - if the related Account, Customer, or AccountRole are not found
      • readByIdAndAccountId

        M readByIdAndAccountId​(String id,
                               String accountId,
                               @Nullable
                               com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Finds the AccountMember which has the given ID and parent account ID.
        Parameters:
        id - the context ID of the AccountMember
        accountId - the context ID of the owning Account
        contextInfo - context surrounding customer and multitenant state
        Returns:
        the account member that has the given ID and owning account ID
        Throws:
        com.broadleafcommerce.data.tracking.core.exception.EntityMissingException - if no such AccountMember was found
      • updateAccountMember

        M updateAccountMember​(String accountId,
                              String accountMemberId,
                              UpdateAccountMemberRequest updateRequest,
                              @Nullable
                              com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
        Updates the relationship between an Account & a Customer - ie an AccountMember.
        Parameters:
        accountId - Id of the Account in the relationship
        accountMemberId - Id of the AccountMember that is to be updated
        updateRequest - The payload that describes the requested changes
        context - The context of the user's request
        Returns: