Kanzi Connect  3.9.8
Kanzi Connect Java API
AbstractRuntimeDataListener Class Referenceabstract

Abstract base class which handles the generic logic needed to subscribe to runtime data changes of a service Subclass this and implement. More...

Inheritance diagram for AbstractRuntimeDataListener:

Public Member Functions

 AbstractRuntimeDataListener (String uri, ClientConnector connector)
 Constructor. More...
 
 AbstractRuntimeDataListener (String uri, KanziConnectContext kanziConnectContext)
 Constructor. More...
 
void cleanup ()
 Performs a cleanup for the object. More...
 
void handleConnected ()
 Handler for acquiring server connection.
 
void handleDisconnected ()
 Handler for losing server connection.
 

Protected Member Functions

void finalize ()
 
abstract void setDefaultValues ()
 Reset the runtime data to default values, invoked e.g. when connection to server is lost.
 

Detailed Description

Abstract base class which handles the generic logic needed to subscribe to runtime data changes of a service Subclass this and implement.

  • setDefaultValues to reset the default values for data you are interested in (e.g. when being disconnected)
  • contentRuntimeDataSubscriptionResult to receive the runtime data changes

Constructor & Destructor Documentation

◆ AbstractRuntimeDataListener() [1/2]

AbstractRuntimeDataListener ( String  uri,
ClientConnector  connector 
)

Constructor.

Parameters
uriThe URI to subscribe to, eg servicedata://<service_name>.
connectorThe ClientConnector used to connect to the server.

◆ AbstractRuntimeDataListener() [2/2]

AbstractRuntimeDataListener ( String  uri,
KanziConnectContext  kanziConnectContext 
)

Constructor.

Parameters
uriThe URI to subscribe to, eg servicedata://<service_name>.
kanziConnectContextThe Kanzi Connect Context which owns the ClientConnector to access the server.

Member Function Documentation

◆ cleanup()

void cleanup ( )

Performs a cleanup for the object.

After call object won't anymore receive updates from server. Calling will release all outside references and render object unusable.