Table of Contents

Interface IGlspServer

Namespace
NMF.Glsp.Contracts
Assembly
NMF.Glsp.dll

Denotes the interface for a GLSP server

public interface IGlspServer

Methods

DisposeClientSessionAsync(string, IDictionary<string, object>)

Sends a disposeClientSession request to the server. This request has to be sent at the end of client session lifecycle e.g. when an editor widget is closed.

[JsonRpcMethod("disposeClientSession")]
Task DisposeClientSessionAsync(string clientSessionId, IDictionary<string, object> args = null)

Parameters

clientSessionId string

Unique identifier of the client session that should be disposed.

args IDictionary<string, object>

Additional custom arguments.

Returns

Task

A promise that resolves if the disposal was successful

InitializeAsync(string, string, IDictionary<string, object>)

Send an initialize request to the server. The server needs to be initialized in order to accept and process other requests and notifications. The {@link InitializeResult} ist cached and can be retrieved via the {@link GLSPClient.initializeResult} property. Only the first method invocation actually sends a request to the server. Subsequent invocations simply return the cached result.

[JsonRpcMethod("initialize")]
Task<InitializeResult> InitializeAsync(string applicationId, string protocolVersion, IDictionary<string, object> args = null)

Parameters

applicationId string
protocolVersion string
args IDictionary<string, object>

Returns

Task<InitializeResult>

A promise of the {@link InitializeResult}.

InitializeClientSessionAsync(string, string, string[], IDictionary<string, object>)

Send an initializeClientSession request to the server. One client application may open several session. Each individual diagram on the client side counts as one session and has to provide a unique clientId.

[JsonRpcMethod("initializeClientSession")]
Task InitializeClientSessionAsync(string clientSessionId, string diagramType, string[] clientActionKinds = null, IDictionary<string, object> args = null)

Parameters

clientSessionId string

Unique identifier for the new client session

diagramType string

Unique identifier of the diagram type for which the session should be configured.

clientActionKinds string[]

The set of action kinds that can be handled by the client. Used by the server to know which dispatched actions should be forwarded to the client.

args IDictionary<string, object>

Additional custom arguments.

Returns

Task

A promise that resolves if the initialization was successful

ProcessAsync(string, BaseAction)

Send an action message to the server.

[JsonRpcMethod("process")]
Task ProcessAsync(string clientId, BaseAction action)

Parameters

clientId string

the client ID

action BaseAction

The message

Returns

Task

ShutdownAsync()

Send a shutdown notification to the server.

[JsonRpcMethod("shutdown")]
Task ShutdownAsync()

Returns

Task

Events

Process

Gets raised when the client should process an action message

event EventHandler<ActionMessage> Process

Event Type

EventHandler<ActionMessage>