Caplin Trader 5.1.0

Class: module:ct-sljsadapter/watchlist/StreamLinkWatchlist

module:ct-sljsadapter/watchlist/StreamLinkWatchlist()

You should never construct this class by yourself; use module:ct-sljsadapter/providers/StreamLinkWatchlistService#create to construct it for you.

This class contains getters for watchlist metadata only (id, name, subject) and a setter for name.

To manipulate the watchlist's records, use the contents manager provided by module:ct-sljsadapter/watchlist/StreamLinkWatchlist#getContentsManager.

Constructor

new module:ct-sljsadapter/watchlist/StreamLinkWatchlist()

Implements:
See:

Methods

getContentsManager() → {module:ct-watchlist/WatchlistContentsManager}

Creates and returns a module:ct-watchlist/WatchlistContentsManager for this watchlist. Only when this method is called for the first time will an actual streamlink subscription to the watchlist's subject be created.

Implements:
Returns:

may be used to modify the watchlist contents.

Type
module:ct-watchlist/WatchlistContentsManager

getId() → {string}

Returns the unique ID of the watchlist.

Implements:
Returns:

ID

Type
string

getName() → {string}

Returns the display name of the watchlist.

Implements:
Returns:

display name

Type
string

getSubject() → {string}

Returns the streamlink subject for the watchlist's record.

Implements:
Returns:

streamlink subject

Type
string

setName(name, erroropt, successopt)

Makes streamlink contrib to set the name of the watchlist and add the request to list of pending requests. Calls success callback when streamlink changes the name. If the name hasn't been changed after the timeout, error is called.

Parameters:
Name Type Attributes Description
name String

the watchlist name to be set

error function <optional>

function to be called if operation fails

success function <optional>

function to be called if operation succeeds

Implements:
See:
Throws:

If name argument is not a string.

Type
module:br/Errors.INVALID_PARAMETERS

setPosition(position, erroropt, successopt)

Send a StreamLink contrib to set the position of the watchlist and add the request to list of pending requests. Call success callback when streamlink changes the position. Call error if the position hasn't changed after the configured timeout.

Parameters:
Name Type Attributes Description
position integer

the watchlist position index (0 based)

error function <optional>

function to be called if operation fails

success function <optional>

function to be called if operation succeeds

Implements:
See:
Throws:

If position argument is not an integer.

Type
module:br/Errors.INVALID_PARAMETERS