ServerConnection class base
An active server connection.
Constructors
-
ServerConnection.fromStreamChannel(StreamChannel<
String> channel, {Sink<String> ? protocolLogSink, RootsSupport? rootsSupport, SamplingSupport? samplingSupport, ElicitationSupport? elicitationSupport}) -
A 1:1 connection from a client to a server using
channel
.
Properties
-
done
→ Future<
void> -
Completes after
shutdown
is called.no setterinherited - hashCode → int
-
The hash code for this object.
no setterinherited
- isActive → bool
-
Whether the connection with the peer is active.
no setterinherited
- name → String
-
The name of the associated server.
no setter
-
onLog
→ Stream<
LoggingMessageNotification> -
Emits an event any time the server sends a log message.
no setter
-
promptListChanged
→ Stream<
PromptListChangedNotification> -
Emits an event any time the server notifies us of a change to the list of
prompts it supports.
no setter
- protocolVersion ↔ ProtocolVersion
-
The version of the protocol that was negotiated during initialization.
getter/setter pair
-
resourceListChanged
→ Stream<
ResourceListChangedNotification> -
Emits an event any time the server notifies us of a change to the list of
resources it supports.
no setter
-
resourceUpdated
→ Stream<
ResourceUpdatedNotification> -
Emits an event any time the server notifies us of a change to a resource
that this client has subscribed to.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- serverCapabilities ↔ ServerCapabilities
-
The ServerCapabilities returned from the initialize request.
getter/setter pair
- serverInfo ↔ Implementation?
-
The Implementation returned from the initialize request.
getter/setter pair
-
toolListChanged
→ Stream<
ToolListChangedNotification> -
Emits an event any time the server notifies us of a change to the list of
tools it supports.
no setter
Methods
-
callTool(
CallToolRequest request) → Future< CallToolResult> - Invokes a Tool returned from the ListToolsResult.
-
getPrompt(
GetPromptRequest request) → Future< GetPromptResult> - Gets the requested Prompt from the server.
-
initialize(
InitializeRequest request) → Future< InitializeResult> - Initializes the server, this should be done before anything else.
-
listPrompts(
ListPromptsRequest request) → Future< ListPromptsResult> - Lists all the prompts from this server.
-
listResources(
ListResourcesRequest request) → Future< ListResourcesResult> - Lists all the Resources from this server.
-
listResourceTemplates(
ListResourceTemplatesRequest request) → Future< ListResourceTemplatesResult> - Lists all the ResourceTemplates from this server.
-
listTools(
[ListToolsRequest? request]) → Future< ListToolsResult> - List all the tools from this server.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyInitialized(
[InitializedNotification? notification]) → void - Called after a successful call to initialize.
-
notifyProgress(
ProgressNotification notification) → void -
Notifies the peer of progress towards completing some request.
inherited
-
onProgress(
Request request) → Stream< ProgressNotification> -
A stream of progress notifications for a given
request
.inherited -
ping(
{Duration timeout = const Duration(seconds: 1), PingRequest? request}) → Future< bool> -
Pings the peer, and returns whether or not it responded within
timeout
.inherited -
readResource(
ReadResourceRequest request) → Future< ReadResourceResult> - Reads a Resource returned from the ListResourcesResult or matching a ResourceTemplate from a ListResourceTemplatesResult.
-
registerNotificationHandler<
T extends Notification?> (String name, void impl(T)) → void -
Registers a notification handler named
name
on this server.inherited -
registerRequestHandler<
T extends Request?, R extends Result?> (String name, FutureOr< R> impl(T)) → void -
Registers a handler for the method
name
on this server.inherited -
requestCompletions(
CompleteRequest request) → Future< CompleteResult> - Sends a request to get completions from the server.
-
sendNotification(
String method, [Notification? notification]) → void -
Sends a notification to the peer.
inherited
-
sendRequest<
T extends Result?> (String methodName, [Request? request]) → Future< T> -
Sends
request
to the peer, and handles coercing the response to the typeT
.inherited -
setLogLevel(
SetLevelRequest request) → Future< void> - Sends a request to change the current logging level.
-
shutdown(
) → Future< void> - Close all connections and streams so the process can cleanly exit.
-
subscribeResource(
SubscribeRequest request) → Future< void> -
Subscribes this client to a resource by URI (at
request.uri
). -
toString(
) → String -
A string representation of this object.
inherited
-
unsubscribeResource(
UnsubscribeRequest request) → Future< void> -
Unsubscribes this client to a resource by URI (at
request.uri
).
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited