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 ofPreviewSandboxWebRequestResolver
that resolves a preview sandbox idString
from aNativeWebRequest
.This resolver will look for a header named
getHeaderName()
to detect a preview sandbox idString
. 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
Fields Modifier and Type Field Description static String
DEFAULT_HEADER_NAME
-
Constructor Summary
Constructors Constructor Description DefaultPreviewSandboxWebRequestResolver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
getHeaderName()
protected String
parseRequestHeader(org.springframework.web.context.request.NativeWebRequest webRequest)
String
resolve(org.springframework.web.context.request.NativeWebRequest webRequest)
Attempts to resolve a preview sandbox id for the provided request.void
setHeaderName(String headerName)
-
-
-
Field Detail
-
DEFAULT_HEADER_NAME
public static final String DEFAULT_HEADER_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
resolve
public String resolve(org.springframework.web.context.request.NativeWebRequest webRequest)
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
protected String getHeaderName()
-
setHeaderName
public void setHeaderName(String headerName)
-
-