C++ Based OPC UA Client/Server/PubSub SDK  1.7.6.537
PubSubManager Class Reference

Management class for server SDK OPC UA publish subscriber module. More...

#include <pubsubmanager.h>

Inherits UaServerApplicationModule.

Public Member Functions

 PubSubManager (bool stackActive=true)
 Creates an instance of the PubSubManager. More...
 
virtual ~PubSubManager ()
 Destroys the PubSubManager object.
 
UaStatus setPubSubConfig (const UaString &configurationFile, const UaString &sConfigPath)
 Sets the PubSub configuration file name and location. More...
 
UaStatus setPubSubConfig (PubSubBase::PubSubConfiguration *pPubSubConfiguration)
 Sets the PubSub configuration as configuration object. More...
 
UaStatus getPubSubConfig (PubSubBase::PubSubConfiguration *pPubSubConfiguration)
 Returns the PubSub configuration as configuration object.
 
UaStatus startUp (ServerManager *pServerManager)
 Start up PubSubManager application module. More...
 
UaStatus shutDown ()
 Shut down PubSubManager application module. More...
 
UaStatus reloadPubSubConfig ()
 Loads the PubSub configuration from the configuration file and starts the PubSub module with this configuration.
 
void setPubSubServerApplicationCallback (PubSubServerApplicationCallback *pCallback)
 Set PubSubServerApplicationCallback for the PubSub module. More...
 
void setConfigurationPermissions (NodeAccessInfo *pDefaultPermissions)
 Set configuration permissions for the PubSub configuration model. More...
 
void setPubSubNetworkBackendUser (PubSubBase::PubSubNetworkBackendInterface *pNetworkBackendUser)
 Set PubSubNetworkBackendInterfaceTypeUser for the PubSub module. More...
 
void setPubSubDataSetCollectorCallback (PubSubDataSetCollectorCallback *pCallback)
 Set PubSubDataSetCollectorCallback for the PubSub module. More...
 
void setPubSubDataSetDispatcherCallback (PubSubDataSetDispatcherCallback *pCallback)
 Set PubSubDataSetDispatcherCallback for the PubSub module. More...
 

Detailed Description

Management class for server SDK OPC UA publish subscriber module.

Constructor & Destructor Documentation

PubSubManager::PubSubManager ( bool  stackActive = true)

Creates an instance of the PubSubManager.

Parameters
[in]stackActiveFlag indicating if the PubSub communication stack should be active. The default is true.

Member Function Documentation

void PubSubManager::setConfigurationPermissions ( NodeAccessInfo pDefaultPermissions)

Set configuration permissions for the PubSub configuration model.

The default permissions are to observer rights (Browse, Read) for the roles AuthenticatesUser and Anonymous and to operator rights (Browse, Read, Call) for the role ConfigureAdmin.

The following sample code shows how to set the PubSub configuration model to read-only.

NodeAccessInfoBase* pNodeAccessInfoBase = new NodeAccessInfoBase;
RoleTypeOperations* pRoleTypeOperations = NULL;
UaString sRoleName;
UaString sRoleNameNamespaceUri;
if (pServerManager->getRoleByName(OpcUa_BrowseName_WellKnownRole_AuthenticatedUser, sRoleNameNamespaceUri, &pRoleTypeOperations).isGood())
{
pNodeAccessInfoBase->setRolePermissions(pRoleTypeOperations->getRoleId(), NodeAccessInfo::PERMISSION_OBSERVATION);
}
if (pServerManager->getRoleByName(OpcUa_BrowseName_WellKnownRole_Anonymous, sRoleNameNamespaceUri, &pRoleTypeOperations).isGood())
{
pNodeAccessInfoBase->setRolePermissions(pRoleTypeOperations->getRoleId(), NodeAccessInfo::PERMISSION_OBSERVATION);
}
pPubSubManager->setConfigurationPermissions(pNodeAccessInfoBase);
Parameters
[in]pDefaultPermissionsPermission settings
UaStatus PubSubManager::setPubSubConfig ( const UaString configurationFile,
const UaString sConfigPath 
)

Sets the PubSub configuration file name and location.

If there is already a configuration active, the new configuration will be loaded.

Parameters
[in]configurationFileName of the configuration file
[in]sConfigPathPath to the configuration file
UaStatus PubSubManager::setPubSubConfig ( PubSubBase::PubSubConfiguration pPubSubConfiguration)

Sets the PubSub configuration as configuration object.

If there is already a configuration active, the new configuration will be loaded.

void PubSubManager::setPubSubDataSetCollectorCallback ( PubSubDataSetCollectorCallback pCallback)

Set PubSubDataSetCollectorCallback for the PubSub module.

A DataSet collector subscribes for variable value changes, manages the latest value in a queue per DataSet field and creates the DataSetMessage sent by a DataSetWriter.

The default implementation of the DataSet collector uses the internal client functionality to create monitored items. The PubSubDataSetCollectorCallback provides a simplified direct access to the monitoring.

Parameters
[in]pCallbackCallback interface for DataSet collectors
void PubSubManager::setPubSubDataSetDispatcherCallback ( PubSubDataSetDispatcherCallback pCallback)

Set PubSubDataSetDispatcherCallback for the PubSub module.

A DataSet dispatcher decodes the received DataSetMessages, manages the latest value in a queue per DataSet field and writes received values to related variable values.

The default implementation of the DataSet dispatcher uses the internal client functionality to write the values. The PubSubDataSetDispatcherCallback provides a simplified direct access to the queues to process the data instead of the write operation.

Parameters
[in]pCallbackCallback interface for DataSet dispatchers
void PubSubManager::setPubSubNetworkBackendUser ( PubSubBase::PubSubNetworkBackendInterface pNetworkBackendUser)

Set PubSubNetworkBackendInterfaceTypeUser for the PubSub module.

Parameters
[in]pNetworkBackendUserInterface to a network backed
void PubSubManager::setPubSubServerApplicationCallback ( PubSubServerApplicationCallback pCallback)

Set PubSubServerApplicationCallback for the PubSub module.

Parameters
[in]pCallbackCallback interface of server application for PubSub module
UaStatus PubSubManager::shutDown ( )
virtual

Shut down PubSubManager application module.

This method is called by the SDK during server shut-down as part of the shut-down of the registered modules. This method should not be called by the OPC UA server application.

Implements UaServerApplicationModule.

UaStatus PubSubManager::startUp ( ServerManager pServerManager)
virtual

Start up PubSubManager application module.

This method is called by the SDK during server start-up as part of the start-up of the registered modules. This method should not be called by the OPC UA server application.

Parameters
[in]pServerManagerServerManager interface

Implements UaServerApplicationModule.


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