Interface ContextInformationLoader

All Known Implementing Classes:
DefaultContextInformationLoader

public interface ContextInformationLoader
Interface for context information loader
  • Method Summary

    Modifier and Type
    Method
    Description
    initializeSiteFromRequest(javax.servlet.http.HttpServletRequest request)
    Method resolves base site uid from URL and set it as current site i.e
    /rest/v1/mysite/cart, or
    /rest/v1/mysite/customers/current
    would try to set base site with uid=mysite as a current site.
    setCurrencyFromRequest(javax.servlet.http.HttpServletRequest request)
    Method set current currency based on information from request and recalculate cart for current session
    setLanguageFromRequest(javax.servlet.http.HttpServletRequest request)
    Method set current language base on information from request
  • Method Details

    • initializeSiteFromRequest

      BaseSiteModel initializeSiteFromRequest(javax.servlet.http.HttpServletRequest request) throws InvalidResourceException
      Method resolves base site uid from URL and set it as current site i.e
      /rest/v1/mysite/cart, or
      /rest/v1/mysite/customers/current
      would try to set base site with uid=mysite as a current site.
      Parameters:
      request - - request from which we should get base site uid
      Returns:
      baseSite set as current site or null
      Throws:
      InvalidResourceException
    • setLanguageFromRequest

      LanguageModel setLanguageFromRequest(javax.servlet.http.HttpServletRequest request) throws UnsupportedLanguageException
      Method set current language base on information from request
      Parameters:
      request - - request from which we should get language information
      Returns:
      language set as current
      Throws:
      UnsupportedLanguageException
    • setCurrencyFromRequest

      CurrencyModel setCurrencyFromRequest(javax.servlet.http.HttpServletRequest request) throws UnsupportedCurrencyException, RecalculationException
      Method set current currency based on information from request and recalculate cart for current session
      Parameters:
      request - - request from which we should get currency information
      Returns:
      currency set as current
      Throws:
      UnsupportedCurrencyException
      RecalculationException