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 AccountMemberacceptInvite(String inviteId, String accountId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Accepts an account invitation.voidacceptPendingInvitesForCustomer(String customerId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Accepts the pending invites for theCustomer.DurationgetInviteDuration(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.PresendInvite(String inviteId, String accountId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Re-send an account invitation.voidrevokeInvite(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
-
-
-
-
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 suppliedfiltersobject does not have an existing "accountId" filter.- Parameters:
filters- The filtersaccountId- The account IDpage- The pagecontextInfo- 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. IfAccountInviteProperties.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 requestcontextInfo- 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 IDinviteId- The invite IDcontextInfo- 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 IDinviteId- The invite IDcontextInfo- 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 newAccountMemberand deletes theAccountInvite.- Parameters:
accountId- The account IDinviteId- The invite IDcontextInfo- 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 theCustomer.- 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 IDaccountId- The account IDcontextInfo- 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 IDcontextInfo- context surrounding customer and multitenant state- Returns:
- The duration for which account invites should be active.
-
-