Class RequestStorageImpl

  • All Implemented Interfaces:
    RequestStorage, RequestStorageWrite

    public class RequestStorageImpl
    extends Object
    implements RequestStorageWrite
    Impl for the request store, will store values in the request itself and will maintain a map of all request values in a threadlocal which should always be cleared at the end of the request
    Author:
    Aaron Zeckoski (azeckoski @ gmail.com)
    • Constructor Detail

      • RequestStorageImpl

        protected RequestStorageImpl()
      • RequestStorageImpl

        public RequestStorageImpl​(RequestGetter requestGetter)
    • Method Detail

      • setRequestGetter

        public void setRequestGetter​(RequestGetter requestGetter)
      • inRequest

        public boolean inRequest()
      • getStorageMapCopy

        public Map<String,​Object> getStorageMapCopy​(boolean includeInternal,
                                                          boolean includeHeaders,
                                                          boolean includeParams,
                                                          boolean includeAttributes)
        Special version which allows getting only the parts that are desired
        Specified by:
        getStorageMapCopy in interface RequestStorage
        Parameters:
        includeInternal - include the internal request values
        includeHeaders - include the request headers
        includeParams - include the request parameters
        includeAttributes - include the request attributes
        Returns:
        the map with the requested values
      • reset

        public void reset()
        Resets the request storage and purges all stored values (has no effect on the data in the request)
        Specified by:
        reset in interface RequestStorageWrite
      • setRequestValue

        public void setRequestValue​(String key,
                                    Object value)
        Allows user to set the value of a key directly, including reserved keys
        Specified by:
        setRequestValue in interface RequestStorageWrite
        Parameters:
        key -
        value -
      • getRequestValue

        protected Object getRequestValue​(String key)
      • getAllRequestValues

        protected Map<String,​Object> getAllRequestValues()
      • getRequestValues

        protected Map<String,​Object> getRequestValues​(boolean includeHeaders,
                                                            boolean includeParams,
                                                            boolean includeAttributes)
      • getRequestValues

        public static Map<String,​Object> getRequestValues​(HttpServletRequest request,
                                                                boolean includeHeaders,
                                                                boolean includeParams,
                                                                boolean includeAttributes)