java.lang.Object
com.broadleafcommerce.data.tracking.core.interlink.MockWebRequest
All Implemented Interfaces:
org.springframework.web.context.request.NativeWebRequest, org.springframework.web.context.request.RequestAttributes, org.springframework.web.context.request.WebRequest

public class MockWebRequest extends Object implements org.springframework.web.context.request.NativeWebRequest
Using known values from InterlinkRequest and URI related information, provide a subset of data about the request in the form of a NativeRequest instance. This is useful for ContextInfo construction during direct method calls in InterlinkClient instances.
  • Constructor Details

    • MockWebRequest

      public MockWebRequest(InterlinkRequest request, org.springframework.web.util.UriComponents uriComponents)
  • Method Details

    • getNativeRequest

      public Object getNativeRequest()
      Specified by:
      getNativeRequest in interface org.springframework.web.context.request.NativeWebRequest
    • getNativeResponse

      public Object getNativeResponse()
      Specified by:
      getNativeResponse in interface org.springframework.web.context.request.NativeWebRequest
    • getNativeRequest

      public <T> T getNativeRequest(Class<T> requiredType)
      Specified by:
      getNativeRequest in interface org.springframework.web.context.request.NativeWebRequest
    • getNativeResponse

      public <T> T getNativeResponse(Class<T> requiredType)
      Specified by:
      getNativeResponse in interface org.springframework.web.context.request.NativeWebRequest
    • getHeader

      public String getHeader(String headerName)
      Specified by:
      getHeader in interface org.springframework.web.context.request.WebRequest
    • getHeaderValues

      public String[] getHeaderValues(String headerName)
      Specified by:
      getHeaderValues in interface org.springframework.web.context.request.WebRequest
    • getHeaderNames

      public Iterator<String> getHeaderNames()
      Specified by:
      getHeaderNames in interface org.springframework.web.context.request.WebRequest
    • getParameter

      public String getParameter(String paramName)
      Specified by:
      getParameter in interface org.springframework.web.context.request.WebRequest
    • getParameterValues

      public String[] getParameterValues(String paramName)
      Specified by:
      getParameterValues in interface org.springframework.web.context.request.WebRequest
    • getParameterNames

      public Iterator<String> getParameterNames()
      Specified by:
      getParameterNames in interface org.springframework.web.context.request.WebRequest
    • getParameterMap

      public Map<String,String[]> getParameterMap()
      Specified by:
      getParameterMap in interface org.springframework.web.context.request.WebRequest
    • getLocale

      public Locale getLocale()
      Specified by:
      getLocale in interface org.springframework.web.context.request.WebRequest
    • getContextPath

      public String getContextPath()
      Specified by:
      getContextPath in interface org.springframework.web.context.request.WebRequest
    • getRemoteUser

      public String getRemoteUser()
      Specified by:
      getRemoteUser in interface org.springframework.web.context.request.WebRequest
    • getUserPrincipal

      public Principal getUserPrincipal()
      Specified by:
      getUserPrincipal in interface org.springframework.web.context.request.WebRequest
    • isUserInRole

      public boolean isUserInRole(String role)
      Specified by:
      isUserInRole in interface org.springframework.web.context.request.WebRequest
    • isSecure

      public boolean isSecure()
      Specified by:
      isSecure in interface org.springframework.web.context.request.WebRequest
    • checkNotModified

      public boolean checkNotModified(long lastModifiedTimestamp)
      Specified by:
      checkNotModified in interface org.springframework.web.context.request.WebRequest
    • checkNotModified

      public boolean checkNotModified(String etag)
      Specified by:
      checkNotModified in interface org.springframework.web.context.request.WebRequest
    • checkNotModified

      public boolean checkNotModified(String etag, long lastModifiedTimestamp)
      Specified by:
      checkNotModified in interface org.springframework.web.context.request.WebRequest
    • getDescription

      public String getDescription(boolean includeClientInfo)
      Specified by:
      getDescription in interface org.springframework.web.context.request.WebRequest
    • getAttribute

      public Object getAttribute(String name, int scope)
      Specified by:
      getAttribute in interface org.springframework.web.context.request.RequestAttributes
    • setAttribute

      public void setAttribute(String name, Object value, int scope)
      Specified by:
      setAttribute in interface org.springframework.web.context.request.RequestAttributes
    • removeAttribute

      public void removeAttribute(String name, int scope)
      Specified by:
      removeAttribute in interface org.springframework.web.context.request.RequestAttributes
    • getAttributeNames

      public String[] getAttributeNames(int scope)
      Specified by:
      getAttributeNames in interface org.springframework.web.context.request.RequestAttributes
    • registerDestructionCallback

      public void registerDestructionCallback(String name, Runnable callback, int scope)
      Specified by:
      registerDestructionCallback in interface org.springframework.web.context.request.RequestAttributes
    • resolveReference

      public Object resolveReference(String key)
      Specified by:
      resolveReference in interface org.springframework.web.context.request.RequestAttributes
    • getSessionId

      public String getSessionId()
      Specified by:
      getSessionId in interface org.springframework.web.context.request.RequestAttributes
    • getSessionMutex

      public Object getSessionMutex()
      Specified by:
      getSessionMutex in interface org.springframework.web.context.request.RequestAttributes
    • toString

      public String toString()
      Overrides:
      toString in class Object