UaSubscriptionManager Class Reference

Implements the UA subscription manager. Derived from UaThread. It is not possible to create plane copies of this class. It is not possible to use the default constructor. More...

#include <uasubscriptionmanager.h>

Inheritance diagram for UaSubscriptionManager:
Collaboration diagram for UaSubscriptionManager:

List of all members.

Public Member Functions

 UaSubscriptionManager (ServerManager *pServerManager)
virtual ~UaSubscriptionManager ()
UaStatus startUp ()
UaStatus shutDown ()
UaStatus createSubscription (UaSession *pSession, OpcUa_Double &publishingInterval, OpcUa_UInt32 &lifetimeCount, OpcUa_UInt32 &maxKeepAliveCount, OpcUa_UInt32 maxNotificationPerPublish, OpcUa_Boolean publishingEnabled, OpcUa_Byte priority, OpcUa_UInt32 &subscriptionId)
UaStatus modifySubscription (UaSession *pSession, OpcUa_UInt32 subscriptionId, OpcUa_Double &publishingInterval, OpcUa_UInt32 &lifetimeCount, OpcUa_UInt32 &maxKeepAliveCount, OpcUa_UInt32 maxNotificationPerPublish, OpcUa_Byte priority)
UaStatus setPublishingMode (UaSession *pSession, OpcUa_UInt32 subscriptionId, OpcUa_Boolean publishingMode)
UaStatus deleteSubscription (UaSession *pSession, OpcUa_UInt32 subscriptionId)
UaStatus transferSubscription (UaSession *pSession, OpcUa_UInt32 subscriptionId, OpcUa_Boolean sendInitialValues, UaUInt32Array &availableSequenceNumbers)
UaStatus beginPublish (UaPublishContext *pUaPublishContext)
UaStatus beginRepublish (UaRepublishContext *pUaRepublishContext)
UaStatus beginCreateMonitoredItems (UaCreateMonitoredItemsContext *pUaCreateMonitoredItemsContext)
UaStatus beginModifyMonitoredItems (UaModifyMonitoredItemsContext *pUaModifyMonitoredItemsContext)
UaStatus beginSetMonitoringMode (UaSetMonitoringModeContext *pUaSetMonitoringModeContext)
UaStatus setTriggering (UaSession *pSession, OpcUa_UInt32 subscriptionId, OpcUa_UInt32 triggeringItemId, const UaUInt32Array &linksToAdd, const UaUInt32Array &linksToRemove, UaStatusCodeArray &addResults, UaStatusCodeArray &removeResults)
UaStatus beginDeleteMonitoredItems (UaDeleteMonitoredItemsContext *pUaDeleteMonitoredItemsContext)
UaStatus beginConditionRefresh (const ServiceContext &serviceContext, OpcUa_UInt32 SubscriptionId)
void run ()
virtual void dynamicEventManagerRegistered (EventManager *pEventManager)
virtual void executeDynamicEventManagerRegistered (EventManager *pEventManager)

Protected Member Functions

virtual UaSubscriptioncreateUaSubscription (UaSession *pSession, ServerManager *pServerManager, OpcUa_Double publishingInterval, OpcUa_UInt32 &lifetimeCount, OpcUa_UInt32 maxKeepAliveCount, OpcUa_UInt32 maxRetransmitionQueueSize, OpcUa_UInt32 maxNotificationPerPublish, OpcUa_Boolean publishingEnabled, OpcUa_Byte priority)
virtual OpcUa_Int32 getNewSubscriptionId ()
virtual void subscriptionCreated (UaSubscription *)
virtual void subscriptionModified (UaSubscription *)
virtual void subscriptionChangedPublishMode (UaSubscription *)
virtual void subscriptionDeleted (UaSubscription *)
void incrementCurrentSubscriptionCount ()
void decrementCurrentSubscriptionCount ()
void incrementCumulatedSubscriptionCount ()
void clearSubscriptions ()
UaSubscriptionfindSubscription (OpcUa_UInt32 integerId)
OpcUa_UInt32 addSubscription (UaSubscription *pSubscription)
void addSubscription (OpcUa_UInt32 subscriptionId, UaSubscription *pSubscription)
void removeSubscription (OpcUa_UInt32 integerId)
OpcUa_UInt32 subscriptionCount ()
UaSubscriptiongetFirstSubscription ()
UaSubscriptiongetNextSubscription ()

Protected Attributes

OpcUa_UInt32 m_lastIntegerId

Detailed Description

Implements the UA subscription manager. Derived from UaThread. It is not possible to create plane copies of this class. It is not possible to use the default constructor.

UaSubscriptionManager


Constructor & Destructor Documentation

UaSubscriptionManager::UaSubscriptionManager ( ServerManager pServerManager )

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
UaSubscriptionManager::~UaSubscriptionManager (  ) [virtual]

destruction


Member Function Documentation

OpcUa_UInt32 UaSubscriptionManager::addSubscription ( UaSubscription pSubscription ) [protected]

Adds Subscriptions and returns the assigned integerId.

Parameters:
pSubscriptionThe subscription to add.
Returns:
The assigned integer id for the added subscription.
void UaSubscriptionManager::addSubscription ( OpcUa_UInt32  subscriptionId,
UaSubscription pSubscription 
) [protected]

Adds Subscriptions with a specified integerId.

Parameters:
subscriptionIdThe subscription id for the subscription to add.
pSubscriptionThe subscription to add.
UaStatus UaSubscriptionManager::beginConditionRefresh ( const ServiceContext serviceContext,
OpcUa_UInt32  subscriptionId 
)

Refresh condition state for the passed subscription.

Parameters:
serviceContextGeneral context for the service calls containing information like the session object, return diagnostic mask and timeout hint.
subscriptionId
UaStatus UaSubscriptionManager::beginCreateMonitoredItems ( UaCreateMonitoredItemsContext pUaCreateMonitoredItemsContext )

Create new monitored items.

Parameters:
pUaCreateMonitoredItemsContextthe context of the items to create.
Returns:
Error code
UaStatus UaSubscriptionManager::beginDeleteMonitoredItems ( UaDeleteMonitoredItemsContext pUaDeleteMonitoredItemsContext )

Delete monitored items.

Parameters:
pUaDeleteMonitoredItemsContextthe context to delete.
Returns:
Error code
UaStatus UaSubscriptionManager::beginModifyMonitoredItems ( UaModifyMonitoredItemsContext pUaModifyMonitoredItemsContext )

Modify monitored items.

Parameters:
pUaModifyMonitoredItemsContextthe context for the monitored items to modify.
Returns:
Error code
UaStatus UaSubscriptionManager::beginPublish ( UaPublishContext pUaPublishContext )

Begin a Publish transaction.

Parameters:
pUaPublishContextthe context of the needed publish transaction.
Returns:
Error code
UaStatus UaSubscriptionManager::beginRepublish ( UaRepublishContext pUaRepublishContext )

Begin a Republish transaction.

Parameters:
pUaRepublishContextthe context of the Republish transaction.
Returns:
Error code
UaStatus UaSubscriptionManager::beginSetMonitoringMode ( UaSetMonitoringModeContext pUaSetMonitoringModeContext )

Set monitoring mode of monitored items.

Parameters:
pUaSetMonitoringModeContextthe context to be set.
Returns:
Error code
void UaSubscriptionManager::clearSubscriptions (  ) [protected]

Clears the management and releases references to the Subscriptions.

UaStatus UaSubscriptionManager::createSubscription ( UaSession pSession,
OpcUa_Double &  publishingInterval,
OpcUa_UInt32 &  lifetimeCount,
OpcUa_UInt32 &  maxKeepAliveCount,
OpcUa_UInt32  maxNotificationPerPublish,
OpcUa_Boolean  publishingEnabled,
OpcUa_Byte  priority,
OpcUa_UInt32 &  subscriptionId 
)

Create a new Subscription.

Parameters:
pSessionInterface to the Session context for the method call
publishingIntervalpublishing interval in milliseconds the server allows
lifetimeCounta count for the the actual lifetime.
maxKeepAliveCountthe maximum of Time to keep the Session alive.
maxNotificationPerPublishthe maximum of notification per Publish.
publishingEnabledindicates if publishing is enabled or not.
prioritythe priority of the operation.
subscriptionIdthe Id of the Subscription.
Returns:
Error code
UaSubscription * UaSubscriptionManager::createUaSubscription ( UaSession pSession,
ServerManager pServerManager,
OpcUa_Double  publishingInterval,
OpcUa_UInt32 &  lifetimeCount,
OpcUa_UInt32  maxKeepAliveCount,
OpcUa_UInt32  maxRetransmitionQueueSize,
OpcUa_UInt32  maxNotificationPerPublish,
OpcUa_Boolean  publishingEnabled,
OpcUa_Byte  priority 
) [protected, virtual]

Creates a new subscription object. This method can be overwritten by a derived class to create a implementation specific derived class of UaSubscription.

Parameters:
pSessionInterface to the Session context for the method call
pServerManagerInterface to the central ServerManager object.
maxRetransmitionQueueSizeMaximum number of messages in the republish queue the server allows per Subscription
publishingIntervalpublishing interval in milliseconds the server allows
lifetimeCounta count for the the actual lifetime.
maxKeepAliveCountthe maximum of Time to keep the Session alive.
publishingEnabled
maxNotificationPerPublishthe maximum of notification per Publish.
prioritythe priority of the operation.
void UaSubscriptionManager::decrementCurrentSubscriptionCount (  ) [protected]

Decrements the current subscription count.

UaStatus UaSubscriptionManager::deleteSubscription ( UaSession pSession,
OpcUa_UInt32  subscriptionId 
)

Delete a Subscription.

Parameters:
pSessionInterface to the Session context for the method call
subscriptionIdthe Id of the Subscription.
Returns:
Error code
void UaSubscriptionManager::dynamicEventManagerRegistered ( EventManager pEventManager ) [virtual]

Callback for new EventManager added to the server.

Parameters:
pEventManager[in] EventManager interface
void UaSubscriptionManager::executeDynamicEventManagerRegistered ( EventManager pEventManager ) [virtual]

Executes the registration of a new EventManager added to the server.

Parameters:
pEventManager[in] EventManager interface
UaSubscription * UaSubscriptionManager::findSubscription ( OpcUa_UInt32  integerId ) [protected]

Find Subscriptions with a specified SubscriptionId.

Parameters:
integerIdthe specified SubscriptionId to find.
Returns:
the found Subscriptions.
UaSubscription * UaSubscriptionManager::getFirstSubscription (  ) [protected]

Get the first available Subscription.

Returns:
the first available Subscription.
OpcUa_Int32 UaSubscriptionManager::getNewSubscriptionId (  ) [protected, virtual]

Returns a new unique subscription id The method can be overwritten by a derived class

UaSubscription * UaSubscriptionManager::getNextSubscription (  ) [protected]

Get the next available Subscription.

Returns:
the next available Subscription.
void UaSubscriptionManager::incrementCumulatedSubscriptionCount (  ) [protected]

Increments the cumulated subscription count.

void UaSubscriptionManager::incrementCurrentSubscriptionCount (  ) [protected]

Increments the current subscription count.

UaStatus UaSubscriptionManager::modifySubscription ( UaSession pSession,
OpcUa_UInt32  subscriptionId,
OpcUa_Double &  publishingInterval,
OpcUa_UInt32 &  lifetimeCount,
OpcUa_UInt32 &  maxKeepAliveCount,
OpcUa_UInt32  maxNotificationPerPublish,
OpcUa_Byte  priority 
)

Modify an existing Subscription.

Parameters:
pSessionInterface to the Session context for the method call
subscriptionIdthe Id of the Subscription.
publishingIntervalpublishing interval in milliseconds the server allows
lifetimeCounta count for the the actual lifetime.
maxKeepAliveCountthe maximum of Time to keep the Session alive.
maxNotificationPerPublishthe maximum of notification per Publish.
prioritythe priority of the operation.
Returns:
Error code
void UaSubscriptionManager::removeSubscription ( OpcUa_UInt32  integerId ) [protected]

Removes Subscriptions with a specified integerId.

Parameters:
integerIdthe area where of the Subscription to remove.
void UaSubscriptionManager::run (  ) [virtual]

Main thread method.

Implements UaThread.

UaStatus UaSubscriptionManager::setPublishingMode ( UaSession pSession,
OpcUa_UInt32  subscriptionId,
OpcUa_Boolean  publishingMode 
)

Set PublishingMode of a Subscription.

Parameters:
pSessionInterface to the Session context for the method call
subscriptionIdthe Id of the Subscription.
publishingModetrue if publishing mode false if not.
Returns:
Error code
UaStatus UaSubscriptionManager::setTriggering ( UaSession pSession,
OpcUa_UInt32  subscriptionId,
OpcUa_UInt32  triggeringItemId,
const UaUInt32Array &  linksToAdd,
const UaUInt32Array &  linksToRemove,
UaStatusCodeArray &  addResults,
UaStatusCodeArray &  removeResults 
)

Set triggering of monitored items.

Parameters:
pSessionInterface to the Session context for the method call
subscriptionIdthe Id of the Subscription.
triggeringItemIdthe Id of the items to set triggering to.
linksToAddthe number of links to add to the monitored item.
linksToRemovethe number of links toremove from the monitored item.
addResultsthe results of this operation.
removeResultsthe results to remove from this operation.
Returns:
Error code
UaStatus UaSubscriptionManager::shutDown (  )

Start up subscription manager.

Returns:
Error code
UaStatus UaSubscriptionManager::startUp (  )

Start up subscription manager.

Returns:
Error code
virtual void UaSubscriptionManager::subscriptionChangedPublishMode ( UaSubscription  ) [inline, protected, virtual]

Event for derived classes indicating that the publish mode of a subscription was changed.

Parameters:
pUaSubscriptionInterface pointer of the changed subscription.
OpcUa_UInt32 UaSubscriptionManager::subscriptionCount (  ) [protected]

Counts all available Subscriptions.

Returns:
the counted number of all Subscriptions.
virtual void UaSubscriptionManager::subscriptionCreated ( UaSubscription  ) [inline, protected, virtual]

Event for derived classes indicating that a new subscription was created.

Parameters:
pUaSubscriptionInterface pointer of the new subscription.
virtual void UaSubscriptionManager::subscriptionDeleted ( UaSubscription  ) [inline, protected, virtual]

Event for derived classes indicating that a subscription was deleted.

Parameters:
pUaSubscriptionInterface pointer of the deleted subscription.
virtual void UaSubscriptionManager::subscriptionModified ( UaSubscription  ) [inline, protected, virtual]

Event for derived classes indicating that a subscription was modified.

Parameters:
pUaSubscriptionInterface pointer of the modified subscription.
UaStatus UaSubscriptionManager::transferSubscription ( UaSession pSession,
OpcUa_UInt32  subscriptionId,
OpcUa_Boolean  sendInitialValues,
UaUInt32Array &  availableSequenceNumbers 
)

Transfer a Subscription.


Member Data Documentation

OpcUa_UInt32 UaSubscriptionManager::m_lastIntegerId [protected]

Last used integer ID for subscriptions


The documentation for this class was generated from the following files:
  • /home/buildbot/work/uasdkcpp/src/uaserver/uaservercpp/uamodule/uasubscriptionmanager.h
  • /home/buildbot/work/uasdkcpp/src/uaserver/uaservercpp/uamodule/uasubscriptionmanager.cpp