C++ Based OPC UA Client/Server/PubSub SDK  1.7.6.537
UaDurableSubscriptionCallback Class Referenceabstract

Callback interface for the handling of durable subscriptions storage. More...

#include <uacoreserverapplication.h>

Public Member Functions

 UaDurableSubscriptionCallback ()
 Construction.
 
virtual ~UaDurableSubscriptionCallback ()
 Destruction.
 
virtual OpcUa_UInt32 registerDurableDataItem (const UaNodeId nodeId, OpcUa_UInt32 subscriptionId, OpcUa_Double &samplingInterval, OpcUa_UInt32 &queueSize)=0
 This registration method informs the storage component about the creation of a data monitored item in a durable subscription. More...
 
virtual OpcUa_UInt32 registerDurableEventItem (const UaNodeId nodeId, OpcUa_UInt32 subscriptionId)=0
 This registration method informs the storage component about the creation of an event monitored item in a durable subscription. More...
 
virtual void unregisterDurableItem (OpcUa_UInt32 durableItemHandle)=0
 Unregisters the item from the storage component after the deletion of the monitored item from the durable subscription. More...
 
virtual void activateDurableItem (OpcUa_UInt32 durableItemHandle)=0
 Activates the item in the storage component before storeValue is called. More...
 
virtual void deactivateDurableItem (OpcUa_UInt32 durableItemHandle)=0
 Deactivates the item in the storage component. More...
 
virtual void storeValue (OpcUa_UInt32 durableItemHandle, const UaDataValue &dataValue)=0
 Stores the value at the end of the buffer. More...
 
virtual bool getStoredValues (OpcUa_UInt32 durableItemHandle, OpcUa_UInt32 requestCount, UaDataValueArray &dataValues)=0
 Returns the stored values for the item from the beginning of the buffer. More...
 
virtual void clearStoredValues (OpcUa_UInt32 durableItemHandle, OpcUa_UInt32 clearCount)=0
 Confirms delivery of stored values to the client. More...
 
virtual void storeEvent (OpcUa_UInt32 durableItemHandle, const UaVariantArray &eventFields)=0
 Stores the event at the end of the buffer. More...
 
virtual OpcUa_UInt32 getEventCount (OpcUa_UInt32 durableItemHandle, OpcUa_UInt32 maxNumber)=0
 Get the current event count in the buffer. More...
 
virtual void getEvents (OpcUa_UInt32 durableItemHandle, OpcUa_UInt32 &eventCount, EventFieldsArray &events, bool &bMoreAvailable)=0
 Get Events from the buffer. More...
 

Detailed Description

Callback interface for the handling of durable subscriptions storage.

This callback interface needs to be implemented if the application wants to implement durable subscriptions.

The storage works like list of buffers where each buffer represents a monitored item in a durable subscription. The buffer is only active if the delivery of data changes is not possible to the client.

If a buffer is active, it has a read pointer at the begin of the buffer and a writer pointer at the end of the buffer.

Member Function Documentation

virtual void UaDurableSubscriptionCallback::activateDurableItem ( OpcUa_UInt32  durableItemHandle)
pure virtual

Activates the item in the storage component before storeValue is called.

The activation happens if the durable subscription is no longer able to deliver values or events to the client.

Parameters
[in]durableItemHandleThe handle of the durable monitored item in the storage component.
virtual void UaDurableSubscriptionCallback::clearStoredValues ( OpcUa_UInt32  durableItemHandle,
OpcUa_UInt32  clearCount 
)
pure virtual

Confirms delivery of stored values to the client.

The method is only used if stored values have be partially delivered to the client and delivery has stopped again.

If the method is called, the indicated number of previously fetched stored values can be deleted or can be marked as delivered to the client. The rest of the values returned in getStoredValues must be returned again in the next call to getStoredValues.

Parameters
[in]durableItemHandleThe handle of the durable monitored item in the storage component.
[in]clearCountThe number of values delivered to the client.
virtual void UaDurableSubscriptionCallback::deactivateDurableItem ( OpcUa_UInt32  durableItemHandle)
pure virtual

Deactivates the item in the storage component.

The deactivation happens if the durable subscription has delivered all stored values and events to the client and all new values and events are delivered to the client directly. This allows the storage component to clean-up all previously stored values.

Parameters
[in]durableItemHandleThe handle of the durable monitored item in the storage component.
virtual OpcUa_UInt32 UaDurableSubscriptionCallback::getEventCount ( OpcUa_UInt32  durableItemHandle,
OpcUa_UInt32  maxNumber 
)
pure virtual

Get the current event count in the buffer.

If the number is unknown, the maxNumber passed in is returned if events are available and 0 is returned if no events are available

Parameters
[in]durableItemHandleThe handle of the durable monitored item in the storage component.
[in]maxNumberThe maximum number that can be handled by the caller.
virtual void UaDurableSubscriptionCallback::getEvents ( OpcUa_UInt32  durableItemHandle,
OpcUa_UInt32 &  eventCount,
EventFieldsArray events,
bool &  bMoreAvailable 
)
pure virtual

Get Events from the buffer.

Returns the events from the buffer up to the number defined by eventCount. Returned events can be deleted or can be marked as delivered to the client.

Parameters
[in]durableItemHandleThe handle of the durable monitored item in the storage component.
[in,out]eventCountThe requested and returned count. If the number equals or exeeds the available events, the complete list is returned
[out]eventsThe list of events in the monitored item
[out]bMoreAvailableFlag indicating if there are more events in the buffer
virtual bool UaDurableSubscriptionCallback::getStoredValues ( OpcUa_UInt32  durableItemHandle,
OpcUa_UInt32  requestCount,
UaDataValueArray dataValues 
)
pure virtual

Returns the stored values for the item from the beginning of the buffer.

The method returns the requested number of stored values or the remaining ones if the number of stored values is less than requested.

If the method is called, all previously fetched stored values can be deleted or can be marked as delivered to the client.

Returns
A flag indicating if there are more values. False indicates that all remaining stored values are returned.
Parameters
[in]durableItemHandleThe handle of the durable monitored item in the storage component.
[in]requestCountThe number of values requested from storage.
[out]dataValuesThe stored values in the order they have been received through storeValue.
virtual OpcUa_UInt32 UaDurableSubscriptionCallback::registerDurableDataItem ( const UaNodeId  nodeId,
OpcUa_UInt32  subscriptionId,
OpcUa_Double &  samplingInterval,
OpcUa_UInt32 &  queueSize 
)
pure virtual

This registration method informs the storage component about the creation of a data monitored item in a durable subscription.

The storage stays inactive until the delivery of values to the client is interrupted.

Returns
The handle of the durable data monitored item in the storage component. 0 is invalid and is returned if it is not possible to add more items.
Parameters
[in]nodeIdNodeId of the monitored node
[in]subscriptionIdID of the durable subscription the monitored item was added to
[in,out]samplingIntervalSamplingInterval configured for the monitoring. The sampling interval can be adjusted to a lower rate if the rate is not supported by the storage.
[in,out]queueSizeQueue size configured for the monitored item. The queue size can be adjusted to a lower number if the size is not supported by the storage.
virtual OpcUa_UInt32 UaDurableSubscriptionCallback::registerDurableEventItem ( const UaNodeId  nodeId,
OpcUa_UInt32  subscriptionId 
)
pure virtual

This registration method informs the storage component about the creation of an event monitored item in a durable subscription.

The storage stays inactive until the delivery of events to the client is interrupted.

Returns
The handle of the durable event monitored item in the storage component. 0 is invalid and is returned if it is not possible to add more items.
Parameters
[in]nodeIdNodeId of the monitored node
[in]subscriptionIdID of the durable subscription the monitored item was added to
virtual void UaDurableSubscriptionCallback::storeEvent ( OpcUa_UInt32  durableItemHandle,
const UaVariantArray eventFields 
)
pure virtual

Stores the event at the end of the buffer.

Parameters
[in]durableItemHandleThe handle of the durable monitored item in the storage component.
[in]eventFieldsThe Event (fields of the event) to store.
virtual void UaDurableSubscriptionCallback::storeValue ( OpcUa_UInt32  durableItemHandle,
const UaDataValue dataValue 
)
pure virtual

Stores the value at the end of the buffer.

Parameters
[in]durableItemHandleThe handle of the durable monitored item in the storage component.
[in]dataValueThe DataValue to store.
virtual void UaDurableSubscriptionCallback::unregisterDurableItem ( OpcUa_UInt32  durableItemHandle)
pure virtual

Unregisters the item from the storage component after the deletion of the monitored item from the durable subscription.

Parameters
[in]durableItemHandleThe handle of the durable monitored item in the storage component.

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