Package com.google.gerrit.server
Class RequestInfo
java.lang.Object
com.google.gerrit.server.RequestInfo
Information about a request that was received from a user.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static enum
Channel through which a user request was received. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic RequestInfo.Builder
builder()
static RequestInfo.Builder
builder
(RequestInfo.RequestType requestType, CurrentUser callingUser, com.google.gerrit.server.logging.TraceContext traceContext) abstract CurrentUser
The user that has sent the request.abstract com.google.common.collect.ImmutableList
<String> headers()
Request headers in the form '<header-name>:<header-value>
'.abstract Optional
<Project.NameKey> project()
The name of the project for which the request is being done.Redacted request URI.Request query string that contains the request parameters.abstract String
Type of the request, telling through which channel the request was coming in.Request URI.abstract com.google.gerrit.server.logging.TraceContext
The trace context of the request.
-
Constructor Details
-
RequestInfo
public RequestInfo()
-
-
Method Details
-
requestType
Type of the request, telling through which channel the request was coming in.See
RequestInfo.RequestType
for the types that are used by Gerrit core. Other request types are possible, e.g. if a plugin supports receiving requests through another channel. -
requestUri
Request URI.Only set if request type is
RequestInfo.RequestType.REST
.Never includes the "/a" prefix.
Doesn't include the query string with the request parameters (see
requestQueryString()
. -
requestQueryString
Request query string that contains the request parameters.Only set if request type is
RequestInfo.RequestType.REST
. -
headers
Request headers in the form '<header-name>:<header-value>
'. -
redactedRequestUri
Redacted request URI.Request URI where resource IDs are replaced by '*'.
-
callingUser
The user that has sent the request. -
traceContext
public abstract com.google.gerrit.server.logging.TraceContext traceContext()The trace context of the request. -
project
The name of the project for which the request is being done. Only available if the request is tied to a project or change. If a project is available it's not guaranteed that it actually exists (e.g. if a user made a request for a project that doesn't exist). -
formatForLogging
-
builder
public static RequestInfo.Builder builder(RequestInfo.RequestType requestType, CurrentUser callingUser, com.google.gerrit.server.logging.TraceContext traceContext) -
builder
-