com.prosysopc.ua.client
Class SubscriptionAliveAdapter

java.lang.Object
  extended by com.prosysopc.ua.client.SubscriptionAliveAdapter
All Implemented Interfaces:
SubscriptionAliveListener

public class SubscriptionAliveAdapter
extends Object
implements SubscriptionAliveListener

A default, empty implementation of the SubscriptionAliveListener. You can use the adapter to enable more flexible implementation of the interface in your applications. Instead of implementing all methods of the interface, you can just override the methods that you wish to react to.


Constructor Summary
SubscriptionAliveAdapter()
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SubscriptionAliveAdapter

public SubscriptionAliveAdapter()
Method Detail

onAfterCreate

public void onAfterCreate(Subscription subscription)
Description copied from interface: SubscriptionAliveListener
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.

Specified by:
onAfterCreate in interface SubscriptionAliveListener
Parameters:
subscription - the subscription that was created

onAlive

public void onAlive(Subscription subscription)
Description copied from interface: SubscriptionAliveListener
Notifies that the server sent an alive message, even though it does not have any notification data.

Specified by:
onAlive in interface SubscriptionAliveListener
Parameters:
subscription - the subscription that got the alive message

onTimeout

public void onTimeout(Subscription subscription)
Description copied from interface: SubscriptionAliveListener
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 SubscriptionAliveListener.onAfterCreate(Subscription).

Specified by:
onTimeout in interface SubscriptionAliveListener
Parameters:
subscription - the subscription that timed out


Copyright © 2018. All rights reserved.