Watchlist API interfaces and classes

This Watchlist API consists of four interfaces, and four implementation classes for the StreamLink.

API Documentation

Interfaces

StreamLink implementation classes

Interface overview

WatchlistService

The WatchlistService object, retrieved from the Service Registry, is the object to use for:

  • creating watchlists,
  • ​disposing of watchlists,
  • monitoring the status of the data connection to the Caplin Platform, via the event WatchlistServiceEvents.STATUS_CHANGED.

Register listeners for the Watchlist Service events WatchlistServiceEvents.ADDED and WatchlistServiceEvents.REMOVED to maintain your own array of the user's Watchlist objects.

Watchlist

Watchlist objects are never constructed directly but are retrieved via five sources:

A Watchlist object allows direct access to its metadata, but working with its contents requires working, either directly or indirectly, with subscriptions:

Register a listener for the Watchlist event WatchlistEvents.PROPERTY_CHANGED to respond to a change in a watchlist's name.

WatchlistContentsManager

An instance of the WatchlistContentsManager class is used to manipulate the contents of a watchlist. You acquire an instance by calling Watchlist.getContentsManager. When you have finished manipulating the watchlist, call WatchlistContentsManager.destroy.

The WatchlistContentsManager class exists as a means for Watchlist objects to manage the subscription to their container on Transformer. A watchlist object will keep its subscription open while at least one issued WatchlistContentsManager remains active.

WatchlistGridDataProvider

The WatchlistGridDataProvider class links a grid component to an existing Transformer-hosted watchlist. This class provides data to the grid via a subscription to the watchlist's container on Transformer, and translates local row addition and removal events into commands to Transformer's Watchlist Service. 

You will rarely need to instantiate this class explicitly; the Webcentric layout manager will instantiate the class in the course of deserialising the XML layout configuration for a watchlist grid.