C++ Based OPC UA Client/Server/PubSub SDK  1.8.3.628
Subscription

Overview

The UaSubscription class represents a single Subscription on a Server. The data and event streams created with monitored items are provided as callbacks through UaSubscriptionCallback.

The UaSubscription class does not maintain a local copy of the parameters and MonitoredItems. If the Subscription is no longer valid, the user of the SDK is responsible for re-creating the Subscription on the Server. Invalid Subscriptions are reported through UaSubscriptionCallback::subscriptionStatusChanged

A UaSubscription object is thread-safe.

Handles and Ids

SubscriptionId

The SubscriptionId is an internal server created handle for communicating between server and client (SDK). Since the SubscriptionId is necessary to transfer a Subscription to another Session, the SubscriptionId is exposed to the SDK user.

Depending on the used protocol, the SessionId can be security relevant and should not be visible outside the client or server application. Therefore the SessionId is not exposed on the API to make sure it is not exposed on the client side in a GUI by mistake. The SubscriptionId, however, is needed to transfer the subscription to another session and is not security relevant.

ClientSubscriptionHandle

The clientSubscriptionHandle is a client (SDK user) defined handle to identify the Subscription in the callback if the same callback object is used for more than one Subscription. The clientSubscriptionHandle is just a pass through for the SDK and all requirements for this handle are defined by the application logic. The clientSubscriptionHandle is never exchanged with the server.

TransactionId

The transactionId is a client (SDK user) defined handle to identify the results of an asynchronous service invocation in the callback. It is a parameter to all asynchronous beginXXX service calls. The transactionId is just a pass through for the SDK and all requirements for this handle are defined by the application logic. The transactionId is never exchanged with the server. It is just stored with the transaction object in the Client SDK.

Monitored items

The MonitoredItemId is a Server defined handle returned in UaMonitoredItemCreateResults. It is necessary to modify or delete monitored items.

The ClientHandle is assigned by the SDK user and should be unique per UaSubscriptionCallback instance. If unique monitored item ClientHandles are assigned across subscriptions, the clientSubscriptionHandle is not relevant for data change or event callbacks. In this case the clientSubscriptionHandle handle is only relevant for subscription status change callbacks.