Class PreviewToken
java.lang.Object
com.broadleafcommerce.data.tracking.core.preview.PreviewToken
- All Implemented Interfaces:
Serializable
The response object used to provide the details of the preview token as well as the token itself.
- Author:
- Nick Crum (ncrum)
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
The ID of the application this preview token is authorized for.The username of the author associated with the preview token.The expiration time of the preview token in UTC.The set of sandbox IDs the preview token is authorized for.The ID of the tenant this preview token is authorized for.getToken()
The token string that is used to authorize that a request has access to preview data for a given sandbox.int
hashCode()
boolean
matchesContext
(ContextRequest contextRequest) Validates whether or not this preview token matches the providedOperationType
andContextRequest
.void
setApplicationId
(String applicationId) The ID of the application this preview token is authorized for.void
The username of the author associated with the preview token.void
setExpirationTime
(Instant expirationTime) The expiration time of the preview token in UTC.void
setSandboxIds
(Set<String> sandboxIds) The set of sandbox IDs the preview token is authorized for.void
setTenantId
(String tenantId) The ID of the tenant this preview token is authorized for.void
The token string that is used to authorize that a request has access to preview data for a given sandbox.toString()
-
Constructor Details
-
PreviewToken
public PreviewToken()
-
-
Method Details
-
matchesContext
Validates whether or not this preview token matches the providedOperationType
andContextRequest
.A preview token is considered a match for a context when the following are all true:
- The context includes a sandbox
- The token includes a matching claim for the context's sandbox
- The token includes a matching claim for the context's tenant
- The token includes a matching claim for the context's application
- Parameters:
contextRequest
- the request context- Returns:
- whether or not the context is a match
-
getToken
The token string that is used to authorize that a request has access to preview data for a given sandbox.This token should be provided as part of the `X-Context-Request` header as the `previewToken` property along with the `sandboxId` the user wishes to access.
-
getExpirationTime
The expiration time of the preview token in UTC. This is used to inform clients of when to expect the token to be expired. -
getAuthor
The username of the author associated with the preview token. -
getSandboxIds
The set of sandbox IDs the preview token is authorized for. -
getTenantId
The ID of the tenant this preview token is authorized for. -
getApplicationId
The ID of the application this preview token is authorized for. -
setToken
The token string that is used to authorize that a request has access to preview data for a given sandbox.This token should be provided as part of the `X-Context-Request` header as the `previewToken` property along with the `sandboxId` the user wishes to access.
-
setExpirationTime
The expiration time of the preview token in UTC. This is used to inform clients of when to expect the token to be expired. -
setAuthor
The username of the author associated with the preview token. -
setSandboxIds
The set of sandbox IDs the preview token is authorized for. -
setTenantId
The ID of the tenant this preview token is authorized for. -
setApplicationId
The ID of the application this preview token is authorized for. -
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-