Module: lib/CometVisuClient

The JavaScript library that implements the CometVisu protocol.

Since:
  • 0.5.3 (initial contribution) 0.10.0 (major refactoring)
Author:
  • Christan Mayer
  • Tobias Br√§utigam
Source:

Requires

  • module:dependencies/jquery

Methods


<inner> beforeSend(xhr)

manipulates the header of the current ajax query before it is
been send to the server

Parameters:
Name Type Description
xhr
Source:

<inner> buildRequest(addresses)

Build the URL part that contains the addresses and filters

Parameters:
Name Type Description
addresses
Source:
Returns:
Type
String

<inner> handleError(xhr, str, excptObj)

This function gets called on an error FIXME: this should be a
prototype, so that the application developer can override it

Parameters:
Name Type Description
xhr
str
excptObj
Source:

<inner> handleRead(json)

This function gets called once the communication is established
and session information is available

Parameters:
Name Type Description
json
Source:

<inner> handleSession(json, connect)

This function gets called once the communication is established
and session information is available.

Parameters:
Name Type Description
json
connect

(boolean) wether to start the connection or not

Source:

<inner> handleSession(connect)

This function gets called once the communication is established
and session information is available

Parameters:
Name Type Description
connect

(boolean) wether to start the connection or not

Source:

<inner> login(loginOnly, callback, context)

This function starts the communication by a login and then runs the
ongoing communication task

Parameters:
Name Type Description
loginOnly

(boolean) if true only login and backend configuration, no subscription to addresses (default: false)

callback

(Function) cakk this function when login is done

context

(Object) context for the callback (this)

Source:

<inner> readResendHeaderValues()

read the header values of a response and stores them to the
resendHeaders array

Source:

<inner> readResendHeaderValues()

read the header values of a response and stores them to the resendHeaders array

Source:

<inner> restart()

Abort the read request properly

Source:

<inner> restart(doFullReload)

Restart the read request, e.g. when the watchdog kicks in

Parameters:
Name Type Description
doFullReload bool

reload all data and not only restart connection

Source:

<inner> restart()

Abort the read request properly

Source:

<inner> restart()

Restart the read request, e.g. when the watchdog kicks in

Source:

<inner> stop()

This function stops an ongoing connection

Source:

<inner> subscribe(addresses, filters)

Subscribe to the addresses in the parameter. The second parameter
(filter) is optional

Parameters:
Name Type Description
addresses
filters
Source:

<inner> write(address, value)

This function sends a value

Parameters:
Name Type Description
address
value
Source: