public interface SubscriptionListener extends Listener
This interface is bound to subscriptions created by
Context.makeSubscription()
.
It may be retrieved by CommunicationLifeCycle.getListener()
.
Modifier and Type | Method and Description |
---|---|
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. |
void onSubscriptionStart(SubscriptionStartEvent event)
Subscription.start()
is available.
If the server result is
Event.RESULT_OK
,
then
Subscription.STATUS_STARTED
.
SubscriptionNotifyEvent
and/or SubscriptionIdleEvent
events will be received.
otherwise
Subscription.STATUS_STOPPED
.
SubscriptionNotifyEvent
and/or
SubscriptionIdleEvent
events will never been received.
In the latter case it is a good practice to
release
the
subscription associated
to the event parameter.
event
- the server-answer to the
Subscription.start()
void onSubscriptionIdle(SubscriptionIdleEvent event)
In this case:
Event.RESULT_OK
.
Subscription.STATUS_STARTED
.
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.
event
- event marking stop/starting of historical/actual data coming
from the servervoid onSubscriptionNotify(SubscriptionNotifyEvent event)
Subscription.refreshEntity
is available.
In this case:
Event.RESULT_OK
.
Subscription.STATUS_STARTED
.
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.
event
- event containing actual/historical datavoid onSubscriptionStop(SubscriptionStopEvent event)
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:
Subscription.STATUS_STOPPED
.
SubscriptionNotifyEvent
and/or
SubscriptionIdleEvent
events will never been received.
release
the
subscription associated
to the event parameter.
event
- the server-answer to the Subscription.stop()
Submit a bug or feature to FT\API Programming Support