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 ofPreviewSandboxWebRequestResolverthat resolves a preview sandbox idStringfrom 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 StringDEFAULT_HEADER_NAME
-
Constructor Summary
Constructors Constructor Description DefaultPreviewSandboxWebRequestResolver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringgetHeaderName()protected StringparseRequestHeader(org.springframework.web.context.request.NativeWebRequest webRequest)Stringresolve(org.springframework.web.context.request.NativeWebRequest webRequest)Attempts to resolve a preview sandbox id for the provided request.voidsetHeaderName(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:PreviewSandboxWebRequestResolverAttempts 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:
resolvein 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)
-
-