OPC Server Manager Interface. The Servermanager is needed to start everything up and get all Namespaces. More...
#include <servermanager.h>
Public Member Functions | |
ServerManager () | |
virtual | ~ServerManager () |
UaStatus | startUp (ServerConfig *pServerConfig) |
UaStatus | shutDown () |
ServerConfig * | getServerConfig () |
NodeManager * | getNodeManagerRoot () |
NodeManager * | getNodeManagerNS1 () |
SessionManager * | getSessionManager () |
void | registerDynamicEventManager (EventManager *pEventManager) |
OpcUa_UInt32 | startServerShutDown (OpcUa_Int32 secondsTillShutdown, const UaLocalizedText &shutdownReason) |
void | changeServerState (OpcUa_ServerState newState) |
UaStatus | browse (const UaNodeId &startingNode, const UaNodeId &referenceTypeFilter, ContinuationPointWrapper &continuationPoint, UaReferenceDescriptions &references) |
UaStatus | browse (const UaNodeId &startingNode, OpcUa_Boolean isInverse, const UaNodeId &referenceTypeFilter, OpcUa_UInt32 nodeClassMask, ContinuationPointWrapper &continuationPoint, UaReferenceDescriptions &references) |
UaStatus | read (Session *pSession, OpcUa_Double maxAge, const UaReadValueIds &nodesToRead, UaDataValues &results) |
UaStatus | read (Session *pSession, OpcUa_Double maxAge, const PVariableHandleArray &variableHandles, const UaReadValueIds &nodesToRead, UaDataValues &results) |
UaStatus | write (Session *pSession, const UaWriteValues &nodesToWrite, UaStatusCodeArray &results) |
UaStatus | write (Session *pSession, const PVariableHandleArray &variableHandles, const UaWriteValues &nodesToWrite, UaStatusCodeArray &results) |
UaStatus | call (Session *pSession, const UaNodeId &objectId, const UaNodeId &methodId, const UaVariantArray &inputArguments, UaStatusCodeArray &inputArgumentResults, UaVariantArray &outputArguments) |
UaStatus | createDataMonitoredItems (Session *pSession, DataMonitoredItemSpecArray &dataMonitoredItems) |
UaStatus | createEventMonitoredItem (Session *pSession, const UaNodeId &objectToMonitor, EventCallback *pEventCallback, OpcUa_EventFilter *pEventFilter, OpcUa_UInt32 &monitoredItemId) |
UaStatus | deleteMonitoredItems (Session *pSession, const UaUInt32Array &monitoredItemIds, UaStatusCodeArray &results) |
Protected Member Functions | |
virtual SessionManager * | createSessionManager () |
virtual NodeManager * | createNodeManagerNS1 (const UaString &sServerUri) |
OPC Server Manager Interface. The Servermanager is needed to start everything up and get all Namespaces.
ServerManager::ServerManager | ( | ) |
construction.
ServerManager::~ServerManager | ( | ) | [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::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 |
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 |
NodeManager * ServerManager::createNodeManagerNS1 | ( | const UaString & | sServerUri ) | [protected, virtual] |
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 | ( | ) | [protected, virtual] |
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 |
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 | ( | ) |
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 |
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 |
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 |