Interface AccountInviteService<P extends AccountInvite>

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

    public interface AccountInviteService<P extends AccountInvite>
    extends com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService<P>
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      AccountMember acceptInvite​(String inviteId, String accountId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Accepts an account invitation.
      void acceptPendingInvitesForCustomer​(String customerId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Accepts the pending invites for the Customer.
      Duration getInviteDuration​(String accountId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Return the duration for which account invites will be active.
      Optional<P> inviteToAccount​(String accountId, AccountInviteRequest accountInviteRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Invite a new user to an account.
      org.springframework.data.domain.Page<P> readAllByAccountId​(String accountId, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Read a page of account invites by account ID.
      Optional<P> readByContextIdAndAccountId​(String id, String accountId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Read an account invite by its ID and account ID.
      org.springframework.data.domain.Page<P> readMyInvites​(org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Read the currently authenticated user's account invites.
      P resendInvite​(String inviteId, String accountId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Re-send an account invitation.
      void revokeInvite​(String inviteId, String accountId, String accountMemberId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Revoke an invite to an account
      • 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<P> 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)
        Read a page of account invites by account ID. Additional includes validation that the supplied filters object does not have an existing "accountId" filter.
        Parameters:
        filters - The filters
        accountId - The account ID
        page - The page
        contextInfo - context surrounding customer and multitenant state
        Returns:
        A page of account invites
      • inviteToAccount

        Optional<P> inviteToAccount​(String accountId,
                                    AccountInviteRequest accountInviteRequest,
                                    @Nullable
                                    com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Invite a new user to an account. If an invite already exists for the supplied account/email address, the existing invite's expiration time is reset. If AccountInviteProperties.isAutoAcceptPendingInvitesOnRegistration() is true and the invited user already exists (has registered), then no invite is created since it's auto- accepted.
        Parameters:
        accountId - The account ID.
        accountInviteRequest - The account invite request
        contextInfo - context surrounding customer and multitenant state
        Returns:
        The newly created account invite.
      • revokeInvite

        void revokeInvite​(String inviteId,
                          String accountId,
                          String accountMemberId,
                          @Nullable
                          com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Revoke an invite to an account
        Parameters:
        accountId - The account ID
        inviteId - The invite ID
        contextInfo - context surrounding customer and multitenant state
      • resendInvite

        P resendInvite​(String inviteId,
                       String accountId,
                       @Nullable
                       com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Re-send an account invitation. When an invite is re-sent, its expiration time is also reset.
        Parameters:
        accountId - The account ID
        inviteId - The invite ID
        contextInfo - context surrounding customer and multitenant state
        Returns:
        The re-sent account invitation.
      • acceptInvite

        AccountMember acceptInvite​(String inviteId,
                                   String accountId,
                                   @Nullable
                                   com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Accepts an account invitation. If successful, creates and returns the new AccountMember and deletes the AccountInvite.
        Parameters:
        accountId - The account ID
        inviteId - The invite ID
        contextInfo - context surrounding customer and multitenant state
        Returns:
        The newly created account member.
      • readMyInvites

        org.springframework.data.domain.Page<P> readMyInvites​(org.springframework.data.domain.Pageable page,
                                                              @Nullable
                                                              com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Read the currently authenticated user's account invites.
        Parameters:
        contextInfo - context surrounding customer and multitenant state
        Returns:
        The currently logged in user's account invites.
      • acceptPendingInvitesForCustomer

        void acceptPendingInvitesForCustomer​(String customerId,
                                             @Nullable
                                             com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Accepts the pending invites for the Customer.
        Parameters:
        customerId - The id of the customer whose invites to read.
        contextInfo - context surrounding customer and multitenant state
      • readByContextIdAndAccountId

        Optional<P> readByContextIdAndAccountId​(String id,
                                                String accountId,
                                                com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Read an account invite by its ID and account ID.
        Parameters:
        id - The invite ID
        accountId - The account ID
        contextInfo - context surrounding customer and multitenant state
        Returns:
        The account invite, if found.
      • getInviteDuration

        Duration getInviteDuration​(@Nullable
                                   String accountId,
                                   @Nullable
                                   com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Return the duration for which account invites will be active.
        Parameters:
        accountId - The account ID
        contextInfo - context surrounding customer and multitenant state
        Returns:
        The duration for which account invites should be active.