UaSubscription Class Reference

Implements a UA subscription. Derived from ReferenceCounter, IOManagerCallback and EventManagerCallback It is not possible to create plane copies of this class. It is not possible to use the default constructor. More...

#include <uasubscription.h>

Inheritance diagram for UaSubscription:
Collaboration diagram for UaSubscription:

List of all members.


Public Types

enum  State {
  CLOSED, CREATING, NORMAL, LATE,
  KEEPALIVE
}
 Subscription state enumeration. More...

Public Member Functions

 UaSubscription (Session *pSession, ServerManager *pServerManager, OpcUa_Double publishingInterval, OpcUa_UInt32 &lifetimeCount, OpcUa_UInt32 maxKeepAliveCount, OpcUa_UInt32 maxNotificationPerPublish, OpcUa_Boolean publishingEnabled, OpcUa_Byte priority)
UaStatus close (OpcUa_Boolean calledFromSessionClose=OpcUa_False)
UaStatus finishRead (OpcUa_UInt32, OpcUa_UInt32, UaDataValue &, OpcUa_Boolean, OpcUa_Boolean, UaDiagnosticInfo *)
UaStatus finishWrite (OpcUa_UInt32, OpcUa_UInt32, const UaStatus &, OpcUa_Boolean)
UaStatus finishStartMonitoring (OpcUa_UInt32 hTransaction, OpcUa_UInt32 callbackHandle, OpcUa_UInt32 hIOVariable, OpcUa_Double revisedSamplingInterval, OpcUa_Boolean initialDataValueAvailable, const UaDataValue &initialDataValue, const UaStatus &statusCode)
UaStatus finishModifyMonitoring (OpcUa_UInt32 hTransaction, OpcUa_UInt32 callbackHandle, OpcUa_Double revisedSamplingInterval, const UaStatus &statusCode)
UaStatus finishStopMonitoring (OpcUa_UInt32 hTransaction, OpcUa_UInt32 callbackHandle, const UaStatus &statusCode)
UaStatus finishStartMonitoring (OpcUa_UInt32 hTransaction, OpcUa_UInt32 callbackHandle, OpcUa_UInt32 eventManagerIndex, OpcUa_UInt32 hEventItem, OpcUa_Double revisedSamplingInterval, const UaStatus &statusCode)
UaStatus finishModifyMonitoring (OpcUa_UInt32 hTransaction, OpcUa_UInt32 callbackHandle, OpcUa_UInt32 eventManagerIndex, OpcUa_Double revisedSamplingInterval, const UaStatus &statusCode)
UaStatus finishStopMonitoring (OpcUa_UInt32 hTransaction, OpcUa_UInt32 callbackHandle, OpcUa_UInt32 eventManagerIndex, const UaStatus &statusCode)
UaStatus beginCreateMonitoredItems (UaCreateMonitoredItemsContext *pUaCreateMonitoredItemsContext)
UaStatus beginModifyMonitoredItems (UaModifyMonitoredItemsContext *pUaModifyMonitoredItemsContext)
UaStatus beginSetMonitoringMode (UaSetMonitoringModeContext *pUaSetMonitoringModeContext)
UaStatus beginDeleteMonitoredItems (UaDeleteMonitoredItemsContext *pUaDeleteMonitoredItemsContext)
OpcUa_UInt32 checkPublishTimer (OpcUa_Boolean &doCheckAvailableNotifications)
void checkAvailableNotifications ()
UaStatus publish (UaPublishContext *pUaPublishContext)
void setPublishingMode (OpcUa_Boolean publishingEnabled)
void modifySubscription (OpcUa_Double publishingInterval, OpcUa_UInt32 &lifetimeCount, OpcUa_UInt32 maxKeepAliveCount, OpcUa_UInt32 maxNotificationPerPublish, OpcUa_Byte priority)

Protected Member Functions

virtual ~UaSubscription ()

Detailed Description

Implements a UA subscription. Derived from ReferenceCounter, IOManagerCallback and EventManagerCallback It is not possible to create plane copies of this class. It is not possible to use the default constructor.

UaSubscription


Member Enumeration Documentation

Subscription state enumeration.

Enumerator:
CLOSED  State: Closed
CREATING  State: Creating
NORMAL  State: Normal
LATE  State: Late
KEEPALIVE  State: KeepAlive


Constructor & Destructor Documentation

UaSubscription::~UaSubscription (  )  [protected, virtual]

destruction

UaSubscription::UaSubscription ( Session pSession,
ServerManager pServerManager,
OpcUa_Double  publishingInterval,
OpcUa_UInt32 &  lifetimeCount,
OpcUa_UInt32  maxKeepAliveCount,
OpcUa_UInt32  maxNotificationPerPublish,
OpcUa_Boolean  publishingEnabled,
OpcUa_Byte  priority 
)

construction

Parameters:
pSession Interface to the Session context for the method call
pNodeManagerRoot a pointer to the root NodeManager.
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.
publishingEnabled indicates if publishing is enabled or not.
priority the priority of the operation.


Member Function Documentation

UaStatus UaSubscription::close ( OpcUa_Boolean  calledFromSessionClose = OpcUa_False  ) 

Close subscription.

Parameters:
calledFromSessionClose true if session closed false if not.
Returns:
Error code

List of objects to store a subset of the data for a IOManager

UaStatus UaSubscription::finishRead ( OpcUa_UInt32  hTransaction,
OpcUa_UInt32  callbackHandle,
UaDataValue dataValue,
OpcUa_Boolean  detachValue,
OpcUa_Boolean  allowThreadUse,
UaDiagnosticInfo pDiagnosticInfo 
) [inline, virtual]

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.

Parameters:
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 to send the response if this is the callback for the last node in the transaction.
pDiagnosticInfo Optional diagnostig information requested by the client in the parameter ServiceContext::returnDiagnostics of IOManager::beginTransaction
Returns:
Error code

Implements IOManagerCallback.

UaStatus UaSubscription::finishWrite ( OpcUa_UInt32  hTransaction,
OpcUa_UInt32  callbackHandle,
const UaStatus statusCode,
OpcUa_Boolean  allowThreadUse 
) [inline, virtual]

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.

Parameters:
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.
allowThreadUse Indicates if the calling thread can be used to send the response if this is the callback for the last node in the transaction.
Returns:
Error code

Implements IOManagerCallback.

UaStatus UaSubscription::finishStartMonitoring ( OpcUa_UInt32  hTransaction,
OpcUa_UInt32  callbackHandle,
OpcUa_UInt32  hIOVariable,
OpcUa_Double  revisedSamplingInterval,
OpcUa_Boolean  initialDataValueAvailable,
const UaDataValue initialDataValue,
const UaStatus statusCode 
) [virtual]

Finished transaction to start monitoring a data item.

Parameters:
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.
Returns:
Error code

Implements IOManagerCallback.

UaStatus UaSubscription::finishModifyMonitoring ( OpcUa_UInt32  hTransaction,
OpcUa_UInt32  callbackHandle,
OpcUa_Double  revisedSamplingInterval,
const UaStatus statusCode 
) [virtual]

Finished modifying monitoring of a data item.

Parameters:
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.
Returns:
Error code

Implements IOManagerCallback.

UaStatus UaSubscription::finishStopMonitoring ( OpcUa_UInt32  hTransaction,
OpcUa_UInt32  callbackHandle,
const UaStatus statusCode 
) [virtual]

Finished stopping monitoring of an data item.

Parameters:
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.
Returns:
Error code

Implements IOManagerCallback.

UaStatus UaSubscription::finishStartMonitoring ( OpcUa_UInt32  hTransaction,
OpcUa_UInt32  callbackHandle,
OpcUa_UInt32  eventManagerIndex,
OpcUa_UInt32  hEventItem,
OpcUa_Double  revisedSamplingInterval,
const UaStatus statusCode 
) [virtual]

Finished transaction to start monitoring an event item.

Parameters:
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.
Returns:
Error code

Implements EventManagerCallback.

UaStatus UaSubscription::finishModifyMonitoring ( OpcUa_UInt32  hTransaction,
OpcUa_UInt32  callbackHandle,
OpcUa_UInt32  eventManagerIndex,
OpcUa_Double  revisedSamplingInterval,
const UaStatus statusCode 
) [virtual]

Finished modifying monitoring of an event item.

Parameters:
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.
Returns:
Error code

Implements EventManagerCallback.

UaStatus UaSubscription::finishStopMonitoring ( OpcUa_UInt32  hTransaction,
OpcUa_UInt32  callbackHandle,
OpcUa_UInt32  eventManagerIndex,
const UaStatus statusCode 
) [virtual]

Finished stopping monitoring of an event item.

Parameters:
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.
Returns:
Error code

Implements EventManagerCallback.

UaStatus UaSubscription::beginCreateMonitoredItems ( UaCreateMonitoredItemsContext pUaCreateMonitoredItemsContext  ) 

Create new monitored items.

Parameters:
pUaCreateMonitoredItemsContext the context of the items to create.
Returns:
Error code

List of objects to store a subset of the data for a IOManager

UaStatus UaSubscription::beginModifyMonitoredItems ( UaModifyMonitoredItemsContext pUaModifyMonitoredItemsContext  ) 

Modify monitored items.

Parameters:
pUaModifyMonitoredItemsContext the context for the monitored items to modify.
Returns:
Error code

List of objects to store a subset of the data for a IOManager

UaStatus UaSubscription::beginSetMonitoringMode ( UaSetMonitoringModeContext pUaSetMonitoringModeContext  ) 

Set monitoring mode of monitored items.

Parameters:
pUaSetMonitoringModeContext the monitored context of the item to modify.
Returns:
Error code

List of objects to store a subset of the data for a IOManager

UaStatus UaSubscription::beginDeleteMonitoredItems ( UaDeleteMonitoredItemsContext pUaDeleteMonitoredItemsContext  ) 

Delete monitored items.

Parameters:
pUaDeleteMonitoredItemsContext the context of the monitored items to delete.
Returns:
Error code

List of objects to store a subset of the data for a IOManager

OpcUa_UInt32 UaSubscription::checkPublishTimer ( OpcUa_Boolean &  doCheckAvailableNotifications  ) 

Check if the publish timer expired and returns the remaining time in milliseconds to the next event.

Returns:
the remaining time in milliseconds to the next event.

void UaSubscription::checkAvailableNotifications (  ) 

Check if notifications are available.

UaStatus UaSubscription::publish ( UaPublishContext pUaPublishContext  ) 

Publish the notification message.

Parameters:
pUaPublishContext the context of the published notification.
Returns:
Error code

void UaSubscription::setPublishingMode ( OpcUa_Boolean  publishingEnabled  ) 

Set publishing mode.

Parameters:
publishingEnabled indicates if publishing is enabled or not.

void UaSubscription::modifySubscription ( OpcUa_Double  publishingInterval,
OpcUa_UInt32 &  lifetimeCount,
OpcUa_UInt32  maxKeepAliveCount,
OpcUa_UInt32  maxNotificationPerPublish,
OpcUa_Byte  priority 
)

Modify the subscription settings.

Parameters:
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.


The documentation for this class was generated from the following files:
  • src/uaserver/uaservercpp/uamodule/uasubscription.h
  • src/uaserver/uaservercpp/uamodule/uasubscription.cpp