Package com.google.gerrit.server
Class RequestInfo
- java.lang.Object
-
- com.google.gerrit.server.RequestInfo
-
public abstract class RequestInfo extends Object
Information about a request that was received from a user.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RequestInfo.Builder
static class
RequestInfo.RequestType
Channel through which a user request was received.
-
Constructor Summary
Constructors Constructor Description RequestInfo()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static RequestInfo.Builder
builder()
static RequestInfo.Builder
builder(RequestInfo.RequestType requestType, CurrentUser callingUser, com.google.gerrit.server.logging.TraceContext traceContext)
abstract CurrentUser
callingUser()
The user that has sent the request.String
formatForLogging()
abstract Optional<Project.NameKey>
project()
The name of the project for which the request is being done.Optional<String>
redactedRequestUri()
Redacted request URI.abstract String
requestType()
Type of the request, telling through which channel the request was coming in.abstract Optional<String>
requestUri()
Request URI.abstract com.google.gerrit.server.logging.TraceContext
traceContext()
The trace context of the request.
-
-
-
Method Detail
-
requestType
public abstract String 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
public abstract Optional<String> requestUri()
Request URI.Only set if request type is
RequestInfo.RequestType.REST
.Never includes the "/a" prefix.
-
redactedRequestUri
@Memoized public Optional<String> redactedRequestUri()
Redacted request URI.Request URI where resource IDs are replaced by '*'.
-
callingUser
public abstract CurrentUser 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
public abstract Optional<Project.NameKey> 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
@Memoized public String formatForLogging()
-
builder
public static RequestInfo.Builder builder(RequestInfo.RequestType requestType, CurrentUser callingUser, com.google.gerrit.server.logging.TraceContext traceContext)
-
builder
public static RequestInfo.Builder builder()
-
-