com.lightstreamer.ls_client
Interface HandyTableListener


public interface HandyTableListener

A fully-featured listener interface, which receives notification of data updates and subscription termination for a table.
Upon update of each item, the current and previous state of all fields is provided. If the subscription configuration enables the "COMMAND logic", then the special "key" and "command" fields are determined and the updates are meant as ADD, UPDATE and DELETE commands on the rows of an underlying table, identified by a key value. In this case, the old field values related with an update are referred to the same key.
Both names and positional information are available to identify specific items and fields, unless a SimpleTableInfo was used to describe the table; in that case, only positional information is available.
Positional information refers to the "TableInfo" object used to specify the subscription request. Note that if "subscribeItems" was used, this may not represent an actual table but just an item list.
The listener is called directly from the worker threads. The method implementations should be fast and nonblocking. Any slow operations should be enqueued and performed asynchronously.


Method Summary
 void onRawUpdatesLost(int itemPos, java.lang.String itemName, int lostUpdates)
          Notification of one or more updates that were suppressed in the Server because of internal memory limitations.
 void onSnapshotEnd(int itemPos, java.lang.String itemName)
          Notification that no more snapshot events are coming for an item.
 void onUnsubscr(int itemPos, java.lang.String itemName)
          Notification of the unsubscription of an item in the table.
 void onUnsubscrAll()
          Notification of the unsubscription of all the items in the table.
 void onUpdate(int itemPos, java.lang.String itemName, UpdateInfo update)
          Notification of an update of the values for an item in the table.
 

Method Detail

onUpdate

void onUpdate(int itemPos,
              java.lang.String itemName,
              UpdateInfo update)
Notification of an update of the values for an item in the table. Field value information is supplied through a suitable value object; as such, the value object can be stored and inquired in a different thread, if needed.

Parameters:
itemPos - 1-based index of the item in the involved table or subscription list.
itemName - Name of the changed item, or null if a SimpleTableInfo was used to describe the table.
update - Value object which contains field value information.

onSnapshotEnd

void onSnapshotEnd(int itemPos,
                   java.lang.String itemName)
Notification that no more snapshot events are coming for an item. This notification is always received once, when the item is subscribed in DISTINCT or COMMAND mode and the snapshot is requested.

Parameters:
itemPos - 1-based index of the item in the involved table or subscription list.
itemName - Name of the item, or null if a SimpleTableInfo was used to describe the table.

onRawUpdatesLost

void onRawUpdatesLost(int itemPos,
                      java.lang.String itemName,
                      int lostUpdates)
Notification of one or more updates that were suppressed in the Server because of internal memory limitations. The notification can be sent if the subscription mode is RAW or COMMAND. It can also be sent if the subscription mode is MERGE or DISTINCT and unfiltered dispatching has been requested. In all these cases, an update loss may be unacceptable for the client (in filtered COMMAND mode, this applies to ADD and DELETE events only).

Parameters:
itemPos - 1-based index of the item in the involved table or subscription list.
itemName - Name of the item, or null if a SimpleTableInfo was used to describe the table.
lostUpdates - Number of consecutive lost updates for the item.

onUnsubscr

void onUnsubscr(int itemPos,
                java.lang.String itemName)
Notification of the unsubscription of an item in the table. It is sent before onUnsubscrAll. Any data notification received after this call can be ignored.
If a SimpleTableInfo was used to describe the table, then the notification may not be sent for some item in the group; however, if any data notification is sent for an item, then it is guaranteed that the unsubscription notification for that item will also be sent.

Parameters:
itemPos - 1-based index of the item in the involved table or subscription list.
itemName - Name of the item, or null if a SimpleTableInfo was used to describe the table.

onUnsubscrAll

void onUnsubscrAll()
Notification of the unsubscription of all the items in the table. The unsubscription may be subsequent to an unsubscribeTable call or to the closure of the connection. There is no guarantee that this call will not be followed by some further onUpdate call. Such extra calls should be ignored.