Interface RequestStorageWrite

  • All Superinterfaces:
    RequestStorage

    public interface RequestStorageWrite
    extends RequestStorage
    This allows write access to values which are stored in the current request thread, these values are inaccessible outside of a request and will be destroyed when the thread ends
    This also "magically" exposes all the values in the request (attributes and params) as if they were stored in the map as well, if there are conflicts then locally stored data always wins over data from the request
    Standard reserved keys have values that are always available:
    • _locale : Locale
    • _requestEntityReference : String
    • _requestActive : [true,false]
    • _requestOrigin : ['REST','EXTERNAL','INTERNAL']
    Author:
    Aaron Zeckoski (azeckoski @ gmail.com)
    • Method Detail

      • setStoredValue

        void setStoredValue​(String key,
                            Object value)
        Store a value in the request storage with an associated key
        Parameters:
        key - a key for a stored value
        value - an object to store
        Throws:
        IllegalArgumentException - if the key OR value are null, also if an attempt is made to change a reserved value (see RequestStorageWrite)
      • setRequestValues

        void setRequestValues​(Map<String,​Object> params)
        Place all these params into the request storage
        Parameters:
        params - map of string -> value params
        Throws:
        IllegalArgumentException - if the key OR value are null, also if an attempt is made to change a reserved value (see RequestStorageWrite)
      • setRequestValue

        void setRequestValue​(String key,
                             Object value)
        Allows user to set the value of a key directly, including reserved keys
        Parameters:
        key - the name of the value
        value - the value to store
        Throws:
        IllegalArgumentException - if the key OR value are null, also if an attempt is made to change a reserved value (see RequestStorageWrite)
      • reset

        void reset()
        Clear all values in the request storage (does not wipe the values form the request itself)