onClearSnapshot method

void onClearSnapshot(
  1. String itemName,
  2. int itemPos
)

Event handler that is called by Lightstreamer each time a request to clear the snapshot pertaining to an item in the Subscription has been received from the Server.

More precisely, this kind of request can occur in two cases:

  • For an item delivered in COMMAND mode, to notify that the state of the item becomes empty; this is equivalent to receiving an update carrying a DELETE command once for each key that is currently active.
  • For an item delivered in DISTINCT mode, to notify that all the previous updates received for the item should be considered as obsolete; hence, if the listener were showing a list of recent updates for the item, it should clear the list in order to keep a coherent view.
Note that, if the involved Subscription has a two-level behavior enabled (see [Subscription.setCommandSecondLevelFields] and [Subscription.setCommandSecondLevelFieldSchema]) , the notification refers to the first-level item (which is in COMMAND mode). This kind of notification is not possible for second-level items (which are in MERGE mode).
  • itemName name of the involved item. If the Subscription was initialized using an "Item Group" then a null value is supplied.
  • itemPos 1-based position of the item within the "Item List" or "Item Group".

Implementation

void onClearSnapshot(String itemName, int itemPos) {}