API Docs for: 2.0.0

Class SharedServerDataManager

Class defined in: src/node-sharedserverdata.js:16

SharedServerDataManager container object. The dataStructure is: this.dataStructure is an object with: this.dataStructure.allValues = {}; object to hold all tracked values example this.dataStructure.allValues['nameOfvalue'] = this.dataStructure.allNamesOfValues = []; strings to denote the names used for values order is based on when it was first set (not alphabetical) The allValues is comprised of entry objects { name: name of value value: actual value which could be an object of more values desc: used for later subscribers: [] } Each entry in subscribers is also an object. Current assumption is that all subscribers are apps on a display, however being wsio based, its more a matter of how the wsio client receives the data and what it does. { app: identifies the app which is subscribing to the value. func: name of the function to call in order to pass the information. }

SharedServerDataManager( clients )
src/node-sharedserverdata.js:16
Parameters:
  • clients <Array>
    • A reference to the client list.
getAllTrackedValues( wsio, data )
src/node-sharedserverdata.js:251

Will respond back once to the app giving the func an array of tracked values. They will be in an array of objects with properties nameOfValue and value. NOTE: this could be a huge array.

Parameters:
  • wsio <Object>
    • The websocket of sender.
  • data <Object>
    • The object properties described below.
    • app <String>
      • App that requested.
    • func <String>
      • Name of the function on the app to give value to.
getAllTrackedValues( wsio, data )
src/node-sharedserverdata.js:277

Gets all tracked value names and descriptions, gives to requesting app.

Parameters:
  • wsio <Object>
    • The websocket of sender.
  • data <Object>
    • The object properties described below.
    • app <String>
      • App that requested.
    • func <String>
      • Name of the function on the app to give value to.
getValue( wsio, data )
src/node-sharedserverdata.js:128

Checks if there is a value, and if so will send the value. If the value doesn't exist, it will not do anything.

Parameters:
  • wsio <Object>
    • The websocket of sender.
  • data <Object>
    • The object properties described below.
    • nameOfValue <String>
      • Name of value to get.
    • app <String>
      • App that requested.
    • func <String>
      • Name of the function on the app to give value to.
removeValue( wsio, data )
src/node-sharedserverdata.js:158

Checks if there is a value, and if so will send the value. If the value doesn't exist, it will not do anything.

Parameters:
  • wsio <Object>
    • The websocket of sender.
  • data <Object>
    • The object properties described below.
    • namesOfValuesToRemove <Array>
      • Names of values to remove.
setValue( wsio, data, clients )
src/node-sharedserverdata.js:55

Sets the value of specified server data. If it doesn't exist, will create it.

Parameters:
  • wsio <Object>
    • The websocket of sender.
  • data <Object>
    • The object properties described below.
    • nameOfValue <String>
      • Name of value to set.
    • value <>
      • Value to store.
    • description <>
      • Currently a string to plain text describe the variable.
  • clients <>
    • All connected clients. Needed to send values.
subscribeToNewValueNotification( wsio, data )
src/node-sharedserverdata.js:300

Will send a notification to app when a new value gets created. App will get the value's name and description.

NOTE: this could be a huge array.

Parameters:
  • wsio <Object>
    • The websocket of sender.
  • data <Object>
    • The object properties described below.
    • app <String>
      • App that requested.
    • func <String>
      • Name of the function on the app to give notification.
    • unsubscribe <Boolean | Undefined>
      • if exists and true, will remove from new value watcher list.
subscribeToValue( wsio, data )
src/node-sharedserverdata.js:203

Add the app to the named values a subscriber. If the value doesn't exist, it will create a "blank" value and subscribe to it.

Parameters:
  • wsio <Object>
    • The websocket of sender.
  • data <Object>
    • The object properties described below.
    • nameOfValue <String>
      • Name of value to subscribe to.
    • app <String>
      • App that requested.
    • func <String>
      • Name of the function on the app to give value to.
    • unsubscribe <String | Undefined>
      • If exists and true, then will remove user from subscribe list.
updateInformationAboutConnections( clients, sagePointers )
src/node-sharedserverdata.js:333

Updates the stored information about connections. Currently updates three values for: UI, displays, remote servers. Users information from the clients array.

Parameters:
  • clients <Array>
    • The array containing information of all connected clients.
  • sagePointers <Array>
    • The array containing information of all pointers.
updateInformationAboutConnectionsFailedRemoteSite( wsio )
src/node-sharedserverdata.js:387

Updates the stored information about failed remote site connections.

Parameters:
  • wsio <Object>
    • The websocket of sender.