McpClientSession instead@Deprecated public class DefaultMcpSession extends Object implements McpSession
The session manages:
| Modifier and Type | Class and Description |
|---|---|
static class |
DefaultMcpSession.MethodNotFoundError
Deprecated.
|
static interface |
DefaultMcpSession.NotificationHandler
Deprecated.
Functional interface for handling incoming JSON-RPC notifications.
|
static interface |
DefaultMcpSession.RequestHandler<T>
Deprecated.
Functional interface for handling incoming JSON-RPC requests.
|
| Constructor and Description |
|---|
DefaultMcpSession(Duration requestTimeout,
McpTransport transport,
Map<String,DefaultMcpSession.RequestHandler<?>> requestHandlers,
Map<String,DefaultMcpSession.NotificationHandler> notificationHandlers)
Deprecated.
Creates a new DefaultMcpSession with the specified configuration and handlers.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Deprecated.
Closes the session immediately, potentially interrupting pending operations.
|
reactor.core.publisher.Mono<Void> |
closeGracefully()
Deprecated.
Closes the session gracefully, allowing pending operations to complete.
|
static DefaultMcpSession.MethodNotFoundError |
getMethodNotFoundError(String method)
Deprecated.
|
reactor.core.publisher.Mono<Void> |
sendNotification(String method,
Map<String,Object> params)
Deprecated.
Sends a JSON-RPC notification.
|
<T> reactor.core.publisher.Mono<T> |
sendRequest(String method,
Object requestParams,
com.fasterxml.jackson.core.type.TypeReference<T> typeRef)
Deprecated.
Sends a JSON-RPC request and returns the response.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsendNotificationpublic DefaultMcpSession(Duration requestTimeout, McpTransport transport, Map<String,DefaultMcpSession.RequestHandler<?>> requestHandlers, Map<String,DefaultMcpSession.NotificationHandler> notificationHandlers)
requestTimeout - Duration to wait for responsestransport - Transport implementation for message exchangerequestHandlers - Map of method names to request handlersnotificationHandlers - Map of method names to notification handlerspublic static DefaultMcpSession.MethodNotFoundError getMethodNotFoundError(String method)
public <T> reactor.core.publisher.Mono<T> sendRequest(String method, Object requestParams, com.fasterxml.jackson.core.type.TypeReference<T> typeRef)
sendRequest in interface McpSessionT - The expected response typemethod - The method name to callrequestParams - The request parameterstypeRef - Type reference for response deserializationpublic reactor.core.publisher.Mono<Void> sendNotification(String method, Map<String,Object> params)
sendNotification in interface McpSessionmethod - The method name for the notificationparams - The notification parameterspublic reactor.core.publisher.Mono<Void> closeGracefully()
closeGracefully in interface McpSessionpublic void close()
close in interface McpSessionCopyright © 2025. All rights reserved.