Class DefaultPreviewSandboxWebRequestResolver
java.lang.Object
com.broadleafcommerce.data.tracking.core.preview.context.DefaultPreviewSandboxWebRequestResolver
- All Implemented Interfaces:
PreviewSandboxWebRequestResolver
public class DefaultPreviewSandboxWebRequestResolver
extends Object
implements PreviewSandboxWebRequestResolver
The default implementation of
PreviewSandboxWebRequestResolver
that resolves a preview
sandbox id String
from a NativeWebRequest
.
This resolver will look for a header named getHeaderName()
to detect a preview sandbox
id String
. If a sandbox id is found, it will return i.
If this resolver either fails to detect a preview sandbox id, then it will return null
.
- Author:
- Bongani Mbigi (bongani-m)
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
protected String
parseRequestHeader
(org.springframework.web.context.request.NativeWebRequest webRequest) resolve
(org.springframework.web.context.request.NativeWebRequest webRequest) Attempts to resolve a preview sandbox id for the provided request.void
setHeaderName
(String headerName)
-
Field Details
-
DEFAULT_HEADER_NAME
- See Also:
-
-
Constructor Details
-
DefaultPreviewSandboxWebRequestResolver
public DefaultPreviewSandboxWebRequestResolver()
-
-
Method Details
-
resolve
Description copied from interface:PreviewSandboxWebRequestResolver
Attempts to resolve a preview sandbox id for the provided request.If no preview sandbox id is found this method is expected to return
null
.- Specified by:
resolve
in interfacePreviewSandboxWebRequestResolver
- Parameters:
webRequest
- the current web request- Returns:
- a preview sandbox id or
null
-
parseRequestHeader
protected String parseRequestHeader(org.springframework.web.context.request.NativeWebRequest webRequest) -
getHeaderName
-
setHeaderName
-