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 ReqContext
context()
Get context.boolean
isImpersonating()
Check whether context is impersonating.Principal
principal()
The primary principal associated current subject.Principal
realPrincipal()
The real principal associated with the subject.InetAddress
remoteAddress()
int
requestID()
request ID of this request.static void
reset()
Reset the context back to a default.void
setRealPrincipal(Principal realPrincipal)
void
setRemoteAddress(InetAddress addr)
client address.void
setSubject(Subject subject)
Set remote subject explicitly.Subject
subject()
Retrieve client subject associated with this request context.String
toString()
-
-
-
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.
-
-