UA Server SDK C++ Bundle  1.4.0.258
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
UaTransactionManager Class Reference

UaTransactionManager. More...

#include <uatransactionmanager.h>

Inherits HistoryManagerCallback, IOManager2Callback, and IOManagerCallback.

Public Member Functions

 UaTransactionManager (ServerManager *pServerManager, UaSubscriptionManager *pUaSubscriptionManager)
 construction More...
 
 ~UaTransactionManager ()
 destruction
 
UaStatus startUp ()
 Start up transaction manager. More...
 
UaStatus shutDown ()
 Shut down transaction manager. More...
 
void waitForTransactionCompletion ()
 
UaStatus finishRead (OpcUa_UInt32, OpcUa_UInt32, UaDataValue &, OpcUa_Boolean detachValue=OpcUa_False, OpcUa_Boolean allowThreadUse=OpcUa_False, UaDiagnosticInfo *pDiagnosticInfo=NULL)
 Finish a Read transaction. More...
 
UaStatus finishWrite (OpcUa_UInt32, OpcUa_UInt32, const UaStatus &, OpcUa_Boolean allowThreadUse=OpcUa_False)
 Finish a Write transaction. More...
 
UaStatus finishStartMonitoring (OpcUa_UInt32, OpcUa_UInt32, OpcUa_UInt32, OpcUa_Double, OpcUa_Boolean, const UaDataValue &, const UaStatus &)
 Finished start monitoring of an attribute value of a node. More...
 
UaStatus finishModifyMonitoring (OpcUa_UInt32, OpcUa_UInt32, OpcUa_Double, const UaStatus &)
 Finished modify monitoring of an attribute value of a node. More...
 
UaStatus finishStopMonitoring (OpcUa_UInt32, OpcUa_UInt32, const UaStatus &)
 Finished stop monitoring of an attribute value of a node. More...
 
virtual UaStatus finishRead (OpcUa_UInt32 hTransaction, OpcUa_UInt32 processedCount, OpcUa_Boolean allowThreadUse)
 Finished read transaction for IOManager2 nodes. More...
 
virtual UaStatus finishWrite (OpcUa_UInt32 hTransaction, OpcUa_UInt32 processedCount, OpcUa_Boolean allowThreadUse)
 Finished write transaction for IOManager2 nodes. More...
 
virtual UaStatus finishStartMonitoring (OpcUa_UInt32, OpcUa_Boolean, const UaUInt32Array &, const UaUInt32Array &, const UaDoubleArray &, const UaStatusCodeArray &)
 Finished start monitoring transaction for IOManager2 nodes. More...
 
virtual UaStatus finishModifyMonitoring (OpcUa_UInt32, OpcUa_Boolean, const UaUInt32Array &, const UaDoubleArray &, const UaStatusCodeArray &)
 Finished modify monitoring transaction for IOManager2 nodes. More...
 
virtual UaStatus finishStopMonitoring (OpcUa_UInt32, OpcUa_Boolean, const UaUInt32Array &, const UaStatusCodeArray &)
 Finished stop monitoring transaction for IOManager2 nodes. More...
 
UaStatus finishHistoryReadData (OpcUa_UInt32, OpcUa_UInt32, const UaStatus &, HistoryReadCPUserDataBase *, UaDataValues &, OpcUa_Boolean)
 Finish a history data read transaction. More...
 
UaStatus finishHistoryReadModifiedData (OpcUa_UInt32, OpcUa_UInt32, const UaStatus &, HistoryReadCPUserDataBase *, UaDataValues &, UaModificationInfo &, OpcUa_Boolean)
 Callback function for a historical read of modified data. More...
 
UaStatus finishHistoryReadEvent (OpcUa_UInt32, OpcUa_UInt32, const UaStatus &, HistoryReadCPUserDataBase *, UaHistoryEventFieldLists &s, OpcUa_Boolean)
 Finish a history event read transaction. More...
 
UaStatus finishHistoryUpdate (OpcUa_UInt32, OpcUa_UInt32, const UaStatus &, UaStatusCodeArray &, UaDiagnosticInfos &, OpcUa_Boolean)
 Finish a history update transaction. More...
 
UaStatus beginHistoryRead (UaHistoryReadContext *pUaHistoryReadContext)
 Begin a HistoryRead transaction. More...
 
UaStatus beginHistoryUpdate (UaHistoryUpdateContext *pUaHistoryUpdateContext)
 Begin a HistoryUpdate transaction. More...
 
UaStatus cancelServices (const ServiceContext &serviceContext, OpcUa_UInt32 requestHandle, OpcUa_UInt32 &cancelCount)
 Cancel services in the session context. More...
 
virtual UaStatus registerNodes (const ServiceContext &serviceContext, const UaNodeIdArray &nodesToRegister, UaNodeIdArray &registeredNodesIds)
 Register nodes to create handles in the session context. More...
 
virtual UaStatus unregisterNodes (const ServiceContext &serviceContext, const UaNodeIdArray &registeredNodesIds)
 Unregister nodes used as handles in the session context. More...
 
virtual UaStatus beginBrowse (UaBrowseContext *pUaBrowseContext)
 Begin a Browse transaction. More...
 
virtual UaStatus beginBrowseNext (UaBrowseNextContext *pUaBrowseNextContext)
 Begin a BrowseNext transaction. More...
 
virtual UaStatus beginQuery (UaQueryContext *pUaQueryContext)
 Begin a Query transaction. More...
 
UaStatus beginRead (UaReadContext *pUaReadContext)
 Begin a Read transaction. More...
 
UaStatus beginWrite (UaWriteContext *pUaWriteContext)
 Begin a Write transaction. More...
 
UaStatus beginMethodCall (UaCallContext *pUaCallContext)
 Begin a Call transaction. More...
 
void executeMethodCall (UaCallContext *pUaCallContext)
 
- Public Member Functions inherited from HistoryManagerCallback
 HistoryManagerCallback ()
 construction
 
virtual ~HistoryManagerCallback ()
 destruction
 
- Public Member Functions inherited from IOManager2Callback
 IOManager2Callback ()
 Construction.
 
virtual ~IOManager2Callback ()
 Destruction.
 
- Public Member Functions inherited from IOManagerCallback
 IOManagerCallback ()
 Construction.
 
virtual ~IOManagerCallback ()
 Destruction.
 

Protected Attributes

OpcUa_Boolean m_isStarted
 
ServerManagerm_pServerManager
 
NodeManagerRootm_pNodeManagerRoot
 
UaSubscriptionManagerm_pUaSubscriptionManager
 
UaThreadPoolm_pThreadPool
 
UaMutex m_mutex
 
HandleManager< UaTMBaseContextm_TransactionHandleManager
 
std::list< IOManager2 * > m_listIOManager2
 

Detailed Description

UaTransactionManager.

Implements the UA node manager. Derived from HistoryManagerCallback, and IOManagerCallback. It is not possible to create plane copies of this class. It is not possible to use the default constructor.

Constructor & Destructor Documentation

UaTransactionManager::UaTransactionManager ( ServerManager pServerManager,
UaSubscriptionManager pUaSubscriptionManager 
)

construction

Parameters
pServerManagerInterface to the central ServerManager object. This interface pointer should be stored in the NodeManager instance to have access to core module objects like the root NodeManager or the ServerConfig
pUaSubscriptionManagerInterface of the UaSubscriptionManager

Member Function Documentation

UaStatus UaTransactionManager::beginBrowse ( UaBrowseContext pUaBrowseContext)
virtual

Begin a Browse transaction.

Parameters
pUaBrowseContextthe needed browse context.
Returns
Error code
UaStatus UaTransactionManager::beginBrowseNext ( UaBrowseNextContext pUaBrowseNextContext)
virtual

Begin a BrowseNext transaction.

Parameters
pUaBrowseNextContextthe needed BrowseNext context.
Returns
Error code
UaStatus UaTransactionManager::beginHistoryRead ( UaHistoryReadContext pUaHistoryReadContext)

Begin a HistoryRead transaction.

Parameters
pUaHistoryReadContextthe needed read context for historizing.
Returns
Error code

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

UaStatus UaTransactionManager::beginHistoryUpdate ( UaHistoryUpdateContext pUaHistoryUpdateContext)

Begin a HistoryUpdate transaction.

Parameters
pUaHistoryUpdateContextthe needed update context for historizing.
Returns
Error code

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

UaStatus UaTransactionManager::beginMethodCall ( UaCallContext pUaCallContext)

Begin a Call transaction.

Parameters
pUaCallContextthe needed call context.
Returns
Error code
UaStatus UaTransactionManager::beginQuery ( UaQueryContext pUaQueryContext)
virtual

Begin a Query transaction.

Parameters
pUaQueryContextthe needed query context.
Returns
Error code
UaStatus UaTransactionManager::beginRead ( UaReadContext pUaReadContext)

Begin a Read transaction.

Parameters
pUaReadContextthe needed read context.
Returns
Error code

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

UaStatus UaTransactionManager::beginWrite ( UaWriteContext pUaWriteContext)

Begin a Write transaction.

Parameters
pUaWriteContextthe needed write context.
Returns
Error code

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

UaStatus UaTransactionManager::cancelServices ( const ServiceContext serviceContext,
OpcUa_UInt32  requestHandle,
OpcUa_UInt32 &  cancelCount 
)

Cancel services in the session context.

Parameters
serviceContextGeneral context for the service calls containing information like the session object, return diagnostic mask and timeout hint.
requestHandleRequestHandle of service requests to cancel.
cancelCountNumber of cancelled requests.
Returns
Error code
UaStatus UaTransactionManager::finishHistoryReadData ( OpcUa_UInt32  hTransaction,
OpcUa_UInt32  callbackHandle,
const UaStatus result,
HistoryReadCPUserDataBase pContinuationPoint,
UaDataValues &  dataValues,
OpcUa_Boolean  allowThreadUse 
)
virtual

Finish a history data read transaction.

Parameters
hTransactionHandle 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.
callbackHandleHandle for the node in the callback. This handle was passed in to the IOManager with the beginStartMonitoring method.
resultthe result of the current Operation.
pContinuationPointThe continuation point data if not all results can be returned in one Read call. Implementers of this interface can store the continuation point data in a derived class.
dataValuesthe requested Values for this operation.
allowThreadUseIndicates 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 HistoryManagerCallback.

UaStatus UaTransactionManager::finishHistoryReadEvent ( OpcUa_UInt32  hTransaction,
OpcUa_UInt32  callbackHandle,
const UaStatus result,
HistoryReadCPUserDataBase pContinuationPoint,
UaHistoryEventFieldLists &  events,
OpcUa_Boolean  allowThreadUse 
)
virtual

Finish a history event read transaction.

Parameters
hTransactionHandle 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.
callbackHandleHandle for the node in the callback. This handle was passed in to the IOManager with the beginStartMonitoring method.
resultthe result of the current Operation.
pContinuationPointThe continuation point data if not all results can be returned in one Read call. Implementers of this interface can store the continuation point data in a derived class.
eventsa field list of events that can occur.
allowThreadUseIndicates 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 HistoryManagerCallback.

UaStatus UaTransactionManager::finishHistoryReadModifiedData ( OpcUa_UInt32  hTransaction,
OpcUa_UInt32  callbackHandle,
const UaStatus result,
HistoryReadCPUserDataBase pContinuationPoint,
UaDataValues &  dataValues,
UaModificationInfo &  modificationInformations,
OpcUa_Boolean  allowThreadUse 
)
virtual

Callback function for a historical read of modified data.

Parameters
hTransactionHandle 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.
callbackHandleHandle for the node in the callback. This handle was passed in to the IOManager with the beginStartMonitoring method.
resultthe result of the current Operation.
pContinuationPointThe continuation point data if not all results can be returned in one Read call. Implementers of this interface can store the continuation point data in a derived class.
dataValuesthe requested Values for this operation.
modificationInformationsThe modification information for the requested Values for this operation. The information array will be detached by the SDK.
allowThreadUseIndicates 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 HistoryManagerCallback.

UaStatus UaTransactionManager::finishHistoryUpdate ( OpcUa_UInt32  hTransaction,
OpcUa_UInt32  callbackHandle,
const UaStatus result,
UaStatusCodeArray &  operationResults,
UaDiagnosticInfos &  operationDiagnosticInfos,
OpcUa_Boolean  allowThreadUse 
)
virtual

Finish a history update transaction.

Parameters
hTransactionHandle 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.
callbackHandleHandle for the node in the callback. This handle was passed in to the IOManager with the beginStartMonitoring method.
resultthe result of the current Operation.
operationResultsthe results of an actual operation
operationDiagnosticInfosthe diagnostic information of the current operation.
allowThreadUseIndicates 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 HistoryManagerCallback.

UaStatus UaTransactionManager::finishModifyMonitoring ( OpcUa_UInt32  hTransaction,
OpcUa_UInt32  callbackHandle,
OpcUa_Double  revisedSamplingInterval,
const UaStatus statusCode 
)
inlinevirtual

Finished modify monitoring of an attribute value of a node.

The method is called to finish the modifying of the sampling attributes for a monitored item. The modifying is started with the beginModifyMonitoring method of the interface IOManager.

Parameters
hTransactionHandle 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.
callbackHandleHandle for the node in the callback. This handle was passed in to the IOManager with the beginModifyMonitoring method.
revisedSamplingIntervalThe corresponding revised sampling interval for the requested sampling interval in beginModifyMonitoring.
statusCodeResult of the ModifyMonitoring operation.
Returns
Error code

Implements IOManagerCallback.

virtual UaStatus UaTransactionManager::finishModifyMonitoring ( OpcUa_UInt32  hTransaction,
OpcUa_Boolean  allowThreadUse,
const UaUInt32Array &  callbackHandles,
const UaDoubleArray &  revisedSamplingIntervalArray,
const UaStatusCodeArray &  resultArray 
)
inlinevirtual

Finished modify monitoring transaction for IOManager2 nodes.

Parameters
hTransactionHandle for the transaction used by the SDK to identify the transaction in the callbacks. This handle was passed in to the IOManager2 with the beginModifyMonitoring method.
allowThreadUseIndicates if the calling thread can be used to send the response if this is the callback for the last nodes in the transaction.
callbackHandlesArray of callback handles for the nodes processed by the the IOManager2.
revisedSamplingIntervalArrayThe array of revised sampling intervals for the created items.
resultArrayThe array of the create results for the created monitored items.
Returns
Result code

Implements IOManager2Callback.

UaStatus UaTransactionManager::finishRead ( OpcUa_UInt32  hTransaction,
OpcUa_UInt32  callbackHandle,
UaDataValue dataValue,
OpcUa_Boolean  detachValue = OpcUa_False,
OpcUa_Boolean  allowThreadUse = OpcUa_False,
UaDiagnosticInfo pDiagnosticInfo = NULL 
)
virtual

Finish a Read transaction.

Parameters
hTransactionHandle 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.
callbackHandleHandle for the node in the callback. This handle was passed in to the IOManager with the beginStartMonitoring method.
dataValuethe requested Value for this operation.
detachValueIndicates if the method can detach the value from the wrapper class.
allowThreadUseIndicates if the calling thread can be used to send the response if this is the callback for the last node in the transaction.
pDiagnosticInfoOptional diagnostic information requested by the client in the parameter ServiceContext::returnDiagnostics of IOManager::beginTransaction
Returns
Error code

Implements IOManagerCallback.

UaStatus UaTransactionManager::finishRead ( OpcUa_UInt32  hTransaction,
OpcUa_UInt32  processedCount,
OpcUa_Boolean  allowThreadUse 
)
virtual

Finished read transaction for IOManager2 nodes.

Parameters
hTransactionHandle for the transaction used by the SDK to identify the transaction in the callbacks. This handle was passed in to the IOManager2 with the beginRead method.
processedCountNumber of processed items
allowThreadUseIndicates if the calling thread can be used to send the response if this is the callback for the last nodes in the transaction.
Returns
Result code

Implements IOManager2Callback.

UaStatus UaTransactionManager::finishStartMonitoring ( OpcUa_UInt32  hTransaction,
OpcUa_UInt32  callbackHandle,
OpcUa_UInt32  hIOVariable,
OpcUa_Double  revisedSamplingInterval,
OpcUa_Boolean  initialDataValueAvailable,
const UaDataValue initialDataValue,
const UaStatus statusCode 
)
inlinevirtual

Finished start monitoring of an attribute value of a node.

The method is called to finish the starting of the sampling for a monitored item. The sampling is started with the beginStartMonitoring method of the interface IOManager.

Parameters
hTransactionHandle 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.
callbackHandleHandle for the node in the callback. This handle was passed in to the IOManager with the beginStartMonitoring method.
hIOVariableThe handle of the item in the IOManager created with beginStartMonitoring. The handle is used by the SDK in beginModifyMonitoring and beginStopMonitoring to adress the item in the IOManager.
revisedSamplingIntervalThe corresponding revised sampling interval for the requested sampling interval in beginStartMonitoring.
initialDataValueAvailableIndicates if the initial value parameter is valid.
initialDataValueContains the value, timestamps and result code for the initial value.
statusCodeResult of the StartMonitoring operation.
Returns
Error code

Implements IOManagerCallback.

virtual UaStatus UaTransactionManager::finishStartMonitoring ( OpcUa_UInt32  hTransaction,
OpcUa_Boolean  allowThreadUse,
const UaUInt32Array &  callbackHandles,
const UaUInt32Array &  hIOVariableArray,
const UaDoubleArray &  revisedSamplingIntervalArray,
const UaStatusCodeArray &  resultArray 
)
inlinevirtual

Finished start monitoring transaction for IOManager2 nodes.

Parameters
hTransactionHandle for the transaction used by the SDK to identify the transaction in the callbacks. This handle was passed in to the IOManager2 with the beginStartMonitoring method.
allowThreadUseIndicates if the calling thread can be used to send the response if this is the callback for the last nodes in the transaction.
callbackHandlesArray of callback handles for the nodes processed by the the IOManager2.
hIOVariableArrayThe array of handles for the items created by the the IOManager2 in beginStartMonitoring.
revisedSamplingIntervalArrayThe array of revised sampling intervals for the created items.
resultArrayThe array of the create results for the created monitored items.
Returns
Result code

Implements IOManager2Callback.

UaStatus UaTransactionManager::finishStopMonitoring ( OpcUa_UInt32  hTransaction,
OpcUa_UInt32  callbackHandle,
const UaStatus statusCode 
)
inlinevirtual

Finished stop monitoring of an attribute value of a node.

The method is called to finish the stopping of the sampling for a monitored item. The stopping is started with the beginStopMonitoring method of the interface IOManager.

Parameters
hTransactionHandle 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.
callbackHandleHandle for the node in the callback. This handle was passed in to the IOManager with the beginStopMonitoring method.
statusCodeResult of the StopMonitoring operation.
Returns
Error code

Implements IOManagerCallback.

virtual UaStatus UaTransactionManager::finishStopMonitoring ( OpcUa_UInt32  hTransaction,
OpcUa_Boolean  allowThreadUse,
const UaUInt32Array &  callbackHandles,
const UaStatusCodeArray &  resultArray 
)
inlinevirtual

Finished stop monitoring transaction for IOManager2 nodes.

Parameters
hTransactionHandle for the transaction used by the SDK to identify the transaction in the callbacks. This handle was passed in to the IOManager2 with the beginStopMonitoring method.
allowThreadUseIndicates if the calling thread can be used to send the response if this is the callback for the last nodes in the transaction.
callbackHandlesArray of callback handles for the nodes processed by the the IOManager2.
resultArrayThe array of the remove results for the monitored items.
Returns
Result code

Implements IOManager2Callback.

UaStatus UaTransactionManager::finishWrite ( OpcUa_UInt32  hTransaction,
OpcUa_UInt32  callbackHandle,
const UaStatus statusCode,
OpcUa_Boolean  allowThreadUse = OpcUa_False 
)
virtual

Finish a Write transaction.

Parameters
hTransactionHandle 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.
callbackHandleHandle for the node in the callback. This handle was passed in to the IOManager with the beginStartMonitoring method.
statusCodeResult of the finishWrite operation.
allowThreadUseIndicates 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 UaTransactionManager::finishWrite ( OpcUa_UInt32  hTransaction,
OpcUa_UInt32  processedCount,
OpcUa_Boolean  allowThreadUse 
)
virtual

Finished write transaction for IOManager2 nodes.

Parameters
hTransactionHandle for the transaction used by the SDK to identify the transaction in the callbacks. This handle was passed in to the IOManager2 with the beginWrite method.
processedCountNumber of processed items
allowThreadUseIndicates if the calling thread can be used to send the response if this is the callback for the last nodes in the transaction.
Returns
Result code

Implements IOManager2Callback.

UaStatus UaTransactionManager::registerNodes ( const ServiceContext serviceContext,
const UaNodeIdArray &  nodesToRegister,
UaNodeIdArray &  registeredNodesIds 
)
virtual

Register nodes to create handles in the session context.

Parameters
serviceContextGeneral context for the service calls containing information like the session object, return diagnostic mask and timeout hint.
nodesToRegisterthe current used Nodes to register.
registeredNodesIdsthe registered NodeId of the current Node.
Returns
Error code
    Possible check for structural invalid NodeIds - should be handled by stack already
for ( i=0; i<itemCount; i++ )
{

Size checks can be added Schould be handled by stack already if ( nodesToRegister[i].IdentifierType > OpcUa_IdentifierType_Opaque ) { TRACE1_ERROR(UA_MODULE, "<&ndash; UaTransactionManager::registerNodes [ret=OpcUa_BadNodeIdInvalid] - NodeId %u has invalid IdentifierType", i); return OpcUa_BadNodeIdInvalid; } }

UaStatus UaTransactionManager::shutDown ( )

Shut down transaction manager.

Returns
Error code
UaStatus UaTransactionManager::startUp ( )

Start up transaction manager.

Returns
Error code
UaStatus UaTransactionManager::unregisterNodes ( const ServiceContext serviceContext,
const UaNodeIdArray &  registeredNodesIds 
)
virtual

Unregister nodes used as handles in the session context.

Parameters
serviceContextGeneral context for the service calls containing information like the session object, return diagnostic mask and timeout hint.
registeredNodesIdsthe registered NodeId of the current Node.
Returns
Error code

The documentation for this class was generated from the following files: