Package org.apache.storm.security.auth
Class ReqContext
- java.lang.Object
-
- org.apache.storm.security.auth.ReqContext
-
public class ReqContext extends Object
Request context. Context request context includes info about:- remote address
- remote subject and primary principal
- request ID
-
-
Constructor Summary
Constructors Constructor Description ReqContext(AccessControlContext aclCtxt)ReqContext(Subject sub)ReqContext(ReqContext other)Copy Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ReqContextcontext()Get context.booleanisImpersonating()Check whether context is impersonating.Principalprincipal()The primary principal associated current subject.PrincipalrealPrincipal()The real principal associated with the subject.InetAddressremoteAddress()intrequestID()request ID of this request.static voidreset()Reset the context back to a default.voidsetRealPrincipal(Principal realPrincipal)voidsetRemoteAddress(InetAddress addr)client address.voidsetSubject(Subject subject)Set remote subject explicitly.Subjectsubject()Retrieve client subject associated with this request context.StringtoString()
-
-
-
Constructor Detail
-
ReqContext
public ReqContext(AccessControlContext aclCtxt)
-
ReqContext
public ReqContext(Subject sub)
-
ReqContext
public ReqContext(ReqContext other)
Copy Constructor.
-
-
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.
-
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.
-
-