Class: MetadataResponse

lightstreamer-adapter/metadataprovider~ MetadataResponse

Private constructor arguments: {Stream} stream the stream channel to the remote LS server adapter {Object} message the request data {Function} writeSuccess callback to the serialization function for a successful response {Function} writeError callback to the serialization function for an error response

new MetadataResponse

MetadataResponse constructor. An instance of this class is passed as argument to an event listener, and must be used to respond to the remote adapter request, using the success method or the error method.

Method Summary

error
Sends an error response.
success
Sends a successful response.

Method Detail

<inner> error

Sends an error response. The optional exception type parameter that can be used to issue a proper type of exceptiond depends on the event handled as described in the following table:
  • getItemData: none
  • getUserItemData: none
  • getSchema: "items" or "schema"
  • getItems: "items"
  • notifyUser: "access" or "credits"
  • notifyUserAuth: "access" or "credits"
  • notifyUserMessage: "credits" or "notification"
  • notifyNewSession: "credits" or "conflictingSession" or "notification"
  • notifySessionClose: "notification"
  • notifyNewTables: "credits" or "notification
  • notifyTablesClose: "notification"
Parameters:
Name Type Argument Description
exceptionMessage String exception message
exceptionType String <optional>
exception type

<inner> success

Sends a successful response. Parameters that can be used depends on the event handled as described in the following table:
  • getItemData: success([{distinctSnapLen: <distinct snapshot length>, minSourceFreq: <min source frequency>, allowedModes: {raw: <raw allowed>, merge: <merge allowed>, distinct: <distinct allowed>, command: <command allowed>}}, ...])
  • getUserItemData: {userName: <username>, itemNames: [<item name 1> ... <item name n>]}
  • getSchema: {userName: <username>, groupName: <group name>, schemaName: <schema name>, sessionId: <session id>}
  • getItems: {userName: <username>, groupName: <group name>, sessionId: <session id>}
  • notifyUser: success(<allowed max bandwidth>, <wants table notifications>)
  • notifyUserAuth: success(<allowed max bandwidth>, <wants table notifications>)
  • notifyUserMessage: success()
  • notifyNewSession: success()
  • notifySessionClose: success()
  • notifyNewTables: success()
  • notifyTablesClose: success()