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

ServerManager. More...

#include <servermanager.h>

Public Member Functions

 ServerManager ()
 construction. More...
 
virtual ~ServerManager ()
 destruction More...
 
UaStatus startUp (ServerConfig *pServerConfig)
 Start up server manager. More...
 
UaStatus shutDown ()
 Shut down server manager. More...
 
ServerConfiggetServerConfig ()
 Returns the server configuration object. More...
 
NodeManagergetNodeManagerRoot ()
 Returns the root node manager object. More...
 
NodeManagergetNodeManagerNS1 ()
 Returns the node manager object responsible for namespace index 1 nodes. More...
 
SessionManagergetSessionManager ()
 Returns the OPC UA Session manager object. More...
 
OpcUa::HistoryServerCapabilitiesType * getHistoryServerCapabilities ()
 Returns the OPC UA HistoryServerCapabilities object. More...
 
UaThreadPoolgetThreadPool ()
 Returns the thread pool of the server core module. More...
 
void registerDynamicEventManager (EventManager *pEventManager)
 Inform the server manager about a new event manager added after server start up. More...
 
OpcUa_UInt32 startServerShutDown (OpcUa_Int32 secondsTillShutdown, const UaLocalizedText &shutdownReason)
 Inform the server manager about the shutdown of the server. More...
 
OpcUa_UInt32 startServerShutDown (OpcUa_Int32 secondsTillShutdown, const UaLocalizedTextArray &shutdownReason)
 Inform the server manager about the shutdown of the server. More...
 
void changeServerState (OpcUa_ServerState newState)
 Change the server state represented in the address space. More...
 
void changeServiceLevel (OpcUa_Byte serviceLevel, OpcUa_Byte changeMask)
 Update the ServiceLevel property of the Server object. More...
 
SessioncreateInternalSession (const UaString &sessionName, const UaString &localeId, UaUserIdentityToken *pUserIdentityToken)
 Creates an internal session. More...
 
UaStatus browse (const UaNodeId &startingNode, const UaNodeId &referenceTypeFilter, ContinuationPointWrapper &continuationPoint, UaReferenceDescriptions &references)
 Browse function for internal use for forward browsing. More...
 
UaStatus browse (const UaNodeId &startingNode, OpcUa_Boolean isInverse, const UaNodeId &referenceTypeFilter, OpcUa_UInt32 nodeClassMask, ContinuationPointWrapper &continuationPoint, UaReferenceDescriptions &references)
 Browse function for internal use. More...
 
UaStatus browse (Session *pSession, const UaNodeId &startingNode, OpcUa_Boolean isInverse, const UaNodeId &referenceTypeFilter, OpcUa_UInt32 nodeClassMask, ContinuationPointWrapper &continuationPoint, UaReferenceDescriptions &references)
 Browse function for internal use. More...
 
UaStatus read (Session *pSession, OpcUa_Double maxAge, const UaReadValueIds &nodesToRead, UaDataValues &results)
 Read function for internal use. More...
 
UaStatus read (Session *pSession, OpcUa_Double maxAge, const PVariableHandleArray &variableHandles, const UaReadValueIds &nodesToRead, UaDataValues &results)
 Read function for internal use. More...
 
UaStatus write (Session *pSession, const UaWriteValues &nodesToWrite, UaStatusCodeArray &results)
 Write function for internal use. More...
 
UaStatus write (Session *pSession, const PVariableHandleArray &variableHandles, const UaWriteValues &nodesToWrite, UaStatusCodeArray &results)
 Write function for internal use. More...
 
UaStatus call (Session *pSession, const UaNodeId &objectId, const UaNodeId &methodId, const UaVariantArray &inputArguments, UaStatusCodeArray &inputArgumentResults, UaVariantArray &outputArguments)
 Internal function to call a method. More...
 
UaStatus createDataMonitoredItems (Session *pSession, DataMonitoredItemSpecArray &dataMonitoredItems)
 Internal function to create a list of data monitored items. More...
 
UaStatus createEventMonitoredItem (Session *pSession, const UaNodeId &objectToMonitor, EventCallback *pEventCallback, OpcUa_EventFilter *pEventFilter, OpcUa_UInt32 &monitoredItemId)
 Internal function to create an event monitored item. More...
 
void setEventManagerInvalid (OpcUa_UInt32 monitoredItemId, OpcUa_UInt32 eventManagerIndex)
 Internal function to inform the event monitored item about an invalidated EventManager. More...
 
UaStatus conditionRefresh (Session *pSession, OpcUa_UInt32 monitoredItemId)
 Internal function to request a condition refresh for the event monitored item. More...
 
UaStatus deleteMonitoredItems (Session *pSession, const UaUInt32Array &monitoredItemIds, UaStatusCodeArray &results)
 Internal function to delete a list of monitored items. More...
 

Protected Member Functions

virtual SessionManagercreateSessionManager ()
 This function creates the SessionManager. More...
 
virtual NodeManagercreateNodeManagerNS1 (const UaString &sServerUri)
 This function creates the NodeManagerNS1. More...
 

Detailed Description

ServerManager.

OPC Server Manager Interface. The ServerManager is needed to start everything up and get all name spaces.

Constructor & Destructor Documentation

ServerManager::ServerManager ( )

construction.

ServerManager::~ServerManager ( )
virtual

destruction

destruction.

Member Function Documentation

UaStatus ServerManager::browse ( const UaNodeId startingNode,
const UaNodeId referenceTypeFilter,
ContinuationPointWrapper continuationPoint,
UaReferenceDescriptions &  references 
)

Browse function for internal use for forward browsing.

This method provides a simplified browse function for internal use. It uses the normal NodeManager::browse but hides the handling that is necessary for the remote access from a client.

This version of the simplified browse is browsing forward and returns all node classes.

Returns
Status result code for the call.
Parameters
[in]startingNodeStarting node for the browse call
[in]referenceTypeFilterReference type filter to return only nodes referenced from the starting node with this reference type or a subtype
[in,out]continuationPointContinuation point for the browse. Indicates if more results are available
[out]referencesList of browse results for the browsed node
UaStatus ServerManager::browse ( const UaNodeId startingNode,
OpcUa_Boolean  isInverse,
const UaNodeId referenceTypeFilter,
OpcUa_UInt32  nodeClassMask,
ContinuationPointWrapper continuationPoint,
UaReferenceDescriptions &  references 
)

Browse function for internal use.

This method provides a simplified browse function for internal use. It uses the normal NodeManager::browse but hides the handling that is necessary for the remote access from a client.

Returns
Status result code for the call.
Parameters
[in]startingNodeStarting node for the browse call
[in]isInverseFlag indicating if the browse is inverse (True) or forward (False)
[in]referenceTypeFilterReference type filter to return only nodes referenced from the starting node with this reference type or a subtype
[in]nodeClassMaskNode class filter mask identifing the node classes to include in the browse result Bit mask containing the following options:
OpcUa_NodeClass_Object = 1
OpcUa_NodeClass_Variable = 2
OpcUa_NodeClass_Method = 4
OpcUa_NodeClass_ObjectType = 8
OpcUa_NodeClass_VariableType = 16
OpcUa_NodeClass_ReferenceType = 32
OpcUa_NodeClass_DataType = 64
OpcUa_NodeClass_View = 128
If set to zero, all node classes are returned.
[in,out]continuationPointContinuation point for the browse. Indicates if more results are available
[out]referencesList of browse results for the browsed node
UaStatus ServerManager::browse ( Session pSession,
const UaNodeId startingNode,
OpcUa_Boolean  isInverse,
const UaNodeId referenceTypeFilter,
OpcUa_UInt32  nodeClassMask,
ContinuationPointWrapper continuationPoint,
UaReferenceDescriptions &  references 
)

Browse function for internal use.

This method provides a simplified browse function for internal use. It uses the normal NodeManager::browse but hides the handling that is necessary for the remote access from a client.

Returns
Status result code for the call.
Parameters
[in]pSessionSession context for the browse call
[in]startingNodeStarting node for the browse call
[in]isInverseFlag indicating if the browse is inverse (True) or forward (False)
[in]referenceTypeFilterReference type filter to return only nodes referenced from the starting node with this reference type or a subtype
[in]nodeClassMaskNode class filter mask identifing the node classes to include in the browse result Bit mask containing the following options:
OpcUa_NodeClass_Object = 1
OpcUa_NodeClass_Variable = 2
OpcUa_NodeClass_Method = 4
OpcUa_NodeClass_ObjectType = 8
OpcUa_NodeClass_VariableType = 16
OpcUa_NodeClass_ReferenceType = 32
OpcUa_NodeClass_DataType = 64
OpcUa_NodeClass_View = 128
If set to zero, all node classes are returned.
[in,out]continuationPointContinuation point for the browse. Indicates if more results are available
[out]referencesList of browse results for the browsed node
UaStatus ServerManager::call ( Session pSession,
const UaNodeId objectId,
const UaNodeId methodId,
const UaVariantArray &  inputArguments,
UaStatusCodeArray &  inputArgumentResults,
UaVariantArray &  outputArguments 
)

Internal function to call a method.

Returns
Status result code for the call.
Parameters
[in]pSessionSession context for the function call
[in]objectIdObject node for the call
[in]methodIdMethod node for the call
[in]inputArgumentsArray of input arguments
[out]inputArgumentResultsArray of input argument results
[out]outputArgumentsArray of output argumens
void ServerManager::changeServerState ( OpcUa_ServerState  newState)

Change the server state represented in the address space.

This method allows the application to change the server state if the state is not longer running or to change the stat back to running after an error situation.

Parameters
[in]newStateNew server status
void ServerManager::changeServiceLevel ( OpcUa_Byte  serviceLevel,
OpcUa_Byte  changeMask 
)

Update the ServiceLevel property of the Server object.

Parameters
serviceLevelThe new service level to set.
changeMaskA mask indicating which bits of the service level should be set. If a bit is set to 1, the according bit of serviceLevel is set in the server's serviceLevel. If a bit is set to 0, the according bit in the server's serviceLevel will remain untouched.
UaStatus ServerManager::conditionRefresh ( Session pSession,
OpcUa_UInt32  monitoredItemId 
)

Internal function to request a condition refresh for the event monitored item.

Returns
Status result code for the call.
Parameters
[in]pSessionSession context for the function call
[in]monitoredItemIdId of the affected monitored item
UaStatus ServerManager::createDataMonitoredItems ( Session pSession,
DataMonitoredItemSpecArray dataMonitoredItems 
)

Internal function to create a list of data monitored items.

Returns
Status result code for the call.
Parameters
[in]pSessionSession context for the function call
[in,out]dataMonitoredItemsArray of DataMonitoredItemSpec objects containing the information for the creation in a data monitored item.
UaStatus ServerManager::createEventMonitoredItem ( Session pSession,
const UaNodeId objectToMonitor,
EventCallback pEventCallback,
OpcUa_EventFilter *  pEventFilter,
OpcUa_UInt32 &  monitoredItemId 
)

Internal function to create an event monitored item.

Returns
Status result code for the call.
Parameters
[in]pSessionSession context for the function call
[in]objectToMonitorObject node used as event notifier
[in]pEventCallbackEvent callback interface for the event monitored item
[in]pEventFilterEvent filter for the monitored item
[out]monitoredItemIdId of the created monitored item
Session * ServerManager::createInternalSession ( const UaString sessionName,
const UaString localeId,
UaUserIdentityToken pUserIdentityToken 
)

Creates an internal session.

The Session is a reference counted object. The caller must release the reference it gets by creating the session if the session is not longer needed.

Returns
The new session. NULL if creation fails. The caller is responsible for releasing the Session if it is not longer needed.
Parameters
[in]sessionNameName of the session. This is mainly used in the session diagnostics
[in]localeIdLocale used for the session
[in]pUserIdentityTokenUser identity used for the session. NULL for anonymous.
NodeManager * ServerManager::createNodeManagerNS1 ( const UaString sServerUri)
protectedvirtual

This function creates the NodeManagerNS1.

The virtual function can be overwritten by a derived class to create a class derived from NodeManagerNS1 instead of NodeManagerNS1 An instance of a derived class of ServerManager can be passed to CoreModule::initialize() to force the CoreModule to use this instance instead of creating a ServerManager

SessionManager * ServerManager::createSessionManager ( )
protectedvirtual

This function creates the SessionManager.

The virtual function can be overwritten by a derived class to create a class derived from SessionManager instead of SessionManager. An instance of a derived class of ServerManager can be passed to CoreModule::initialize() to force the CoreModule to use this instance instead of creating a ServerManager

UaStatus ServerManager::deleteMonitoredItems ( Session pSession,
const UaUInt32Array &  monitoredItemIds,
UaStatusCodeArray &  results 
)

Internal function to delete a list of monitored items.

Returns
Status result code for the call.
Parameters
[in]pSessionSession context for the function call
[in]monitoredItemIdsArray of Ids of the monitored items to delete
[out]resultsResult array for the monitored items to delete
OpcUa::HistoryServerCapabilitiesType * ServerManager::getHistoryServerCapabilities ( )

Returns the OPC UA HistoryServerCapabilities object.

The object is used to indicate the supported historical access features. The object will be created if it does not exist.

Returns
OPC UA HistoryServerCapabilities object.
NodeManager * ServerManager::getNodeManagerNS1 ( )

Returns the node manager object responsible for namespace index 1 nodes.

Returns
Namespace index 1 node manager object.
NodeManager * ServerManager::getNodeManagerRoot ( )

Returns the root node manager object.

Returns
Root node manager object.
ServerConfig * ServerManager::getServerConfig ( )

Returns the server configuration object.

Returns
Server configuration object.
SessionManager * ServerManager::getSessionManager ( )

Returns the OPC UA Session manager object.

Returns
OPC UA Session manager object.
UaThreadPool * ServerManager::getThreadPool ( )

Returns the thread pool of the server core module.

Returns
Thread pool of the server core module.
UaStatus ServerManager::read ( Session pSession,
OpcUa_Double  maxAge,
const UaReadValueIds &  nodesToRead,
UaDataValues &  results 
)

Read function for internal use.

Returns
Status result code for the call.
Parameters
[in]pSessionSession context for the function call
[in]maxAgeThe maximum age of a cached value that can be returned to the caller
[in]nodesToReadArray of nodes and attributes to read
[out]resultsArray of read results
UaStatus ServerManager::read ( Session pSession,
OpcUa_Double  maxAge,
const PVariableHandleArray variableHandles,
const UaReadValueIds &  nodesToRead,
UaDataValues &  results 
)

Read function for internal use.

Returns
Status result code for the call.
Parameters
[in]pSessionSession context for the function call
[in]maxAgeThe maximum age of a cached value that can be returned to the caller
[in]variableHandlesArray of variable handles indicating the node and attribute to read
[in]nodesToReadArray of nodes and attributes to read
[out]resultsArray of read results
void ServerManager::registerDynamicEventManager ( EventManager pEventManager)

Inform the server manager about a new event manager added after server start up.

EventManagers can be responsible for information requests from clients even if they are created after the client initiated the request. This happes especially if a client is interested in all events from the server and a new event manager is added. This method allows an EventManager to get informed about already created event subscriptions.

Parameters
[in]pEventManagerNew and dynamically added EventManager
void ServerManager::setEventManagerInvalid ( OpcUa_UInt32  monitoredItemId,
OpcUa_UInt32  eventManagerIndex 
)

Internal function to inform the event monitored item about an invalidated EventManager.

This information is provided through the EventCallback interface

Parameters
[in]monitoredItemIdId of the affected monitored item
[in]eventManagerIndexIndex of the invalid EventManager
UaStatus ServerManager::shutDown ( )

Shut down server manager.

Returns
Error code
OpcUa_UInt32 ServerManager::startServerShutDown ( OpcUa_Int32  secondsTillShutdown,
const UaLocalizedText shutdownReason 
)

Inform the server manager about the shutdown of the server.

Returns
Number of active client connections.
Parameters
[in]secondsTillShutdownSeconds till shutdown of the server
[in]shutdownReasonReason for the shutdown
OpcUa_UInt32 ServerManager::startServerShutDown ( OpcUa_Int32  secondsTillShutdown,
const UaLocalizedTextArray &  shutdownReason 
)

Inform the server manager about the shutdown of the server.

This is an overload to provide the shutdown reason as a list of localized text in different languages

Returns
Number of active client connections.
Parameters
[in]secondsTillShutdownSeconds till shutdown of the server
[in]shutdownReasonReason for the shutdown in different languages
UaStatus ServerManager::startUp ( ServerConfig pServerConfig)

Start up server manager.

Parameters
pServerConfigServer configuration object.
Returns
Error code
UaStatus ServerManager::write ( Session pSession,
const UaWriteValues &  nodesToWrite,
UaStatusCodeArray &  results 
)

Write function for internal use.

Returns
Status result code for the call.
Parameters
[in]pSessionSession context for the function call
[in]nodesToWriteArray of nodes, attributes and values to write
[out]resultsArray of write results
UaStatus ServerManager::write ( Session pSession,
const PVariableHandleArray variableHandles,
const UaWriteValues &  nodesToWrite,
UaStatusCodeArray &  results 
)

Write function for internal use.

Returns
Status result code for the call.
Parameters
[in]pSessionSession context for the function call
[in]variableHandlesArray of variable handles indicating the node and attribute to write
[in]nodesToWriteArray of nodes, attributes and values to write
[out]resultsArray of write results

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