|
14 | 14 | * limitations under the License. |
15 | 15 | */ |
16 | 16 |
|
17 | | -package org.springframework.ai.mcp.client.common.autoconfigure; |
| 17 | +package org.springframework.ai.mcp.client.common.autoconfigure.annotations; |
18 | 18 |
|
19 | 19 | import java.util.List; |
| 20 | +import java.util.concurrent.ConcurrentHashMap; |
20 | 21 |
|
21 | 22 | import org.springaicommunity.mcp.method.elicitation.SyncElicitationSpecification; |
22 | 23 | import org.springaicommunity.mcp.method.logging.SyncLoggingSpecification; |
23 | 24 | import org.springaicommunity.mcp.method.progress.SyncProgressSpecification; |
24 | 25 | import org.springaicommunity.mcp.method.sampling.SyncSamplingSpecification; |
25 | 26 | import org.springframework.ai.mcp.customizer.McpSyncClientCustomizer; |
26 | 27 | import org.springframework.util.CollectionUtils; |
27 | | -import org.springframework.util.StringUtils; |
28 | 28 |
|
29 | 29 | import io.modelcontextprotocol.client.McpClient.SyncSpec; |
30 | 30 |
|
@@ -57,31 +57,31 @@ public void customize(String name, SyncSpec clientSpec) { |
57 | 57 |
|
58 | 58 | if (!CollectionUtils.isEmpty(syncElicitationSpecifications)) { |
59 | 59 | this.syncElicitationSpecifications.forEach(elicitationSpec -> { |
60 | | - if (!StringUtils.hasText(elicitationSpec.clientId()) || elicitationSpec.clientId().equals(name)) { |
| 60 | + if (elicitationSpec.clientId().equalsIgnoreCase(name)) { |
61 | 61 | clientSpec.elicitation(elicitationSpec.elicitationHandler()); |
62 | 62 | } |
63 | 63 | }); |
64 | 64 | } |
65 | 65 |
|
66 | 66 | if (!CollectionUtils.isEmpty(syncSamplingSpecifications)) { |
67 | 67 | this.syncSamplingSpecifications.forEach(samplingSpec -> { |
68 | | - if (!StringUtils.hasText(samplingSpec.clientId()) || samplingSpec.clientId().equals(name)) { |
| 68 | + if (samplingSpec.clientId().equalsIgnoreCase(name)) { |
69 | 69 | clientSpec.sampling(samplingSpec.samplingHandler()); |
70 | 70 | } |
71 | 71 | }); |
72 | 72 | } |
73 | 73 |
|
74 | 74 | if (!CollectionUtils.isEmpty(syncLoggingSpecifications)) { |
75 | 75 | this.syncLoggingSpecifications.forEach(loggingSpec -> { |
76 | | - if (!StringUtils.hasText(loggingSpec.clientId()) || loggingSpec.clientId().equals(name)) { |
| 76 | + if (loggingSpec.clientId().equalsIgnoreCase(name)) { |
77 | 77 | clientSpec.loggingConsumer(loggingSpec.loggingHandler()); |
78 | 78 | } |
79 | 79 | }); |
80 | 80 | } |
81 | 81 |
|
82 | 82 | if (!CollectionUtils.isEmpty(syncProgressSpecifications)) { |
83 | 83 | this.syncProgressSpecifications.forEach(progressSpec -> { |
84 | | - if (!StringUtils.hasText(progressSpec.clientId()) || progressSpec.clientId().equals(name)) { |
| 84 | + if (progressSpec.clientId().equalsIgnoreCase(name)) { |
85 | 85 | clientSpec.progressConsumer(progressSpec.progressHandler()); |
86 | 86 | } |
87 | 87 | }); |
|
0 commit comments