CONNECTION - the resource representing the connection that the transport
manages.public interface McpTransportSession<CONNECTION>
McpSession type that operates at the level of the JSON-RPC
communication protocol and matches asynchronous responses with previously issued
requests.| Modifier and Type | Method and Description |
|---|---|
void |
addConnection(CONNECTION connection)
Adds a resource that this transport session can monitor and dismiss when needed.
|
void |
close()
Close and clear the monitored resources.
|
org.reactivestreams.Publisher<Void> |
closeGracefully()
Close and clear the monitored resources in a graceful manner.
|
boolean |
markInitialized(String sessionId)
Stateful operation that flips the un-initialized state to initialized if this is
the first call.
|
void |
removeConnection(CONNECTION connection)
Called when the resource is terminating by itself and the transport session does
not need to track it anymore.
|
Optional<String> |
sessionId()
In case of stateful MCP servers, the value is present and contains the String
identifier for the transport-level session.
|
Optional<String> sessionId()
boolean markInitialized(String sessionId)
sessionId - session identifier as provided by the servertrue and means that a
post-initialization step can be performedvoid addConnection(CONNECTION connection)
connection - the managed resourcevoid removeConnection(CONNECTION connection)
connection - the resource to remove from the monitored collectionvoid close()
org.reactivestreams.Publisher<Void> closeGracefully()
Copyright © 2025. All rights reserved.