CONNECTION - the resource representing the connection that the transport
manages.public class ClosedMcpTransportSession<CONNECTION> extends java.lang.Object implements McpTransportSession<CONNECTION>
McpTransportSessionClosedException.| 构造器和说明 |
|---|
ClosedMcpTransportSession(java.lang.String sessionId) |
| 限定符和类型 | 方法和说明 |
|---|---|
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<java.lang.Void> |
closeGracefully()
Close and clear the monitored resources in a graceful manner.
|
boolean |
markInitialized(java.lang.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.
|
java.util.Optional<java.lang.String> |
sessionId()
In case of stateful MCP servers, the value is present and contains the String
identifier for the transport-level session.
|
public ClosedMcpTransportSession(@Nullable
java.lang.String sessionId)
public java.util.Optional<java.lang.String> sessionId()
McpTransportSessionsessionId 在接口中 McpTransportSession<CONNECTION>public boolean markInitialized(java.lang.String sessionId)
McpTransportSessionmarkInitialized 在接口中 McpTransportSession<CONNECTION>sessionId - session identifier as provided by the servertrue and means that a
post-initialization step can be performedpublic void addConnection(CONNECTION connection)
McpTransportSessionaddConnection 在接口中 McpTransportSession<CONNECTION>connection - the managed resourcepublic void removeConnection(CONNECTION connection)
McpTransportSessionremoveConnection 在接口中 McpTransportSession<CONNECTION>connection - the resource to remove from the monitored collectionpublic void close()
McpTransportSessionclose 在接口中 McpTransportSession<CONNECTION>public org.reactivestreams.Publisher<java.lang.Void> closeGracefully()
McpTransportSessioncloseGracefully 在接口中 McpTransportSession<CONNECTION>