@InterfaceAudience.Private public class RequestContext extends Object
null
. The CallRunner
class before it a call and then on
its way out, it will clear the thread local.Modifier and Type | Method and Description |
---|---|
static void |
clear()
Clears out the client credentials for a given request.
|
static RequestContext |
get() |
InetAddress |
getRemoteAddress() |
static User |
getRequestUser()
Returns the user credentials associated with the current RPC request or
null if no credentials were provided. |
static String |
getRequestUserName()
Returns the username for any user associated with the current RPC
request or
null if no user is set. |
com.google.protobuf.BlockingService |
getService() |
User |
getUser() |
static boolean |
isInRequestContext()
Indicates whether or not the current thread is within scope of executing
an RPC request.
|
static void |
set(User user,
InetAddress remoteAddress,
com.google.protobuf.BlockingService service)
Initializes the client credentials for the current request.
|
public static RequestContext get()
public static User getRequestUser()
null
if no credentials were provided.public static String getRequestUserName()
null
if no user is set.public static boolean isInRequestContext()
public static void set(User user, InetAddress remoteAddress, com.google.protobuf.BlockingService service)
user
- remoteAddress
- service
- public static void clear()
public User getUser()
public InetAddress getRemoteAddress()
public com.google.protobuf.BlockingService getService()
Copyright © 2014 The Apache Software Foundation. All rights reserved.