public interface SubscriptionListener
Subscription
events comprehending notifications of subscription/unsubscription,
updates, errors and others.ClientListener
s, SubscriptionListener
s and ClientMessageListener
s will be dispatched by the
same thread.Modifier and Type | Method and Description |
---|---|
void |
onClearSnapshot(java.lang.String itemName,
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.
|
void |
onCommandSecondLevelItemLostUpdates(int lostUpdates,
java.lang.String key)
Event handler that is called by Lightstreamer to notify that, due to internal resource limitations,
Lightstreamer Server dropped one or more updates for an item that was subscribed to as a second-level subscription.
|
void |
onCommandSecondLevelSubscriptionError(int code,
java.lang.String message,
java.lang.String key)
Event handler that is called when the Server notifies an error on a second-level subscription.
By implementing this method it is possible to perform recovery actions. |
void |
onEndOfSnapshot(java.lang.String itemName,
int itemPos)
Event handler that is called by Lightstreamer to notify that all snapshot events for an item in the
Subscription have been received, so that real time events are now going to be received.
|
void |
onItemLostUpdates(java.lang.String itemName,
int itemPos,
int lostUpdates)
Event handler that is called by Lightstreamer to notify that, due to internal resource limitations,
Lightstreamer Server dropped one or more updates for an item in the Subscription.
|
void |
onItemUpdate(ItemUpdate itemUpdate)
Event handler that is called by Lightstreamer each time an update pertaining to an item in the Subscription
has been received from the Server.
|
void |
onListenEnd(Subscription subscription)
Event handler that receives a notification when the SubscriptionListener instance is removed from a Subscription
through
Subscription.removeListener(SubscriptionListener) . |
void |
onListenStart(Subscription subscription)
Event handler that receives a notification when the SubscriptionListener instance is added to a Subscription
through
Subscription.addListener(SubscriptionListener) . |
void |
onSubscription()
Event handler that is called by Lightstreamer to notify that a Subscription has been successfully subscribed
to through the Server.
|
void |
onSubscriptionError(int code,
java.lang.String message)
Event handler that is called when the Server notifies an error on a Subscription.
|
void |
onUnsubscription()
Event handler that is called by Lightstreamer to notify that a Subscription has been successfully unsubscribed
from.
|
void onClearSnapshot(java.lang.String itemName, int itemPos)
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".void onCommandSecondLevelItemLostUpdates(int lostUpdates, java.lang.String key)
lostUpdates
- The number of consecutive updates dropped for the item.key
- The value of the key that identifies the second-level item.Subscription.setRequestedMaxFrequency(String)
,
Subscription.setCommandSecondLevelFields(String[])
,
Subscription.setCommandSecondLevelFieldSchema(String)
void onCommandSecondLevelSubscriptionError(int code, java.lang.String message, java.lang.String key)
code
- The error code sent by the Server. It can be one of the following:
message
- The description of the error sent by the Server; it can be null.key
- The value of the key that identifies the second-level item.ConnectionDetails.setAdapterSet(String)
,
Subscription.setCommandSecondLevelFields(String[])
,
Subscription.setCommandSecondLevelFieldSchema(String)
void onEndOfSnapshot(java.lang.String itemName, int itemPos)
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".Subscription.setRequestedSnapshot(String)
,
ItemUpdate.isSnapshot
void onItemLostUpdates(java.lang.String itemName, int itemPos, int lostUpdates)
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".lostUpdates
- The number of consecutive updates dropped for the item.Subscription.setRequestedMaxFrequency(String)
void onItemUpdate(ItemUpdate itemUpdate)
itemUpdate
- a value object containing the updated values for all the fields, together with meta-information
about the update itself and some helper methods that can be used to iterate through all or new values.void onListenEnd(Subscription subscription)
Subscription.removeListener(SubscriptionListener)
. This is the last event to be fired on the listener.subscription
- the Subscription this instance was removed from.void onListenStart(Subscription subscription)
Subscription.addListener(SubscriptionListener)
. This is the first event to be fired on the listener.subscription
- the Subscription this instance was added to.void onSubscription()
LightstreamerClient.unsubscribe(Subscription)
and
LightstreamerClient.subscribe(Subscription)
. This can also happen multiple times in case of automatic
recovery after a connection restart.onUnsubscription()
event is eventually fired.void onSubscriptionError(int code, java.lang.String message)
LightstreamerClient.unsubscribe(Subscription)
and LightstreamerClient.subscribe(Subscription)
should be issued again, even if no change to the Subscription
attributes has been applied.code
- The error code sent by the Server. It can be one of the following:
message
- The description of the error sent by the Server; it can be null.ConnectionDetails.setAdapterSet(String)
void onUnsubscription()
LightstreamerClient.unsubscribe(Subscription)
and
LightstreamerClient.subscribe(Subscription)
. This can also happen multiple times in case of automatic
recovery after a connection restart.onSubscription()
event is eventually fired.