Package lumis.portal

Class PortalRequestContext

  • All Implemented Interfaces:
    java.lang.AutoCloseable, VariableResolver

    public class PortalRequestContext
    extends java.lang.Object
    implements VariableResolver, java.lang.AutoCloseable

    Stores all request context on LumisXP.

    The request context can be Devices informations, Session informations, information from External Entities, etc.

    It's possible to plug custom Request Context developed by user. In this case just use the #setEntry(String, IPortalRequestContextEntry).

    Since:
    6.0.0
    Version:
    $Revision: 25808 $ $Date: 2023-07-04 15:20:55 -0300 (Tue, 04 Jul 2023) $
    • Constructor Detail

      • PortalRequestContext

        public PortalRequestContext()
    • Method Detail

      • getEntry

        public java.lang.Object getEntry​(java.lang.String key)
        Returns the specific request context based on Key parameter.
        Parameters:
        key - id of the Request context to be find. This information is the entry key of the map.
        Returns:
        the Request Context that match with key parameter.
        Since:
        6.0.0
      • getDeviceEntry

        public java.util.Map<java.lang.String,​java.lang.String> getDeviceEntry()
        Returns the Device Request Context thats contains all information about the device that is making the current request.
        Returns:
        a map with the device properties.
        Since:
        6.0.0
      • setEntry

        public void setEntry​(java.lang.String key,
                             java.lang.Object value)
        Puts a custom request context on the context map to be used in another time.
        Parameters:
        key - name of the Request Context. This information is the entry key of the map.
        value - the custom context value. If it implements Supplier, it will be replaced by the Supplier.get() value when accessed (as a lazy load feature).
        Since:
        6.0.0
      • getPortalRequestContext

        public static PortalRequestContext getPortalRequestContext​(HttpServletRequest request)
        Returns the Portal Request Context from a given request.
        Parameters:
        request - request that contains the PortalRequestContext.
        Returns:
        the Portal Request Context.
        Since:
        6.0.0
      • getPortalRequestContext

        public static PortalRequestContext getPortalRequestContext​(IServiceInterfaceRequest request)
        Returns the Portal Request Context from a given request.
        Parameters:
        request - request that contains the PortalRequestContext.
        Returns:
        the Portal Request Context.
        Since:
        6.0.0
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable