UA Server SDK C++ Bundle
1.4.3.291
|
Class implementing the OPC UA subscription object. More...
#include <uasubscription.h>
Inherits ReferenceCounter, EventManagerCallback, and IOManagerCallback.
Public Types | |
enum | State { CLOSED, CREATING, NORMAL, LATE, KEEPALIVE } |
Subscription state enumeration. More... | |
Public Member Functions | |
UaSubscription (UaSession *pSession, ServerManager *pServerManager, OpcUa_Double publishingInterval, OpcUa_UInt32 &lifetimeCount, OpcUa_UInt32 maxKeepAliveCount, OpcUa_UInt32 maxRetransmissionQueueSize, OpcUa_UInt32 maxNotificationPerPublish, OpcUa_Boolean publishingEnabled, OpcUa_Byte priority) | |
construction More... | |
OpcUa_UInt32 | activeTransactionCount () |
Get number of active transactions. More... | |
void | waitForTransactionCompletion (OpcUa_UInt32 nExpectedCount=0) |
Wait for completion of all subscription related transactions. More... | |
virtual void | setPublishingMode (OpcUa_Boolean publishingEnabled) |
Set publishing mode. More... | |
virtual void | modifySubscription (OpcUa_Double publishingInterval, OpcUa_UInt32 &lifetimeCount, OpcUa_UInt32 maxKeepAliveCount, OpcUa_UInt32 maxNotificationPerPublish, OpcUa_Byte priority) |
Modify the subscription settings. More... | |
virtual UaStatus | close (OpcUa_Boolean calledFromSessionClose=OpcUa_False) |
Close subscription. More... | |
virtual UaStatus | transfer (UaSession *pSession, OpcUa_Boolean sendInitialValues, UaUInt32Array &availableSequenceNumbers) |
Transfer the subscription to another session. | |
virtual UaStatus | beginCreateMonitoredItems (UaCreateMonitoredItemsContext *pUaCreateMonitoredItemsContext) |
Create new monitored items. More... | |
virtual UaStatus | beginModifyMonitoredItems (UaModifyMonitoredItemsContext *pUaModifyMonitoredItemsContext) |
Modify monitored items. More... | |
virtual UaStatus | beginSetMonitoringMode (UaSetMonitoringModeContext *pUaSetMonitoringModeContext) |
Set monitoring mode of monitored items. More... | |
virtual UaStatus | setTriggering (OpcUa_UInt32 triggeringItemId, const UaUInt32Array &linksToAdd, const UaUInt32Array &linksToRemove, UaStatusCodeArray &addResults, UaStatusCodeArray &removeResults) |
Set triggering of monitored items. More... | |
virtual UaStatus | beginDeleteMonitoredItems (UaDeleteMonitoredItemsContext *pUaDeleteMonitoredItemsContext) |
Delete monitored items. More... | |
virtual void | createMonitoredItemsFinished (OpcUa_CreateMonitoredItemsRequest *, const UaMonitoredItemCreateResults &) |
Event for derived class after create monitored items is finished. | |
virtual void | modifyMonitoredItemsFinished (OpcUa_ModifyMonitoredItemsRequest *, const UaMonitoredItemModifyResults &) |
Event for derived class after delete monitored items is finished. | |
virtual void | setMonitoringModeFinished (OpcUa_SetMonitoringModeRequest *, const UaStatusCodeArray &) |
Event for derived class after delete monitored items is finished. | |
virtual void | deleteMonitoredItemsFinished (OpcUa_DeleteMonitoredItemsRequest *, const UaStatusCodeArray &) |
Event for derived class after delete monitored items is finished. | |
UaStatus | beginConditionRefresh (const ServiceContext &serviceContext) |
Refresh condition state for the subscription. More... | |
void | dynamicEventManagerRegistered (EventManager *pEventManager) |
Executes the registration of a new EventManager added to the server. More... | |
virtual UaStatus | publish (UaPublishContext *pUaPublishContext, OpcUa_Boolean &hasMoreNotifications) |
Publish the notification message. More... | |
virtual UaStatus | republish (UaRepublishContext *pUaRepublishContext) |
Republish a lost notification message. More... | |
virtual OpcUa_UInt32 | checkPublishTimer (OpcUa_Boolean &doCheckAvailableNotifications) |
Check if the publish timer expired and returns the remaining time in milliseconds to the next event. More... | |
virtual void | checkAvailableNotifications () |
Check if notifications are available. More... | |
OpcUa_StatusCode | ackNotification (OpcUa_UInt32 sequenceNumber) |
Achnowledge and delete a notification message. More... | |
State | state () |
Get state of the subscription. More... | |
void | setThreadPool (UaThreadPool *pThreadPool) |
Set thread pool for service processing. More... | |
void | setSubscriptionId (OpcUa_UInt32 subscriptionId) |
Set subscription Id. More... | |
OpcUa_UInt32 | subscriptionId () const |
Get subscription Id. More... | |
OpcUa_Double | publishingInterval () const |
Get the cyclic rate that the Subscription is being requested to return Notifications to the Client. | |
OpcUa_UInt32 | lifetimeCount () const |
Returns the lifetime count of the Subscription When the publishing timer has expired this number of times without a publish request being available to send a NotificationMessage, then the subscription will be deleted by the server. | |
OpcUa_UInt32 | keepAliveCount () const |
Returns the keep alive count of the Subscription When the publishing timer has expired this number of times without requiring any NotificationMessage to be sent, the Subscription sends an empty keep-alive message to the Client. | |
UaStatus | finishRead (OpcUa_UInt32, OpcUa_UInt32, UaDataValue &, OpcUa_Boolean, OpcUa_Boolean, UaDiagnosticInfo *) |
Finished reading of an attribute value of a node. More... | |
UaStatus | finishWrite (OpcUa_UInt32, OpcUa_UInt32, const UaStatus &, OpcUa_Boolean) |
Finished writing of an attribute value of a node. More... | |
UaStatus | finishStartMonitoring (OpcUa_UInt32 hTransaction, OpcUa_UInt32 callbackHandle, OpcUa_UInt32 hIOVariable, OpcUa_Double revisedSamplingInterval, OpcUa_Boolean initialDataValueAvailable, const UaDataValue &initialDataValue, const UaStatus &statusCode) |
Finished transaction to start monitoring a data item. More... | |
UaStatus | finishModifyMonitoring (OpcUa_UInt32 hTransaction, OpcUa_UInt32 callbackHandle, OpcUa_Double revisedSamplingInterval, const UaStatus &statusCode) |
Finished modifying monitoring of a data item. More... | |
UaStatus | finishStopMonitoring (OpcUa_UInt32 hTransaction, OpcUa_UInt32 callbackHandle, const UaStatus &statusCode) |
Finished stopping monitoring of an data item. More... | |
UaStatus | finishStartMonitoring (OpcUa_UInt32, OpcUa_UInt32, OpcUa_UInt32, OpcUa_UInt32, OpcUa_Double, const UaStatus &, OpcUa_EventFilterResult *) |
Finished transaction to start monitoring an event item. More... | |
UaStatus | finishModifyMonitoring (OpcUa_UInt32, OpcUa_UInt32, OpcUa_UInt32, OpcUa_Double, const UaStatus &, OpcUa_EventFilterResult *) |
Finished modifying monitoring of an event item. More... | |
UaStatus | finishStopMonitoring (OpcUa_UInt32, OpcUa_UInt32, OpcUa_UInt32, const UaStatus &) |
Finished stopping monitoring of an event item. More... | |
Public Member Functions inherited from ReferenceCounter | |
ReferenceCounter () | |
construction | |
virtual | ~ReferenceCounter () |
destruction | |
Public Member Functions inherited from EventManagerCallback | |
EventManagerCallback () | |
construction | |
virtual | ~EventManagerCallback () |
destruction | |
Public Member Functions inherited from IOManagerCallback | |
IOManagerCallback () | |
Construction. | |
virtual | ~IOManagerCallback () |
Destruction. | |
Protected Member Functions | |
virtual | ~UaSubscription () |
destruction | |
Class implementing the OPC UA subscription object.
It manages all subscription relevant settings including the lifetime of the subscription. The object is reference counted and can not be deleted directly.
UaSubscription::UaSubscription | ( | UaSession * | pSession, |
ServerManager * | pServerManager, | ||
OpcUa_Double | publishingInterval, | ||
OpcUa_UInt32 & | lifetimeCount, | ||
OpcUa_UInt32 | maxKeepAliveCount, | ||
OpcUa_UInt32 | maxRetransmissionQueueSize, | ||
OpcUa_UInt32 | maxNotificationPerPublish, | ||
OpcUa_Boolean | publishingEnabled, | ||
OpcUa_Byte | priority | ||
) |
construction
pSession | Interface to the Session context for the method call |
pServerManager | a pointer to the root ServerManager. |
publishingInterval | publishing interval in milliseconds the server allows |
lifetimeCount | a count for the the actual lifetime. |
maxKeepAliveCount | the maximum of Time to keep the Session alive. |
maxRetransmissionQueueSize | the maximum number of notification messages queued for retransmittion. |
maxNotificationPerPublish | the maximum of notification per Publish. |
publishingEnabled | indicates if publishing is enabled or not. |
priority | the priority of the operation. |
OpcUa_StatusCode UaSubscription::ackNotification | ( | OpcUa_UInt32 | sequenceNumber | ) |
Achnowledge and delete a notification message.
sequenceNumber | The sequence number of the ackloedged notification |
OpcUa_UInt32 UaSubscription::activeTransactionCount | ( | ) |
Get number of active transactions.
UaStatus UaSubscription::beginConditionRefresh | ( | const ServiceContext & | serviceContext | ) |
Refresh condition state for the subscription.
serviceContext | Service context for the call. |
|
virtual |
Create new monitored items.
pUaCreateMonitoredItemsContext | the context of the items to create. |
List of objects to store a subset of the data for a IOManager
|
virtual |
Delete monitored items.
pUaDeleteMonitoredItemsContext | the context of the monitored items to delete. |
List of objects to store a subset of the data for an IOManager
|
virtual |
Modify monitored items.
pUaModifyMonitoredItemsContext | the context for the monitored items to modify. |
List of objects to store a subset of the data for a IOManager
|
virtual |
Set monitoring mode of monitored items.
pUaSetMonitoringModeContext | the monitored context of the item to modify. |
List of objects to store a subset of the data for a IOManager
|
virtual |
Check if notifications are available.
|
virtual |
Check if the publish timer expired and returns the remaining time in milliseconds to the next event.
doCheckAvailableNotifications | if true, checks if there are notifications available. |
|
virtual |
Close subscription.
calledFromSessionClose | true if session closed false if not. |
List of objects to store a subset of the data for a IOManager
void UaSubscription::dynamicEventManagerRegistered | ( | EventManager * | pEventManager | ) |
Executes the registration of a new EventManager added to the server.
pEventManager | EventManager to register with this call |
|
virtual |
Finished modifying monitoring of a data item.
hTransaction | Handle for the transaction used by the SDK to identify the transaction in the callbacks. This handle was passed in to the IOManager with the beginTransaction method. |
callbackHandle | Handle for the node in the callback. This handle was passed in to the IOManager with the beginModifyMonitoring method. |
revisedSamplingInterval | The corresponding revised sampling interval for the requested sampling interval in beginStartMonitoring. |
statusCode | Result of the finishModifyMonitoring operation. |
Implements IOManagerCallback.
|
virtual |
Finished modifying monitoring of an event item.
hTransaction | Handle for the transaction used by the SDK to identify the transaction in the callbacks. This handle was passed in to the IOManager with the beginTransaction method. |
callbackHandle | Handle for the node in the callback. This handle was passed in to the IOManager with the beginModifyMonitoring method. |
eventManagerIndex | an Index of different EventManagers. |
revisedSamplingInterval | The corresponding revised sampling interval for the requested sampling interval in beginStartMonitoring. |
statusCode | Result of the finishModifyMonitoring operation. |
pEventFilterResult | The resulted status code of the filtered events |
Implements EventManagerCallback.
|
inlinevirtual |
Finished reading of an attribute value of a node.
The method is called to finish a read call for an attribute value of a node. The read is started with the beginRead method of the interface IOManager.
hTransaction | Handle for the transaction used by the SDK to identify the transaction in the callbacks. This handle was passed in to the IOManager with the beginTransaction method. |
callbackHandle | Handle for the node in the callback. This handle was passed in to the IOManager with the beginRead method. |
dataValue | Contains the value, timestamps and result code for the Read operation. |
detachValue | Indicates if the method can detach the value from the wrapper class. |
allowThreadUse | Indicates if the calling thread can be used by the SDK to send the response to the client. This can happen if this method is the called for the last node in the transaction. True: The thread calling this method can be used to send the response and may block False: The SDK is using a worker thread to send the response to the client. |
pDiagnosticInfo | Optional diagnostig information requested by the client in the parameter ServiceContext::returnDiagnostics of IOManager::beginTransaction |
Implements IOManagerCallback.
|
virtual |
Finished transaction to start monitoring a data item.
hTransaction | Handle for the transaction used by the SDK to identify the transaction in the callbacks. This handle was passed in to the IOManager with the beginTransaction method. |
callbackHandle | Handle for the node in the callback. This handle was passed in to the IOManager with the beginStartMonitoring method. |
hIOVariable | The handle of the variable in the IOManager created with beginStartMonitoring. The handle was passed to the SDK in the callback finishStartMonitoring. |
revisedSamplingInterval | The corresponding revised sampling interval for the requested sampling interval in beginStartMonitoring. |
initialDataValueAvailable | the available initial data value. |
initialDataValue | the actual data value. |
statusCode | Result of the finishStartMonitoring operation. |
Implements IOManagerCallback.
|
virtual |
Finished transaction to start monitoring an event item.
hTransaction | Handle for the transaction used by the SDK to identify the transaction in the callbacks. This handle was passed in to the IOManager with the beginTransaction method. |
callbackHandle | Handle for the node in the callback. This handle was passed in to the IOManager with the beginModifyMonitoring method. |
eventManagerIndex | an Index of different EventManagers. |
hEventItem | an EventItem used to fire an Event. |
revisedSamplingInterval | The corresponding revised sampling interval for the requested sampling interval in beginStartMonitoring. |
statusCode | Result of the finishStartMonitoring operation. |
pEventFilterResult | The resulted status code of the filtered events |
Implements EventManagerCallback.
|
virtual |
Finished stopping monitoring of an data item.
hTransaction | Handle for the transaction used by the SDK to identify the transaction in the callbacks. This handle was passed in to the IOManager with the beginTransaction method. |
callbackHandle | Handle for the node in the callback. This handle was passed in to the IOManager with the beginModifyMonitoring method. |
statusCode | Result of the finishStopMonitoring operation. |
Implements IOManagerCallback.
|
virtual |
Finished stopping monitoring of an event item.
hTransaction | Handle for the transaction used by the SDK to identify the transaction in the callbacks. This handle was passed in to the IOManager with the beginTransaction method. |
callbackHandle | Handle for the node in the callback. This handle was passed in to the IOManager with the beginModifyMonitoring method. |
eventManagerIndex | an Index of different EventManagers. |
statusCode | Result of the finishStopMonitoring operation. |
Implements EventManagerCallback.
|
inlinevirtual |
Finished writing of an attribute value of a node.
The method is called to finish a write call for an attribute value of a node. The write is started with the beginWrite method of the interface IOManager.
hTransaction | Handle for the transaction used by the SDK to identify the transaction in the callbacks. This handle was passed in to the IOManager with the beginTransaction method. |
callbackHandle | Handle for the node in the callback. This handle was passed in to the IOManager with the beginWrite method. |
statusCode | Result of the Write operation. Optional diagnostig information requested by the client in the parameter ServiceContext::returnDiagnostics of IOManager::beginTransaction can be provided through UaStatus::setDiagnosticInfo(). |
allowThreadUse | Indicates if the calling thread can be used by the SDK to send the response to the client. This can happen if this method is the called for the last node in the transaction. True: The thread calling this method can be used to send the response and may block False: The SDK is using a worker thread to send the response to the client. |
Implements IOManagerCallback.
|
virtual |
Modify the subscription settings.
publishingInterval | publishing interval in milliseconds the server allows |
lifetimeCount | a count for the the actual lifetime. |
maxKeepAliveCount | the maximum of Time to keep the Session alive. |
maxNotificationPerPublish | the maximum of notification per Publish. |
priority | the priority of the operation. |
|
virtual |
Publish the notification message.
pUaPublishContext | the context of the published notification. |
hasMoreNotifications | indicates if there are more notifications in the message. |
|
virtual |
Republish a lost notification message.
pUaRepublishContext | The context of the republish call. |
|
virtual |
Set publishing mode.
publishingEnabled | indicates if publishing is enabled or not. |
void UaSubscription::setSubscriptionId | ( | OpcUa_UInt32 | subscriptionId | ) |
Set subscription Id.
Sets the subscription id for the subscription.
|
inline |
Set thread pool for service processing.
|
virtual |
Set triggering of monitored items.
triggeringItemId | he Id of the items to set triggering to. |
linksToAdd | The links to add to the monitored item |
linksToRemove | The links to remove from the monitored item |
addResults | The results to add to the monitored item. |
removeResults | The results to remove from the monitored item. |
UaSubscription::State UaSubscription::state | ( | ) |
Get state of the subscription.
|
inline |
Get subscription Id.
void UaSubscription::waitForTransactionCompletion | ( | OpcUa_UInt32 | nExpectedCount = 0 | ) |
Wait for completion of all subscription related transactions.