Class NoopInteractionContext
java.lang.Object
dev.tachyonmcp.core.server.session.NoopInteractionContext
- All Implemented Interfaces:
InteractionContext,ChannelContext,DispatchContext
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.tachyonmcp.api.runtime.InteractionContext
InteractionContext.Lifecycle -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclient()Returns typed access to the client-facing elicitation and sampling services.voidenableExtension(String extensionId) Enables an extension for this channel.engine()Returns the owningServerEngine.<T> Optional<T> get(AttributeKey<T> key) Returns the value stored underkey, or empty if never set.@Nullable LoggingLevelReturns the logging level for the current session, ornullwhen unset or session-less.@Nullable LoggingLevelReturns the log level this specific request permits, ornullif it set none.booleanisExtensionEnabled(String extensionId) Returnstrueif the given extension is active for this interaction.@Nullable InteractionContext.LifecycleReturns the current lifecycle phase, ornullbefore initialisation.Returns the notification sender bound to this interaction.@Nullable OutboundSseStreamReturns the outbound SSE stream, ornullif not yet upgraded.protocol()Returns the MCP protocol version negotiated for this channel.Returns the protocol request mapper for the current protocol version.Returns the protocol response mapper for the current protocol version.sendRequest(String method, Object params) Sends a request to the client and returns a future that completes with the raw JSON response.@Nullable Sessionsession()Returns the current session, ornullif not yet established.<T> voidset(AttributeKey<T> key, T value) Storesvalueunderkey, visible to laterInteractionContext.get(AttributeKey)calls — seeInteractionContext.get(AttributeKey)for scope and thread-safety.voidsetLifecycle(InteractionContext.Lifecycle lifecycle) Sets the lifecycle state for this channel.voidsetLoggingLevel(LoggingLevel level) Sets the logging level for the current session; no-op when no session is bound.voidsetOutboundStream(@Nullable OutboundSseStream stream) Sets the outbound SSE stream for this dispatch.voidsetPermittedLogLevel(@Nullable LoggingLevel level) Sets the log level this specific request permits (from_meta.../logLevel, protocols without sessions).voidsetSession(@Nullable Session session) Sets the session for this channel.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.tachyonmcp.core.runtime.ChannelContext
protocolVersion, sessionId
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
NoopInteractionContext
public NoopInteractionContext()
-
-
Method Details
-
protocol
Description copied from interface:ChannelContextReturns the MCP protocol version negotiated for this channel.- Specified by:
protocolin interfaceChannelContext- Returns:
- the protocol
-
lifecycle
Description copied from interface:InteractionContextReturns the current lifecycle phase, ornullbefore initialisation.- Specified by:
lifecyclein interfaceInteractionContext- Returns:
- the lifecycle phase, or
null
-
setLifecycle
Description copied from interface:ChannelContextSets the lifecycle state for this channel.- Specified by:
setLifecyclein interfaceChannelContext- Parameters:
lifecycle- the new lifecycle state
-
session
Description copied from interface:ChannelContextReturns the current session, ornullif not yet established.- Specified by:
sessionin interfaceChannelContext- Returns:
- the session, or
null
-
setSession
Description copied from interface:ChannelContextSets the session for this channel.- Specified by:
setSessionin interfaceChannelContext- Parameters:
session- the session, ornullto clear
-
get
Description copied from interface:InteractionContextReturns the value stored underkey, or empty if never set.Scoped to the underlying channel/session, not the current request — a value set on one request is visible to later requests on the same connection. Backed by a concurrent map: safe to call from multiple handler threads without external synchronization.
- Specified by:
getin interfaceInteractionContext- Type Parameters:
T- the type of value- Parameters:
key- the attribute key- Returns:
- the value, or empty if not set
-
set
Description copied from interface:InteractionContextStoresvalueunderkey, visible to laterInteractionContext.get(AttributeKey)calls — seeInteractionContext.get(AttributeKey)for scope and thread-safety.- Specified by:
setin interfaceInteractionContext- Type Parameters:
T- the type of value- Parameters:
key- the attribute keyvalue- the value to store
-
enableExtension
Description copied from interface:ChannelContextEnables an extension for this channel.- Specified by:
enableExtensionin interfaceChannelContext- Parameters:
extensionId- the extension identifier
-
isExtensionEnabled
Description copied from interface:InteractionContextReturnstrueif the given extension is active for this interaction.- Specified by:
isExtensionEnabledin interfaceInteractionContext- Parameters:
extensionId- the extension identifier- Returns:
trueif the extension is active
-
notifications
Description copied from interface:InteractionContextReturns the notification sender bound to this interaction.- Specified by:
notificationsin interfaceInteractionContext- Returns:
- the notification sender
-
sendRequest
Description copied from interface:InteractionContextSends a request to the client and returns a future that completes with the raw JSON response.Experimental escape hatch for client requests not covered by
InteractionContext.client(), such as URL-mode elicitation or sampling parameters beyond whatSamplingServicemodels.- Specified by:
sendRequestin interfaceInteractionContext- Parameters:
method- the request method nameparams- the request parameters- Returns:
- a future that completes with the raw JSON response
-
client
Description copied from interface:InteractionContextReturns typed access to the client-facing elicitation and sampling services.Prefer this over
InteractionContext.sendRequest(String, Object)for sampling/elicitation round-trips — it returns domain results instead of raw JSON.- Specified by:
clientin interfaceInteractionContext- Returns:
- the client context
-
engine
Description copied from interface:DispatchContextReturns the owningServerEngine.- Specified by:
enginein interfaceDispatchContext
-
setLoggingLevel
Description copied from interface:DispatchContextSets the logging level for the current session; no-op when no session is bound.- Specified by:
setLoggingLevelin interfaceDispatchContext
-
getLoggingLevel
Description copied from interface:DispatchContextReturns the logging level for the current session, ornullwhen unset or session-less.- Specified by:
getLoggingLevelin interfaceDispatchContext
-
setPermittedLogLevel
Description copied from interface:DispatchContextSets the log level this specific request permits (from_meta.../logLevel, protocols without sessions). UnlikeDispatchContext.setLoggingLevel(dev.tachyonmcp.api.server.domain.LoggingLevel), this is request-scoped, not session-scoped.- Specified by:
setPermittedLogLevelin interfaceDispatchContext
-
getPermittedLogLevel
Description copied from interface:DispatchContextReturns the log level this specific request permits, ornullif it set none.- Specified by:
getPermittedLogLevelin interfaceDispatchContext
-
responseMapper
Description copied from interface:DispatchContextReturns the protocol response mapper for the current protocol version.- Specified by:
responseMapperin interfaceDispatchContext
-
requestMapper
Description copied from interface:DispatchContextReturns the protocol request mapper for the current protocol version.- Specified by:
requestMapperin interfaceDispatchContext
-
outboundStream
Description copied from interface:DispatchContextReturns the outbound SSE stream, ornullif not yet upgraded.- Specified by:
outboundStreamin interfaceDispatchContext
-
setOutboundStream
Description copied from interface:DispatchContextSets the outbound SSE stream for this dispatch.- Specified by:
setOutboundStreamin interfaceDispatchContext
-