com.prosysopc.ua.client
Interface SubscriptionAliveListener

All Known Implementing Classes:
SubscriptionAliveAdapter

public interface SubscriptionAliveListener

An event listener for subscription alive and timeout notifications. These are sent from the subscription whenever it receives a publish response without any notification data (an alive message) or when it timeouts receiving one (i.e. when the server has not sent any response message even though the maximum KeepAlive time has elapsed.)

See Also:
SubscriptionAliveAdapter, SubscriptionNotificationListener

Method Summary
 void onAfterCreate(Subscription subscription)
          Notifies that the subscription was created into the server.
 void onAlive(Subscription subscription)
          Notifies that the server sent an alive message, even though it does not have any notification data.
 void onTimeout(Subscription subscription)
          Notifies that a timeout has occurred for a subscription.
 

Method Detail

onAfterCreate

void onAfterCreate(Subscription subscription)
Notifies that the subscription was created into the server.

If you connect the listener before the subscription is created initially into the server, you will get the notification of the initial creation.

The method is called also, when the client is reconnected after a communication break and the subscription could not be reused, but had to be recreated. In this case, it is possible that some notifications were missed by the client and it may need to perform a history read if it needs the event or data notifications that were sent during the communication break.

Parameters:
subscription - the subscription that was created

onAlive

void onAlive(Subscription subscription)
Notifies that the server sent an alive message, even though it does not have any notification data.

Parameters:
subscription - the subscription that got the alive message

onTimeout

void onTimeout(Subscription subscription)
Notifies that a timeout has occurred for a subscription.

You can read the LastAlive time of the subscription to decide whether you want to still wait for a late response.

Even if the client determines that the subscription has timed out, the server may still have it alive. UaClient will automatically reuse the subscription as long as it is available and will recreate it when not. Recreation is notified by onAfterCreate(Subscription).

Parameters:
subscription - the subscription that timed out


Copyright © 2018. All rights reserved.