C++ Based OPC UA Client/Server SDK  1.5.3.346
HistoryManager Class Referenceabstract

Interface definition of the HistoryManager used for reading, updating and deletion of data and event history. More...

#include <historymanager.h>

Inherited by HistoryManagerBase.

Public Types

enum  TransactionType {
  TransactionReadEvents, TransactionReadRaw, TransactionReadModified, TransactionReadProcessed,
  TransactionReadAtTime, TransactionUpdateData, TransactionUpdateStructureData, TransactionUpdateEvents,
  TransactionDeleteData, TransactionDeleteAtTime, TransactionDeleteEvents
}
 TransactionType enumeration. More...
 

Public Member Functions

 HistoryManager ()
 construction
 
virtual ~HistoryManager ()
 destruction
 
virtual UaStatus beginHistoryTransaction (HistoryManagerCallback *pCallback, const ServiceContext &serviceContext, OpcUa_UInt32 hTransaction, OpcUa_UInt32 totalItemCountHint, TransactionType transactionType, OpcUa_TimestampsToReturn timestampsToReturn, OpcUa_Handle &hHistoryManagerContext)=0
 Begins a transaction for historical access. More...
 
virtual UaStatus beginReadEvents (OpcUa_Handle hHistoryManagerContext, OpcUa_UInt32 callbackHandle, HistoryVariableHandle *pVariableHandle, HistoryReadCPUserDataBase *pContinuationPoint, OpcUa_UInt32 numValuesPerNode, OpcUa_DateTime &startTime, OpcUa_DateTime &endTime, const OpcUa_EventFilter &filter, OpcUa_HistoryReadValueId *pReadValueId)=0
 Read event history for a node. More...
 
virtual UaStatus beginReadRawModified (OpcUa_Handle hHistoryManagerContext, OpcUa_UInt32 callbackHandle, HistoryVariableHandle *pVariableHandle, HistoryReadCPUserDataBase *pContinuationPoint, OpcUa_Boolean IsReadModified, OpcUa_UInt32 numValuesPerNode, OpcUa_DateTime &startTime, OpcUa_DateTime &endTime, OpcUa_Boolean returnBounds, OpcUa_HistoryReadValueId *pReadValueId)=0
 Read raw or modified history values for a node. More...
 
virtual UaStatus beginReadProcessed (OpcUa_Handle hHistoryManagerContext, OpcUa_UInt32 callbackHandle, HistoryVariableHandle *pVariableHandle, HistoryReadCPUserDataBase *pContinuationPoint, OpcUa_DateTime &startTime, OpcUa_DateTime &endTime, OpcUa_Double processingInterval, const OpcUa_NodeId &aggregateType, OpcUa_AggregateConfiguration aggregateConfiguration, OpcUa_HistoryReadValueId *pReadValueId)=0
 Read processed history values for a node. More...
 
virtual UaStatus beginReadAtTime (OpcUa_Handle hHistoryManagerContext, OpcUa_UInt32 callbackHandle, HistoryVariableHandle *pVariableHandle, HistoryReadCPUserDataBase *pContinuationPoint, const UaDateTimeArray &requestedTimes, OpcUa_Boolean useSimpleBounds, OpcUa_HistoryReadValueId *pReadValueId)=0
 Read history values for a node at specific timestamps. More...
 
virtual UaStatus beginUpdateData (OpcUa_Handle hHistoryManagerContext, OpcUa_UInt32 callbackHandle, HistoryVariableHandle *pVariableHandle, OpcUa_PerformUpdateType performInsertReplace, OpcUa_Boolean isStructureUpdate, const UaDataValues &updateValue)=0
 Update history values for a node. More...
 
virtual UaStatus beginUpdateEvents (OpcUa_Handle hHistoryManagerContext, OpcUa_UInt32 callbackHandle, HistoryVariableHandle *pVariableHandle, OpcUa_PerformUpdateType performInsertReplace, const OpcUa_EventFilter &filter, const UaHistoryEventFieldLists &eventData)=0
 Update history event for a node. More...
 
virtual UaStatus beginDeleteRawModified (OpcUa_Handle hHistoryManagerContext, OpcUa_UInt32 callbackHandle, HistoryVariableHandle *pVariableHandle, OpcUa_Boolean isDeleteModified, OpcUa_DateTime &startTime, OpcUa_DateTime &endTime)=0
 Delete raw or modified history values for a node. More...
 
virtual UaStatus beginDeleteAtTime (OpcUa_Handle hHistoryManagerContext, OpcUa_UInt32 callbackHandle, HistoryVariableHandle *pVariableHandle, const UaDateTimeArray &requestedTimes)=0
 Delete history values at given times. More...
 
virtual UaStatus beginDeleteEvents (OpcUa_Handle hHistoryManagerContext, OpcUa_UInt32 callbackHandle, HistoryVariableHandle *pVariableHandle, const UaByteStringArray &eventIds)=0
 Delete events for a node. More...
 
virtual UaStatus finishHistoryTransaction (OpcUa_Handle hHistoryManagerContext)=0
 Finishes the transaction for historical access. More...
 
virtual UaStatus cancelHistoryTransaction (OpcUa_Handle hHistoryManagerContext)
 Canceles the transaction for historical access. More...
 

Detailed Description

Interface definition of the HistoryManager used for reading, updating and deletion of data and event history.

The HistoryManager interface provides the reading, updating and deletion capabilities for data and event history. The HistoryManager interface is asynchronous. For the HistoryManager callback the HistoryManagerCallback interface is implemented by the consumer of the history data or events. One of the consumers is the UA Module. This interface is used by the SDK to multiplex the list of nodes in the UA service call to different HistoryManagers. One UA service call is a transaction for the SDK. If an HistoryManager is used in a transaction, the beginHistoryTransaction method is called by the SDK. This allows the HistoryManagers to create a context for the transactions since the SDK will call the associated begin method (e.g. beginReadRawModified) for each node in the transaction. Depending on the underlying system, the action can be started for each node in the begin method or for a list of nodes in the finishHistoryTransaction method. If the underlying system allows optimizing access for a list of nodes, the finishHistoryTransaction method should be used to start the access to the underlying system. This method is called by the SDK after calling the begin methods for all nodes in the transaction.

Member Function Documentation

virtual UaStatus HistoryManager::beginDeleteAtTime ( OpcUa_Handle  hHistoryManagerContext,
OpcUa_UInt32  callbackHandle,
HistoryVariableHandle pVariableHandle,
const UaDateTimeArray requestedTimes 
)
pure virtual

Delete history values at given times.

Parameters
hHistoryManagerContextHandle provided by the HistoryManager in beginHistoryTransaction used to identify the transaction context for this call.
callbackHandleHandle for the variable in the callback.
pVariableHandleVariable handle provided by the NodeManager::getHistoryVariableHandle. This object contains the information needed by the HistoryManager to identify the variable to delete in its context. The object is reference counted. The reference used by the SDK is released after finishHistoryTransaction is called. If the HistoryManager needs the VariableHandle of asynchronous handling, the HistoryManager must add its own reference as long as the VariableHandle is used.
requestedTimesThe list of timestamps to delete.
Returns
Result code of the method call

Implemented in HistoryManagerBase.

virtual UaStatus HistoryManager::beginDeleteEvents ( OpcUa_Handle  hHistoryManagerContext,
OpcUa_UInt32  callbackHandle,
HistoryVariableHandle pVariableHandle,
const UaByteStringArray eventIds 
)
pure virtual

Delete events for a node.

Parameters
hHistoryManagerContextHandle provided by the HistoryManager in beginHistoryTransaction used to identify the transaction context for this call.
callbackHandleHandle for the variable in the callback.
pVariableHandleVariable handle provided by the NodeManager::getVariableHandle. This object contains the information needed by the HistoryManager to identify the node to read in its context. The object is reference counted. The reference used by the SDK is released after finishHistoryTransaction is called. If the HistoryManager needs the VariableHandle of asynchronous handling, the HistoryManager must add its own reference as long as the VariableHandle is used.
eventIdsThe list of EventIds for the events to delete.
Returns
Result code of the method call

Implemented in HistoryManagerBase.

virtual UaStatus HistoryManager::beginDeleteRawModified ( OpcUa_Handle  hHistoryManagerContext,
OpcUa_UInt32  callbackHandle,
HistoryVariableHandle pVariableHandle,
OpcUa_Boolean  isDeleteModified,
OpcUa_DateTime startTime,
OpcUa_DateTime endTime 
)
pure virtual

Delete raw or modified history values for a node.

Parameters
hHistoryManagerContextHandle provided by the HistoryManager in beginHistoryTransaction used to identify the transaction context for this call.
callbackHandleHandle for the variable in the callback.
pVariableHandleVariable handle provided by the NodeManager::getHistoryVariableHandle. This object contains the information needed by the HistoryManager to identify the variable to delete in its context. The object is reference counted. The reference used by the SDK is released after finishHistoryTransaction is called. If the HistoryManager needs the VariableHandle of asynchronous handling, the HistoryManager must add its own reference as long as the VariableHandle is used.
isDeleteModifiedA flag that indicates if modified values should be deleted instead of raw value.
startTimeThe start time of the time period to delete.
endTimeThe end time of the time period to delete.
Returns
Result code of the method call

Implemented in HistoryManagerBase.

virtual UaStatus HistoryManager::beginHistoryTransaction ( HistoryManagerCallback pCallback,
const ServiceContext serviceContext,
OpcUa_UInt32  hTransaction,
OpcUa_UInt32  totalItemCountHint,
TransactionType  transactionType,
OpcUa_TimestampsToReturn  timestampsToReturn,
OpcUa_Handle &  hHistoryManagerContext 
)
pure virtual

Begins a transaction for historical access.

Parameters
pCallbackCallback interface used for the transaction. The HistoryManager must use this interface to finish the action for each passed variable in the transaction. The callback interface pointer is valid until the transaction is completely finished.
serviceContextGeneral context for the service calls containing information like the session object, return diagnostic mask and timeout hint.
hTransactionHandle for the transaction used by the SDK to identify the transaction in the callbacks. The HistoryManager must store this handle and use it in callbacks to HistoryManagerCallback
totalItemCountHintA hint for the HistoryManager about the total number of variables in the transaction. The HistoryManager may not be responsible for all variables but he can use this hint if he wants to optimize memory allocation for further processing.
transactionTypeType of the history transaction.
timestampsToReturnThe client selected timestamp to return. Valid enum values are: OpcUa_TimestampsToReturn_Source, OpcUa_TimestampsToReturn_Server, OpcUa_TimestampsToReturn_Both
hHistoryManagerContextHandle provided by the HistoryManager to identify the transaction in the following begin calls. The handle is managed by the HistoryManager and must be valid until the transaction is completely finished.
Returns
Result code of the method call

Implemented in HistoryManagerBase.

virtual UaStatus HistoryManager::beginReadAtTime ( OpcUa_Handle  hHistoryManagerContext,
OpcUa_UInt32  callbackHandle,
HistoryVariableHandle pVariableHandle,
HistoryReadCPUserDataBase pContinuationPoint,
const UaDateTimeArray requestedTimes,
OpcUa_Boolean  useSimpleBounds,
OpcUa_HistoryReadValueId pReadValueId 
)
pure virtual

Read history values for a node at specific timestamps.

Parameters
hHistoryManagerContextHandle provided by the HistoryManager in beginHistoryTransaction used to identify the transaction context for this call.
callbackHandleHandle for the variable in the callback.
pVariableHandleVariable handle provided by the NodeManager::getHistoryVariableHandle. This object contains the information needed by the HistoryManager to identify the variable to read in its context. The object is reference counted. The reference used by the SDK is released after finishHistoryTransaction is called. If the HistoryManager needs the VariableHandle of asynchronous handling, the HistoryManager must add its own reference as long as the VariableHandle is used.
pContinuationPointThe continuation point data from a previous Read call. Null if first Read. Implementers of this interface can store the continuation point data in a derived class. Implementers of the HistoryManager interface are responsible for deleting the HistoryReadCPUserDataBase object if it is not NULL.
requestedTimesThe requested timestamps to read.
useSimpleBoundsUse SimpleBounds to determine the value at the specific timestamp.
pReadValueIdContext for the node to read. The context contains the IndexRange and the DataEncoding requested by the client. The other parameters of this context are already handled by the HistoryVariableHandle and the SDK.
Returns
Result code of the method call

Implemented in HistoryManagerBase.

virtual UaStatus HistoryManager::beginReadEvents ( OpcUa_Handle  hHistoryManagerContext,
OpcUa_UInt32  callbackHandle,
HistoryVariableHandle pVariableHandle,
HistoryReadCPUserDataBase pContinuationPoint,
OpcUa_UInt32  numValuesPerNode,
OpcUa_DateTime startTime,
OpcUa_DateTime endTime,
const OpcUa_EventFilter filter,
OpcUa_HistoryReadValueId pReadValueId 
)
pure virtual

Read event history for a node.

Parameters
hHistoryManagerContextHandle provided by the HistoryManager in beginHistoryTransaction used to identify the transaction context for this call.
callbackHandleHandle for the variable in the callback.
pVariableHandleVariable handle provided by the NodeManager::getHistoryVariableHandle. This object contains the information needed by the HistoryManager to identify the variable to read in its context. The object is reference counted. The reference used by the SDK is released after finishHistoryTransaction is called. If the HistoryManager needs the VariableHandle of asynchronous handling, the HistoryManager must add its own reference as long as the VariableHandle is used.
pContinuationPointThe continuation point data from a previous Read call. Null if first Read. Implementers of this interface can store the continuation point data in a derived class. Implementers of the HistoryManager interface are responsible for deleting the HistoryReadCPUserDataBase object if it is not NULL.
numValuesPerNodeThe maximum number of values per Node to return.
startTimeThe start time of the time period to read.
endTimeThe end time of the time period to read.
filterAn event filter used to select events to read.
pReadValueIdContext for the node to read. The context contains the IndexRange and the DataEncoding requested by the client. The other parameters of this context are already handled by the HistoryVariableHandle and the SDK.
Returns
Result code of the method call

Implemented in HistoryManagerBase.

virtual UaStatus HistoryManager::beginReadProcessed ( OpcUa_Handle  hHistoryManagerContext,
OpcUa_UInt32  callbackHandle,
HistoryVariableHandle pVariableHandle,
HistoryReadCPUserDataBase pContinuationPoint,
OpcUa_DateTime startTime,
OpcUa_DateTime endTime,
OpcUa_Double  processingInterval,
const OpcUa_NodeId aggregateType,
OpcUa_AggregateConfiguration  aggregateConfiguration,
OpcUa_HistoryReadValueId pReadValueId 
)
pure virtual

Read processed history values for a node.

Parameters
hHistoryManagerContextHandle provided by the HistoryManager in beginHistoryTransaction used to identify the transaction context for this call.
callbackHandleHandle for the variable in the callback.
pVariableHandleVariable handle provided by the NodeManager::getHistoryVariableHandle. This object contains the information needed by the HistoryManager to identify the variable to read in its context. The object is reference counted. The reference used by the SDK is released after finishHistoryTransaction is called. If the HistoryManager needs the VariableHandle of asynchronous handling, the HistoryManager must add its own reference as long as the VariableHandle is used.
pContinuationPointThe continuation point data from a previous Read call. Null if first Read. Implementers of this interface can store the continuation point data in a derived class. Implementers of the HistoryManager interface are responsible for deleting the HistoryReadCPUserDataBase object if it is not NULL.
startTimeThe start time of the time period to read.
endTimeThe end time of the time period to read.
processingIntervalThe interval to re sample.
aggregateTypeThe aggregate type node id.
aggregateConfigurationThe aggregate configuration.
pReadValueIdContext for the node to read. The context contains the IndexRange and the DataEncoding requested by the client. The other parameters of this context are already handled by the HistoryVariableHandle and the SDK.
Returns
Result code of the method call

Implemented in HistoryManagerBase.

virtual UaStatus HistoryManager::beginReadRawModified ( OpcUa_Handle  hHistoryManagerContext,
OpcUa_UInt32  callbackHandle,
HistoryVariableHandle pVariableHandle,
HistoryReadCPUserDataBase pContinuationPoint,
OpcUa_Boolean  IsReadModified,
OpcUa_UInt32  numValuesPerNode,
OpcUa_DateTime startTime,
OpcUa_DateTime endTime,
OpcUa_Boolean  returnBounds,
OpcUa_HistoryReadValueId pReadValueId 
)
pure virtual

Read raw or modified history values for a node.

Parameters
hHistoryManagerContextHandle provided by the HistoryManager in beginHistoryTransaction used to identify the transaction context for this call.
callbackHandleHandle for the variable in the callback.
pVariableHandleVariable handle provided by the NodeManager::getHistoryVariableHandle. This object contains the information needed by the HistoryManager to identify the variable to read in its context. The object is reference counted. The reference used by the SDK is released after finishHistoryTransaction is called. If the HistoryManager needs the VariableHandle of asynchronous handling, the HistoryManager must add its own reference as long as the VariableHandle is used.
pContinuationPointThe continuation point data from a previous Read call. Null if first Read. Implementers of this interface can store the continuation point data in a derived class. Implementers of the HistoryManager interface are responsible for deleting the HistoryReadCPUserDataBase object if it is not NULL.
IsReadModifiedtrue if modified data should be read - false if raw data should be read.
numValuesPerNodeThe maximum number of values per Node to return.
startTimeThe start time of the time period to read.
endTimeThe end time of the time period to read.
returnBoundsFlag that indicates if bounding values should be returned.
pReadValueIdContext for the node to read. The context contains the IndexRange and the DataEncoding requested by the client. The other parameters of this context are already handled by the HistoryVariableHandle and the SDK.
Returns
Result code of the method call

Implemented in HistoryManagerBase.

virtual UaStatus HistoryManager::beginUpdateData ( OpcUa_Handle  hHistoryManagerContext,
OpcUa_UInt32  callbackHandle,
HistoryVariableHandle pVariableHandle,
OpcUa_PerformUpdateType  performInsertReplace,
OpcUa_Boolean  isStructureUpdate,
const UaDataValues updateValue 
)
pure virtual

Update history values for a node.

Parameters
hHistoryManagerContextHandle provided by the HistoryManager in beginHistoryTransaction used to identify the transaction context for this call.
callbackHandleHandle for the variable in the callback.
pVariableHandleVariable handle provided by the NodeManager::getHistoryVariableHandle. This object contains the information needed by the HistoryManager to identify the variable to update in its context. The object is reference counted. The reference used by the SDK is released after finishHistoryTransaction is called. If the HistoryManager needs the VariableHandle of asynchronous handling, the HistoryManager must add its own reference as long as the VariableHandle is used.
performInsertReplaceThe mode to insert data or to replace data.
isStructureUpdateFlag indicating if the provided data is meta data like anotations describing an entry in the history database
updateValueThe data values to update.
Returns
Result code of the method call

Implemented in HistoryManagerBase.

virtual UaStatus HistoryManager::beginUpdateEvents ( OpcUa_Handle  hHistoryManagerContext,
OpcUa_UInt32  callbackHandle,
HistoryVariableHandle pVariableHandle,
OpcUa_PerformUpdateType  performInsertReplace,
const OpcUa_EventFilter filter,
const UaHistoryEventFieldLists eventData 
)
pure virtual

Update history event for a node.

Parameters
hHistoryManagerContextHandle provided by the HistoryManager in beginHistoryTransaction used to identify the transaction context for this call.
callbackHandleHandle for the variable in the callback.
pVariableHandleVariable handle provided by the NodeManager::getHistoryVariableHandle. This object contains the information needed by the HistoryManager to identify the variable to update in its context. The object is reference counted. The reference used by the SDK is released after finishHistoryTransaction is called. If the HistoryManager needs the VariableHandle of asynchronous handling, the HistoryManager must add its own reference as long as the VariableHandle is used.
performInsertReplaceThe mode to insert events or to replace events.
filterAn event filter used to select the event to update.
eventDataA list of event data to update.
Returns
Result code of the method call

Implemented in HistoryManagerBase.

UaStatus HistoryManager::cancelHistoryTransaction ( OpcUa_Handle  hHistoryManagerContext)
virtual

Canceles the transaction for historical access.

Parameters
hHistoryManagerContextHandle provided by the HistoryManager in beginHistoryTransaction used to identify the transaction context for this call.
Returns
Result code of the method call
virtual UaStatus HistoryManager::finishHistoryTransaction ( OpcUa_Handle  hHistoryManagerContext)
pure virtual

Finishes the transaction for historical access.

Parameters
hHistoryManagerContextHandle provided by the HistoryManager in beginHistoryTransaction used to identify the transaction context for this call.
Returns
Result code of the method call

Implemented in HistoryManagerBase.


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