Interface PreviewTokenService
- All Known Implementing Classes:
DefaultPreviewTokenService
public interface PreviewTokenService
An interface used for the creation of a preview token for the preview sandbox flow.
- Author:
- Nick Crum (ncrum)
-
Method Summary
Modifier and TypeMethodDescriptioncom.broadleafcommerce.data.tracking.core.preview.PreviewToken
createPreviewToken
(PreviewTokenRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Creates a newPreviewToken
that can be exchanged for proof of access to a particular set of sandboxes for a user.com.broadleafcommerce.data.tracking.core.preview.PreviewToken
validatePreviewToken
(String tokenString, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Attempts to decoded and validate the provided token string into aPreviewToken
.
-
Method Details
-
createPreviewToken
com.broadleafcommerce.data.tracking.core.preview.PreviewToken createPreviewToken(PreviewTokenRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Creates a newPreviewToken
that can be exchanged for proof of access to a particular set of sandboxes for a user. This is used to provide a way for admin users to preview their sandbox data in a commerce application.- Parameters:
request
- the request with information on which sandboxes will be targetedcontextInfo
- the context information for this request- Returns:
- a preview token object with an encoded token that is used to prove access to a sandbox
-
validatePreviewToken
com.broadleafcommerce.data.tracking.core.preview.PreviewToken validatePreviewToken(@NonNull String tokenString, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) throws PreviewTokenValidationException Attempts to decoded and validate the provided token string into aPreviewToken
. This is used to provide a way to check that a token is valid and to extract the contents for display purposes.- Parameters:
tokenString
- the encoded token stringcontextInfo
- the context- Returns:
- a preview token object
- Throws:
PreviewTokenValidationException
-