|
9 | 9 |
|
10 | 10 | import com.fasterxml.jackson.core.type.TypeReference;
|
11 | 11 | import io.modelcontextprotocol.server.McpAsyncServerExchange;
|
12 |
| -import io.modelcontextprotocol.spec.McpSchema.LoggingLevel; |
13 |
| -import io.modelcontextprotocol.util.Assert; |
14 | 12 | import org.slf4j.Logger;
|
15 | 13 | import org.slf4j.LoggerFactory;
|
16 | 14 | import reactor.core.publisher.Mono;
|
@@ -55,8 +53,6 @@ public class McpServerSession implements McpSession {
|
55 | 53 |
|
56 | 54 | private final AtomicInteger state = new AtomicInteger(STATE_UNINITIALIZED);
|
57 | 55 |
|
58 |
| - private volatile LoggingLevel minLoggingLevel = LoggingLevel.INFO; |
59 |
| - |
60 | 56 | /**
|
61 | 57 | * Creates a new server session with the given parameters and the transport to use.
|
62 | 58 | * @param id session id
|
@@ -88,23 +84,6 @@ public String getId() {
|
88 | 84 | return this.id;
|
89 | 85 | }
|
90 | 86 |
|
91 |
| - /** |
92 |
| - * Checks if the logging level bigger or equal to the minimum set logging level. |
93 |
| - * @return true if the logging level is enabled, false otherwise |
94 |
| - */ |
95 |
| - public boolean isLoingLevelEnabled(LoggingLevel loggingLevel) { |
96 |
| - return loggingLevel.level() >= this.minLoggingLevel.level(); |
97 |
| - } |
98 |
| - |
99 |
| - /** |
100 |
| - * Set the minimum logging level for this session. |
101 |
| - * @param minLoggingLevel the minimum logging level |
102 |
| - */ |
103 |
| - public void setMinLoggingLevel(LoggingLevel minLoggingLevel) { |
104 |
| - Assert.notNull(minLoggingLevel, "minLoggingLevel can't be null"); |
105 |
| - this.minLoggingLevel = minLoggingLevel; |
106 |
| - } |
107 |
| - |
108 | 87 | /**
|
109 | 88 | * Called upon successful initialization sequence between the client and the server
|
110 | 89 | * with the client capabilities and information.
|
@@ -153,16 +132,6 @@ public <T> Mono<T> sendRequest(String method, Object requestParams, TypeReferenc
|
153 | 132 | }
|
154 | 133 |
|
155 | 134 | @Override
|
156 |
| - public Mono<Void> sendNotification(String method, Object params) { |
157 |
| - McpSchema.JSONRPCNotification jsonrpcNotification = new McpSchema.JSONRPCNotification(McpSchema.JSONRPC_VERSION, |
158 |
| - method, params); |
159 |
| - return this.transport.sendMessage(jsonrpcNotification); |
160 |
| - } |
161 |
| - |
162 |
| - // NOTE: This is a workaround for the fact that the {@link #sendNotification(String, |
163 |
| - // Map)} method doesn't accept types like LoggingMessageNotification |
164 |
| - // TODO investigate if this method can replace the {@link #sendNotification(String, |
165 |
| - // Map)} - Breaking change. |
166 | 135 | public Mono<Void> sendNotification(String method, Object params) {
|
167 | 136 | McpSchema.JSONRPCNotification jsonrpcNotification = new McpSchema.JSONRPCNotification(McpSchema.JSONRPC_VERSION,
|
168 | 137 | method, this.transport.unmarshalFrom(params, new TypeReference<Map<String, Object>>() {
|
|
0 commit comments