Class ReqContext

java.lang.Object
org.apache.storm.security.auth.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
  • Constructor Details

  • Method Details

    • 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.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • setRemoteAddress

      public void setRemoteAddress(InetAddress addr)
      client address.
    • remoteAddress

      public InetAddress remoteAddress()
    • 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.