Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Messages

Hierarchy

  • Messages

Index

Methods

addRequestHandler

  • Parameters

    • path: string
    • handler: RequestHandler
    • Optional sessionProperties: string[]
    • Optional requestType: DataType<any, any, any>

    Returns Result<Registration>

    the registration Result that resolves when the handler has been registered, returning a Registration which can be used to unregister the handler.

    Otherwise, the Result will fail with an error. Common reasons for failure include:

    • the session is closed;
    • the session has already registered a handler for this message path;
    • the session does not have REGISTER_HANDLER permission to register a request handler on the server;
    • the session does not have VIEW_SESSION permission to access the client's session properties.
    • NullValueError – if any of the required arguments are null or undefined

removeRequestStream

  • Parameters

    • path: string

    Returns RequestStream | undefined

    the request stream that was removed from the path. If the path does not have a request stream assigned (or the path does not exist), undefined will be returned instead.

sendRequest

  • sendRequest(path: string, request: any, target: SessionId | string, requestType?: DataType<any, any, any> | TopicType | object | string, responseType?: DataType<any, any, any> | TopicType | object | string): Result<any>
  • sendRequest(path: string, request: any, requestType?: DataType<any, any, any> | TopicType | object | string, responseType?: DataType<any, any, any> | TopicType | object | string): Result<any>
  • Parameters

    • path: string
    • request: any
    • target: SessionId | string
    • Optional requestType: DataType<any, any, any> | TopicType | object | string
    • Optional responseType: DataType<any, any, any> | TopicType | object | string

    Returns Result<any>

    A Result that resolves with the response when a response has been received by the session if the task completes successfully.

    Otherwise, the Result will fail with an Error. Common reasons for failure include:

    • the session does not exist on the server;
    • the recipient session does not have a local request stream registered for this path;
    • the request is not compatible with the datatype bound to the handler's message path;
    • the response is not compatible with the specified response type;
    • the request has been rejected by the recipient session calling Responder.reject(message);
    • the session is closed;
    • the session does not have SEND_TO_SESSION permission;
    • IllegalArgumentError – the request could not be parsed by the calling client;
    • InvalidDataError – the response could not be parsed;
    • NullValueError – if any of the required arguments are null or undefined

  • Parameters

    • path: string
    • request: any
    • Optional requestType: DataType<any, any, any> | TopicType | object | string
    • Optional responseType: DataType<any, any, any> | TopicType | object | string

    Returns Result<any>

sendRequestToFilter

  • Parameters

    Returns Result<number>

    a Result that resolves when the server has dispatched all the requests.

    If the server successfully evaluated the filter, the result of this contains the number of sessions the request was sent to. Failure to send a request to a particular matching session is reported to the callback.

    Otherwise, the Result will fail with an Error. Common reasons for failure include:

    • the filter parameter could not be parsed;
    • the calling session does not have SEND_TO_SESSION and VIEW_SESSION permissions;
    • the calling session is closed.
    • IllegalArgumentError – the request could not be parsed by the calling client;
    • NullValueError – if any of the required arguments are null or undefined

setRequestStream

  • Parameters

    Returns RequestStream | undefined

    undefined if the request stream is the first stream to be set to the path, otherwise this method will return the previously set request stream.