instances~Connector(instance_node)

Connects a Root with a Inexor Core instance

new Connector(instance_node)

Parameters:
Name Type Description
instance_node tree.Node the instance node

Members

protoDescriptor

Properties:
Name Type Description
protoDescriptor Object

Methods

addSynchronizeListener()

Add a new listener for the GRPC synchronize service.

addTreeNodeSyncListenersFromDefaults()

Adds synchronization listeners for all tree nodes and sends the current value of the node.

closeGrpcConnection()

Closes the GRPC connection.

connect() → {Promise.<tree.Node>}

Connecting to the gRPC server of Inexor Core.
Fires:
  • Connector.event:connected
Returns:
Promise.<tree.Node>

convert()

Converts an incoming string value to the target datatype. TODO: move to tree utils

getDataType(protoKey) → {datatype}

Returns the datatype of the field by proto key.
Parameters:
Name Type Description
protoKey string
Returns:
datatype

getDefaultValue(protoKey) → {string}

Returns the default value of the field by proto key.
Parameters:
Name Type Description
protoKey string The proto key.
Returns:
string

getEventType(protoKey) → {string}

Returns the event type of the field by proto key.
Parameters:
Name Type Description
protoKey string The proto key.
Returns:
string

getId(protoKey) → {number}

Returns the id of the field by proto key.
Parameters:
Name Type Description
protoKey string The proto key.
Returns:
number

getLoggerName()

Returns the logger name for the connector instance. Uses the hostname, port and session id as logger name.

getMessage()

Returns a new message.
Parameters:
Name Type Description
node - The tree node to be sent.

getPath(protoKey) → {string}

Returns the path of the field by proto key. The path is prefixed with the path of instance node.
Parameters:
Name Type Description
protoKey string The proto key.
Returns:
string - The path to the node.

linkTreeMounts()

Links other nodes in the tree into the instance tree.

loadInstanceConfiguration()

Load instance configuration.

onNewTreeNode()

A new tree node has been created for the instance. We register a listener on the sync event of the newly created tree node.
Parameters:
Name Type Description
node - The tree node which has been created.

onTreeNodeSync()

The tree node has been modified and shall be synchronized.

populateInstanceTreeFromDefaults()

Populates the tree.

removeGrpcListeners()

Remove all listeners for the GRPC synchronize service.

removeListeners()

Removes all listeners.

removeTreeListeners()

Removes all listeners for the inexor tree.

sendFinishedTreeIntro()

Sends an event to Inexor Core which signals that the tree initialization has been finished.

updateTree()

TODO: move this to the tree root. Could be useful for merging trees and for introducing GraphQL.