API Docs for: 0.0.57
Show:

MessageBuilder Class

Constructor

MessageBuilder

(
  • options
)

Parameters:

  • options Object
    • securityMode MessageSecurityMode

      the security Mode

    • [objectFactory=factories] optional

      a object that provides a constructObject(id) method

Methods

_append

(
  • message_chunk
)
private
append a message chunk

Parameters:

  • message_chunk Object

_read_headers

(
  • binaryStream
)
Boolean private

Parameters:

  • binaryStream Object

Returns:

Boolean:

check_options_correctness_against_schema

()

check correctness of option fields against scheme

check_schema_correctness

(
  • schema
)

ensure correctness of a schema object.

Parameters:

  • schema Object

extract_all_fields

()

extract a list of all possible fields for a schema (by walking up the inheritance chain)

feed

(
  • data
)
Feed message builder with some data

Parameters:

  • data Object

get_base_schema

(
  • schema
)

Parameters:

  • schema Object

Returns:

:

initialize_field_array

(
  • field
  • valueArray
)
Array

Parameters:

  • field Object
  • valueArray Object

Returns:

Array:

initialize_value

(
  • field
  • value
)

Parameters:

  • field Object
  • value Object

Returns:

:

Events

chunk

notify the observers that new message chunk has been received

Event Payload:

  • messageChunk Buffer
    the raw message chunk

error

notify the observers that an error has occurred

Event Payload:

  • error Error
    the error to raise

full_message_body

notify the observers that a full message has been received

Event Payload:

  • full_message_body Buffer
    the full message body made of all concatenated chunks.

invalid_sequence_number

notify the observers that a message with an invalid sequence number has been received.

Event Payload:

  • expected Number

    sequence Number

  • actual Number

    sequence Number

message

notify the observers that a full message has been received

Event Payload:

  • objMessage Object

    the decoded message object

  • msgType String

    the message type ( "HEL","ACK","OPN","CLO" or "MSG" )

  • the Number

    request Id

start_chunk

notify the observers that a new message is being built

Event Payload:

  • info Object
  • data Object