Class McpExchange
java.lang.Object
org.apache.juneau.rest.server.mcp.McpExchange
The inbound JSON-RPC envelope plus request-header access, with no servlet or HTTP types attached.
This is the sole argument a revision receives about the transport. It exists so a revision can read protocol headers (later MCP revisions route on them) without the core or the revision depending on a servlet API.
-
Constructor Summary
ConstructorsConstructorDescriptionMcpExchange(JsonRpcRequest request, UnaryOperator<String> headers) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionLooks up a request header.request()The inbound JSON-RPC request envelope.
-
Constructor Details
-
McpExchange
Constructor.- Parameters:
request- The bound JSON-RPC request envelope. Can benull (an unparseable or absent body), which a revision must report as an invalid request.headers- Header lookup by name, returningnull for an absent header. Must not benull .
-
-
Method Details
-
request
The inbound JSON-RPC request envelope.- Returns:
- The envelope, or
null if the body was absent or unparseable.
-
header
Looks up a request header.- Parameters:
name- The header name. Can benull .- Returns:
- The header value, or
null if absent.
-