Record Class McpProtectedResourceMetadata
java.lang.Object
java.lang.Record
org.apache.juneau.rest.client.mcp.auth.McpProtectedResourceMetadata
- Record Components:
resource- Theresourceidentifier (the canonical URI of the protected MCP server). Nevernull.- Theauthorization_serversissuer URIs, in document order. May be empty.scopesSupported- Thescopes_supportedvalues, in document order. May be empty.extras- Unknown / server-specific fields. Read-only map.
public record McpProtectedResourceMetadata(URI resource, List<URI> authorizationServers, Set<String> scopesSupported, Map<String,Object> extras)
extends Record
Immutable view of an RFC 9728 Protected Resource Metadata (PRM) document, as an MCP client consumes it to discover
which authorization server(s) protect a given MCP server.
Only the fields the client needs are surfaced; unknown fields are preserved in extras().
See Also:
- Since:
- 10.0.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theauthorizationServersrecord component.final booleanIndicates whether some other object is "equal to" this one.extras()Returns the value of theextrasrecord component.Returns the first advertised authorization server, if any.final inthashCode()Returns a hash code value for this object.resource()Returns the value of theresourcerecord component.Returns the value of thescopesSupportedrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
firstAuthorizationServer
Returns the first advertised authorization server, if any.Per RFC 9728 §7.6 the client selects the authorization server; selecting the first entry is compliant and no mandatory alternate-AS fallback is required.
- Returns:
- The first authorization-server issuer URI, or
Optional.empty()if none are advertised.
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
resource
Returns the value of theresourcerecord component.- Returns:
- the value of the
resourcerecord component
-
authorizationServers
Returns the value of theauthorizationServersrecord component.- Returns:
- the value of the
authorizationServersrecord component
-
scopesSupported
Returns the value of thescopesSupportedrecord component.- Returns:
- the value of the
scopesSupportedrecord component
-
extras
Returns the value of theextrasrecord component.- Returns:
- the value of the
extrasrecord component
-