Interface ResourceRequest

All Superinterfaces:
HasMeta, ServerFeature.Request

@Immutable public interface ResourceRequest extends ServerFeature.Request
Request passed to a resource function when a client invokes resources/read.

Carries the concrete resource uri() that was read, optionally the uriTemplate() that matched, and any URI-template params() extracted during matching.

  • Method Details

    • uri

      String uri()
      The resource URI being requested.
    • params

      @Default default Map<String,UriTemplateValue> params()
      URI-template variable values extracted during template matching, keyed by variable name. Empty when the request targets a static (non-template) resource.
    • uriTemplate

      @Nullable String uriTemplate()
      The URI template that matched the request, or null when the request targets a static (non-template) resource.
    • meta

      @Nullable Map<String,Object> meta()
      Optional protocol extension metadata.
      Specified by:
      meta in interface HasMeta
      Returns:
      the metadata map, or null if none
    • inputResponses

      @Nullable Map<String,Object> inputResponses()
      Returns the client responses supplied when retrying an input-required resource read.
      Returns:
      input responses, or null
    • requestState

      @Nullable String requestState()
      Returns the opaque request state supplied when retrying an input-required resource read.
      Returns:
      request state, or null
    • builder

      static ResourceRequest.Builder builder()
      Creates a new builder for ResourceRequest.