Class ReqContext


  • public class ReqContext
    extends Object
    Request context. Context request context includes info about:
    1. remote address
    2. remote subject and primary principal
    3. request ID
    • Method Detail

      • context

        public static ReqContext context()
        Get context.
        Returns:
        a request context associated with current thread
      • reset

        public static void reset()
        Reset the context back to a default. used for testing.
      • setRemoteAddress

        public void setRemoteAddress​(InetAddress addr)
        client address.
      • setSubject

        public void setSubject​(Subject subject)
        Set remote subject explicitly.
      • subject

        public Subject subject()
        Retrieve client subject associated with this request context.
      • principal

        public Principal principal()
        The primary principal associated current subject.
      • setRealPrincipal

        public void setRealPrincipal​(Principal realPrincipal)
      • realPrincipal

        public Principal realPrincipal()
        The real principal associated with the subject.
      • isImpersonating

        public boolean isImpersonating()
        Check whether context is impersonating.
        Returns:
        true if this request is an impersonation request.
      • requestID

        public int requestID()
        request ID of this request.