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 Type
    Method
    Description
    com.broadleafcommerce.data.tracking.core.preview.PreviewToken
    createPreviewToken(PreviewTokenRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Creates a new PreviewToken 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 a PreviewToken.
  • Method Details

    • createPreviewToken

      com.broadleafcommerce.data.tracking.core.preview.PreviewToken createPreviewToken(PreviewTokenRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Creates a new PreviewToken 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 targeted
      contextInfo - 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 a PreviewToken. 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 string
      contextInfo - the context
      Returns:
      a preview token object
      Throws:
      PreviewTokenValidationException