com.lightstreamer.javameclient.midp
Interface HandyTableListener


public interface HandyTableListener

A fully-featured listener interface, which receives notification of data updates and other messages related to a subscribed 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.


Method Summary
 void onControlError(int code, java.lang.String msg)
          Notification that the Server has refused a Subscription request because of the constraints imposed by the Metadata Adapter or by Server configuration.
 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 is not reused by LSClient, so it can be freely stored by the application.

Parameters:
itemPos - 1-based index of the item in the Group of items in the table.
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 Group of items in the table.
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 Group of items in the table.
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.

onControlError

void onControlError(int code,
                    java.lang.String msg)
Notification that the Server has refused a Subscription request because of the constraints imposed by the Metadata Adapter or by Server configuration. No data for this table will be received. A detailed error code is supplied. Both the error code and the message are received from the Server. In particular: Note: if single connection mode is used, this handler is never called; a subscription error would rather cause the ConnectionListener.onServerError(java.lang.String) notification to be issued and the whole session request to fail.

Parameters:
code - The detailed error code, as received from the Server. Its meaning depends on Lightstreamer Server or the Metadata Adapter.
msg - An error detail message, sent by Lightstreamer Server or by the Metadata Adapter.
See Also:
LSClient.useSingleConnection(boolean)

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 Group of items in the table.
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.