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.
  • Constructor Details

    • RequestInfo

      public RequestInfo()
  • Method Details

    • 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.

      Doesn't include the query string with the request parameters (see requestQueryString().

    • requestQueryString

      public abstract Optional<String> requestQueryString()
      Request query string that contains the request parameters.

      Only set if request type is RequestInfo.RequestType.REST.

    • headers

      public abstract com.google.common.collect.ImmutableList<String> headers()
      Request headers in the form '<header-name>:<header-value>'.
    • 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()