UA Server SDK C++ Bundle
1.4.1.271
|
#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... | |
ServerConfig * | getServerConfig () |
Returns the server configuration object. More... | |
NodeManager * | getNodeManagerRoot () |
Returns the root node manager object. More... | |
NodeManager * | getNodeManagerNS1 () |
Returns the node manager object responsible for namespace index 1 nodes. More... | |
SessionManager * | getSessionManager () |
Returns the OPC UA Session manager object. More... | |
OpcUa::HistoryServerCapabilitiesType * | getHistoryServerCapabilities () |
Returns the OPC UA HistoryServerCapabilities object. More... | |
UaThreadPool * | getThreadPool () |
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... | |
Session * | createInternalSession (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 SessionManager * | createSessionManager () |
This function creates the SessionManager. More... | |
virtual NodeManager * | createNodeManagerNS1 (const UaString &sServerUri) |
This function creates the NodeManagerNS1. More... | |
OPC Server Manager Interface. The ServerManager is needed to start everything up and get all name spaces.
ServerManager::ServerManager | ( | ) |
construction.
|
virtual |
destruction
destruction.
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.
[in] | startingNode | Starting node for the browse call |
[in] | referenceTypeFilter | Reference type filter to return only nodes referenced from the starting node with this reference type or a subtype |
[in,out] | continuationPoint | Continuation point for the browse. Indicates if more results are available |
[out] | references | List 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.
[in] | startingNode | Starting node for the browse call |
[in] | isInverse | Flag indicating if the browse is inverse (True) or forward (False) |
[in] | referenceTypeFilter | Reference type filter to return only nodes referenced from the starting node with this reference type or a subtype |
[in] | nodeClassMask | Node 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] | continuationPoint | Continuation point for the browse. Indicates if more results are available |
[out] | references | List 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.
[in] | pSession | Session context for the browse call |
[in] | startingNode | Starting node for the browse call |
[in] | isInverse | Flag indicating if the browse is inverse (True) or forward (False) |
[in] | referenceTypeFilter | Reference type filter to return only nodes referenced from the starting node with this reference type or a subtype |
[in] | nodeClassMask | Node 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] | continuationPoint | Continuation point for the browse. Indicates if more results are available |
[out] | references | List 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.
[in] | pSession | Session context for the function call |
[in] | objectId | Object node for the call |
[in] | methodId | Method node for the call |
[in] | inputArguments | Array of input arguments |
[out] | inputArgumentResults | Array of input argument results |
[out] | outputArguments | Array 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.
[in] | newState | New server status |
void ServerManager::changeServiceLevel | ( | OpcUa_Byte | serviceLevel, |
OpcUa_Byte | changeMask | ||
) |
Update the ServiceLevel property of the Server object.
serviceLevel | The new service level to set. |
changeMask | A 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. |
Internal function to request a condition refresh for the event monitored item.
[in] | pSession | Session context for the function call |
[in] | monitoredItemId | Id of the affected monitored item |
UaStatus ServerManager::createDataMonitoredItems | ( | Session * | pSession, |
DataMonitoredItemSpecArray & | dataMonitoredItems | ||
) |
Internal function to create a list of data monitored items.
[in] | pSession | Session context for the function call |
[in,out] | dataMonitoredItems | Array 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.
[in] | pSession | Session context for the function call |
[in] | objectToMonitor | Object node used as event notifier |
[in] | pEventCallback | Event callback interface for the event monitored item |
[in] | pEventFilter | Event filter for the monitored item |
[out] | monitoredItemId | Id 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.
[in] | sessionName | Name of the session. This is mainly used in the session diagnostics |
[in] | localeId | Locale used for the session |
[in] | pUserIdentityToken | User identity used for the session. NULL for anonymous. |
|
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
|
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.
[in] | pSession | Session context for the function call |
[in] | monitoredItemIds | Array of Ids of the monitored items to delete |
[out] | results | Result 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.
NodeManager * ServerManager::getNodeManagerNS1 | ( | ) |
Returns the node manager object responsible for namespace index 1 nodes.
NodeManager * ServerManager::getNodeManagerRoot | ( | ) |
Returns the root node manager object.
ServerConfig * ServerManager::getServerConfig | ( | ) |
Returns the server configuration object.
SessionManager * ServerManager::getSessionManager | ( | ) |
UaThreadPool * ServerManager::getThreadPool | ( | ) |
Returns the 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.
[in] | pSession | Session context for the function call |
[in] | maxAge | The maximum age of a cached value that can be returned to the caller |
[in] | nodesToRead | Array of nodes and attributes to read |
[out] | results | Array of read results |
UaStatus ServerManager::read | ( | Session * | pSession, |
OpcUa_Double | maxAge, | ||
const PVariableHandleArray & | variableHandles, | ||
const UaReadValueIds & | nodesToRead, | ||
UaDataValues & | results | ||
) |
Read function for internal use.
[in] | pSession | Session context for the function call |
[in] | maxAge | The maximum age of a cached value that can be returned to the caller |
[in] | variableHandles | Array of variable handles indicating the node and attribute to read |
[in] | nodesToRead | Array of nodes and attributes to read |
[out] | results | Array 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.
[in] | pEventManager | New 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
[in] | monitoredItemId | Id of the affected monitored item |
[in] | eventManagerIndex | Index of the invalid EventManager |
UaStatus ServerManager::shutDown | ( | ) |
Shut down server manager.
OpcUa_UInt32 ServerManager::startServerShutDown | ( | OpcUa_Int32 | secondsTillShutdown, |
const UaLocalizedText & | shutdownReason | ||
) |
Inform the server manager about the shutdown of the server.
[in] | secondsTillShutdown | Seconds till shutdown of the server |
[in] | shutdownReason | Reason 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
[in] | secondsTillShutdown | Seconds till shutdown of the server |
[in] | shutdownReason | Reason for the shutdown in different languages |
UaStatus ServerManager::startUp | ( | ServerConfig * | pServerConfig | ) |
Start up server manager.
pServerConfig | Server configuration object. |
UaStatus ServerManager::write | ( | Session * | pSession, |
const UaWriteValues & | nodesToWrite, | ||
UaStatusCodeArray & | results | ||
) |
Write function for internal use.
[in] | pSession | Session context for the function call |
[in] | nodesToWrite | Array of nodes, attributes and values to write |
[out] | results | Array of write results |
UaStatus ServerManager::write | ( | Session * | pSession, |
const PVariableHandleArray & | variableHandles, | ||
const UaWriteValues & | nodesToWrite, | ||
UaStatusCodeArray & | results | ||
) |
Write function for internal use.
[in] | pSession | Session context for the function call |
[in] | variableHandles | Array of variable handles indicating the node and attribute to write |
[in] | nodesToWrite | Array of nodes, attributes and values to write |
[out] | results | Array of write results |