it.list.jft.event
Interface SubscriptionListener

All Superinterfaces:
Listener

public interface SubscriptionListener
extends Listener

Interface to be implemented in order to handle the Subscription Lifecycle.

This interface is bound to subscriptions created by Context.makeSubscription().
It may be retrieved by CommunicationLifeCycle.getListener().


Method Summary
 void onSubscriptionIdle(SubscriptionIdleEvent event)
          Called when the flow of historical data is finished and the start of actual data is starting.
 void onSubscriptionNotify(SubscriptionNotifyEvent event)
          Called when an actual or historical data is available or when the server-answer of a Subscription.refreshEntity is available.
 void onSubscriptionStart(SubscriptionStartEvent event)
          Called when the server-answer to the Subscription.start() is available.
 void onSubscriptionStop(SubscriptionStopEvent event)
          Called when the server-answer to the Subscription.stop() is available.
 

Method Detail

onSubscriptionStart

void onSubscriptionStart(SubscriptionStartEvent event)
Called when the server-answer to the Subscription.start() is available.

If the server result is Event.RESULT_OK,
then

otherwise

In the latter case it is a good practice to release the subscription associated to the event parameter.

Parameters:
event - the server-answer to the Subscription.start()

onSubscriptionIdle

void onSubscriptionIdle(SubscriptionIdleEvent event)
Called when the flow of historical data is finished and the start of actual data is starting.

In this case:

This method is called only if the type of query of the subscription is not SubscriptionParam.QUERY_TYPE_ON_TIME.

If the type of query of the subscription is SubscriptionParam.QUERY_TYPE_PAST then it is a good practice to stop the subscription.

Parameters:
event - event marking stop/starting of historical/actual data coming from the server

onSubscriptionNotify

void onSubscriptionNotify(SubscriptionNotifyEvent event)
Called when an actual or historical data is available or when the server-answer of a Subscription.refreshEntity is available.

In this case:

If this is the server-answer of a refreshEntity then the data available through SubscriptionNotifyEvent.getEntity() is always complete even if the subscription was opened in a masked fashion.

Parameters:
event - event containing actual/historical data

onSubscriptionStop

void onSubscriptionStop(SubscriptionStopEvent event)
Called when the server-answer to the Subscription.stop() is available.

If the server result is Event.RESULT_OK, then the server has closed the subscription otherwise some unknow error occured.

In both cases:

Parameters:
event - the server-answer to the Subscription.stop()


Submit a bug or feature to FT\API Programming Support<\font>