NodeManagerRoot Class Reference

Class definition of the NodeManagerRoot. Create Sessions, starts up the Server. This class controls the session and gives access to all possible browse possibilities. It is also possible to add new nodes/references, or to delete old nodes/references. Here also the shutdown of the server will be prepared. Derived from NodeManagerUaNode, IOManagerUaNode and NodeManagerList It is not possible to create plane copies of this Class. More...

#include <nodemanagerroot.h>

Inheritance diagram for NodeManagerRoot:
Collaboration diagram for NodeManagerRoot:

List of all members.


Public Member Functions

virtual ~NodeManagerRoot ()
UaStatus startUp (ServerManager *pServerManager)
UaStatus sessionOpened (Session *session)
UaStatus sessionActivated (Session *session)
UaStatus sessionClosed (Session *session)
UaStatus browse (const ServiceContext &serviceContext, BrowseContext &browseContext, UaReferenceDescriptions &References)
UaStatus translateBrowsePathToNodeId (const ServiceContext &serviceContext, const UaNodeId &startingNode, UaRelativePath &relativePath, UaBrowsePathTargets &browsePathTargets)
VariableHandlegetVariableHandle (Session *pSession, VariableHandle::ServiceType serviceType, OpcUa_NodeId *pNodeId, OpcUa_Int32 AttributeId) const
HistoryVariableHandlegetHistoryVariableHandle (Session *pSession, HistoryVariableHandle::ServiceType serviceType, OpcUa_NodeId *pNodeId, UaStatus &result) const
UaStatus getEventManagers (Session *pSession, OpcUa_NodeId *pNodeId, OpcUa_EventFilter *eventFilter, EventManagerArray &eventManagers) const
MethodHandlegetMethodHandle (Session *pSession, OpcUa_NodeId *pObjectNodeId, OpcUa_NodeId *pMethodNodeId, UaStatus &result) const
UaStatus addNode (const ServiceContext &serviceContext, const UaNodeId &parentNodeId, const UaNodeId &referenceTypeId, const UaNodeId &requestedNewNodeId, const UaQualifiedName &browseName, OpcUa_NodeClass nodeClass, const UaExtensionObject &nodeAttributes, const UaNodeId &typeDefinition, UaNodeId &addedNodeId)
UaStatus addReference (const ServiceContext &serviceContext, const UaNodeId &sourceNodeId, const UaNodeId &referenceTypeId, OpcUa_Boolean isForward, const UaNodeId &targetNodeId, OpcUa_NodeClass targetNodeClass)
UaStatus deleteNode (const ServiceContext &serviceContext, const UaNodeId &nodeId, OpcUa_Boolean deleteTargetReference)
UaStatus deleteReference (const ServiceContext &serviceContext, const UaNodeId &sourceNodeId, const UaNodeId &referenceTypeId, OpcUa_Boolean isForward, const UaNodeId &targetNodeId, OpcUa_Boolean deleteBidirectional)
UaStatus readNodeConfiguration (Session *pSession, const UaNodeId &nodeToRead, OpcUa_Int32 attributeID, UaVariant &value)
NodeManagerCrossReferencesgetNodeManagerCrossReferences ()
NodeManagerConfiggetNodeManagerConfig ()
IOManagergetIOManager (UaNode *pUaNode, OpcUa_Int32 attributeId) const
UaStatus afterStartUp ()
UaStatus beforeShutDown ()
UaStatus readValues (const UaVariableArray &arrUaVariables, UaDataValueArray &arrDataValues)
UaStatus writeValues (const UaVariableArray &arrUaVariables, const PDataValueArray &arrpDataValues, UaStatusCodeArray &arrStatusCodes)
NodeManagergetNodeManagerByNamespace (OpcUa_UInt16 NsIdx) const
UaStatus addNodeManager (NodeManager *pNodeManager, const UaString &sNamespaceUri, OpcUa_UInt16 &assignedNamespaceIndex)
UaStatus removeNodeManager (OpcUa_UInt16 namespaceIndex)
UaObjectServerpServerObject () const
OpcUa_StatusCode getNamespaceIndexFromAlias (const UaUShort *sAlias, OpcUa_UInt16 &nsIndex) const
void startServerShutDown (OpcUa_Int32 secondsTillShutdown, const UaLocalizedText &shutdownReason)
void changeServerState (OpcUa_ServerState newState)
UaNodegetNode (const UaNodeId &nodeId)

Static Public Member Functions

static NodeManagerRootCreateRootNodeManager ()

Detailed Description

Class definition of the NodeManagerRoot. Create Sessions, starts up the Server. This class controls the session and gives access to all possible browse possibilities. It is also possible to add new nodes/references, or to delete old nodes/references. Here also the shutdown of the server will be prepared. Derived from NodeManagerUaNode, IOManagerUaNode and NodeManagerList It is not possible to create plane copies of this Class.

NodeManagerRoot


Constructor & Destructor Documentation

NodeManagerRoot::~NodeManagerRoot (  )  [virtual]

destruction


Member Function Documentation

NodeManagerRoot * NodeManagerRoot::CreateRootNodeManager (  )  [static]

construction

UaStatus NodeManagerRoot::startUp ( ServerManager pServerManager  )  [virtual]

Start up NodeManager.

Parameters:
pServerManager Interface 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
Returns:
Error code

Reimplemented from NodeManagerUaNode.

UaStatus NodeManagerRoot::sessionOpened ( Session session  )  [virtual]

Notifies the node manager that a new session was opened.

Parameters:
session Interface pointer of the new Session. The session was created by the ServerConfig object in the Method createSession. This vendor specific implementation can create a derived Session class with vendor specific information.
Returns:
Error code

Reimplemented from NodeManager.

UaStatus NodeManagerRoot::sessionActivated ( Session session  )  [virtual]

Notifies the node manager that a session was activated.

Parameters:
session Interface pointer of the new Session. The session was created by the ServerConfig object in the Method createSession. This vendor specific implementation can create a derived Session class with vendor specific information.
Returns:
Error code

Reimplemented from NodeManager.

UaStatus NodeManagerRoot::sessionClosed ( Session session  )  [virtual]

Notifies the node manager that a session was closed.

Parameters:
session Interface pointer of the new Session. The session was created by the ServerConfig object in the Method createSession. This vendor specific implementation can create a derived Session class with vendor specific information.
Returns:
Error code

Reimplemented from NodeManager.

UaStatus NodeManagerRoot::browse ( const ServiceContext serviceContext,
BrowseContext browseContext,
UaReferenceDescriptions &  References 
) [virtual]

Discover the references of a specified node of a view. This method is used to return a list of references and target nodes for the passed node to browse for the services Browse and BrowseNext.

Parameters:
serviceContext General context for the service calls containing information like the session object, return diagnostic mask and timeout hint.
browseContext Browse context for the first browse or the following browse with continuation point.
References Array of ReferenceDescription results for the browsed node.
Returns:
Error code

Reimplemented from NodeManagerUaNode.

UaStatus NodeManagerRoot::translateBrowsePathToNodeId ( const ServiceContext serviceContext,
const UaNodeId startingNode,
UaRelativePath relativePath,
UaBrowsePathTargets &  browsePathTargets 
) [virtual]

Translates a relative browse path to a node id.

Parameters:
serviceContext General context for the service calls containing information like the session object, return diagnostic mask and timeout hint.
startingNode Starting node from where the relative path is defined.
relativePath Relative path from the starting node to the searched node.
browsePathTargets all needed targets of the Browsepath.
Returns:
Error code

Reimplemented from NodeManagerUaNode.

VariableHandle * NodeManagerRoot::getVariableHandle ( Session pSession,
VariableHandle::ServiceType  serviceType,
OpcUa_NodeId *  pNodeId,
OpcUa_Int32  AttributeId 
) const [virtual]

Get the variable handle for the passed node Id.

Parameters:
pSession Interface pointer of the new Session. The session was created by the ServerConfig object in the Method createSession. This vendor specific implementation can create a derived Session class with vendor specific information.
serviceType Service type enumerator with the following possible settings READ_EVENTS, READ_RAW, READ_MODIFIED, READ_PROCESSED, READ_ATTIME, UPDATE_DATA, UPDATE_EVENT, DELETE_DATA, DELETE_EVENT
pNodeId NodeId of the requested Node.
AttributeId AttributeId of the requested node
Returns:
the variable handle for the passed node Id.

Reimplemented from NodeManagerUaNode.

HistoryVariableHandle * NodeManagerRoot::getHistoryVariableHandle ( Session pSession,
HistoryVariableHandle::ServiceType  serviceType,
OpcUa_NodeId *  pNodeId,
UaStatus result 
) const [virtual]

Get the history variable handle for the passed node Id.

Parameters:
pSession Interface pointer of the new Session. The session was created by the ServerConfig object in the Method createSession. This vendor specific implementation can create a derived Session class with vendor specific information.
serviceType Service type enumerator with the following possible settings READ_EVENTS, READ_RAW, READ_MODIFIED, READ_PROCESSED, READ_ATTIME, UPDATE_DATA, UPDATE_EVENT, DELETE_DATA, DELETE_EVENT
pNodeId NodeId of the requested Node.
result the result of the current Operation.
Returns:
the history variable handle for the passed node Id.

Reimplemented from NodeManager.

UaStatus NodeManagerRoot::getEventManagers ( Session pSession,
OpcUa_NodeId *  pNodeId,
OpcUa_EventFilter *  eventFilter,
EventManagerArray eventManagers 
) const [virtual]

Get a list of EventManager interfaces for an event notifier.

Parameters:
pSession Interface pointer of the new Session. The session was created by the ServerConfig object in the Method createSession. This vendor specific implementation can create a derived Session class with vendor specific information.
pNodeId NodeId of the requested node
eventFilter Event filter defined by the client
eventManagers a list of EventManager interfaces for an event notifier.
Returns:
Error code

Reimplemented from NodeManager.

MethodHandle * NodeManagerRoot::getMethodHandle ( Session pSession,
OpcUa_NodeId *  pObjectNodeId,
OpcUa_NodeId *  pMethodNodeId,
UaStatus result 
) const [virtual]

Get the method handle for the passed node Id.

Parameters:
pSession Interface pointer of the new Session. The session was created by the ServerConfig object in the Method createSession. This vendor specific implementation can create a derived Session class with vendor specific information.
pObjectNodeId the NodeId of the actual Object.
pMethodNodeId the NodeId of the actual Method.
result the result of the current Operation.
Returns:
the method handle for the passed node Id.

Reimplemented from NodeManagerUaNode.

UaStatus NodeManagerRoot::addNode ( const ServiceContext serviceContext,
const UaNodeId parentNodeId,
const UaNodeId referenceTypeId,
const UaNodeId requestedNewNodeId,
const UaQualifiedName browseName,
OpcUa_NodeClass  nodeClass,
const UaExtensionObject nodeAttributes,
const UaNodeId typeDefinition,
UaNodeId addedNodeId 
) [virtual]

Add node to the NodeManager.

Parameters:
serviceContext General context for the service calls containing information like the session object, return diagnostic mask and timeout hint.
parentNodeId the parentNodeId of the current Node.
referenceTypeId Type of the reference to create from the source node to the new node.
requestedNewNodeId the new NodeId of the requested Node.
browseName the actual browse name of the Node.
nodeClass the actual node class of the Node.
nodeAttributes all attributes of the current Node.
typeDefinition the Definition of the actual Node.
addedNodeId the added NodeId.
Returns:
Error code

Reimplemented from NodeManager.

UaStatus NodeManagerRoot::addReference ( const ServiceContext serviceContext,
const UaNodeId sourceNodeId,
const UaNodeId referenceTypeId,
OpcUa_Boolean  isForward,
const UaNodeId targetNodeId,
OpcUa_NodeClass  targetNodeClass 
) [virtual]

Add reference to the NodeManager.

Parameters:
serviceContext General context for the service calls containing information like the session object, return diagnostic mask and timeout hint.
sourceNodeId the source NodeId of the actual Node.
referenceTypeId Type of the reference to create from the source node to the new node.
isForward indicates if the Node is forwardreferenced or not.
targetNodeId the NodeId of the target Node.
targetNodeClass the NodeClass of the target Node.
Returns:
Error code

Reimplemented from NodeManager.

UaStatus NodeManagerRoot::deleteNode ( const ServiceContext serviceContext,
const UaNodeId nodeId,
OpcUa_Boolean  deleteTargetReference 
) [virtual]

Delete node from the NodeManager.

Parameters:
serviceContext General context for the service calls containing information like the session object, return diagnostic mask and timeout hint.
nodeId the Id of the current Node.
deleteTargetReference Indicates if the inverse references in the target nodes must be deleted
Returns:
Error code

Reimplemented from NodeManager.

UaStatus NodeManagerRoot::deleteReference ( const ServiceContext serviceContext,
const UaNodeId sourceNodeId,
const UaNodeId referenceTypeId,
OpcUa_Boolean  isForward,
const UaNodeId targetNodeId,
OpcUa_Boolean  deleteBidirectional 
) [virtual]

Delete reference from the NodeManager.

Parameters:
serviceContext General context for the service calls containing information like the session object, return diagnostic mask and timeout hint.
sourceNodeId the source NodeId of the actual Node.
referenceTypeId Type of the reference to create from the source node to the new node.
isForward indicates if the Node is forwardreferenced or not.
targetNodeId the NodeId of the target Node.
deleteBidirectional TRUE if delete bidirectional FALSE if not.
Returns:
Error code

Reimplemented from NodeManager.

UaStatus NodeManagerRoot::readNodeConfiguration ( Session pSession,
const UaNodeId nodeToRead,
OpcUa_Int32  attributeID,
UaVariant value 
) [virtual]

Read configuration information attributes of a node.

Parameters:
pSession Interface pointer of the new Session. The session was created by the ServerConfig object in the Method createSession. This vendor specific implementation can create a derived Session class with vendor specific information.
nodeToRead the actual Node to read from.
attributeID the Id of the actual attribute.
value the value of the current Node.
Returns:
Error code

Reimplemented from NodeManagerUaNode.

NodeManagerCrossReferences * NodeManagerRoot::getNodeManagerCrossReferences (  )  [virtual]

Get the interface NodeManagerCrossReferences if available.

Returns:
the NodeManagerCrossReferences Variable.

Reimplemented from NodeManagerUaNode.

NodeManagerConfig * NodeManagerRoot::getNodeManagerConfig (  )  [virtual]

Get the interface NodeManagerConfig if available.

Returns:
the NodeManagerConfig Variable.

Reimplemented from NodeManagerUaNode.

IOManager * NodeManagerRoot::getIOManager ( UaNode pUaNode,
OpcUa_Int32  attributeId 
) const [virtual]

Get the responsible IOManager for the node and attribute combination.

Parameters:
pUaNode the actual Node where to get all information from.
attributeId AttributeId of the requested node
Returns:
a Variable to the IOManager.

Implements NodeManagerUaNode.

UaStatus NodeManagerRoot::afterStartUp (  )  [virtual]

Finish start up in derived class after starting up base class.

Returns:
Error code

Implements NodeManagerUaNode.

UaStatus NodeManagerRoot::beforeShutDown (  )  [virtual]

Start shut down in derived class before shutting down base class.

Returns:
Error code

Implements NodeManagerUaNode.

UaStatus NodeManagerRoot::readValues ( const UaVariableArray arrUaVariables,
UaDataValueArray arrDataValues 
) [virtual]

Reads the value attributes for a list of UaVariables.

Parameters:
arrUaVariables An array of UaVariable interface pointers used to indicate which variables should be read. The implementation of the interface needs to have the necessary information to access the data from the external source.
arrDataValues An array of OpcUa_DataValue structures used to return the values to read.
Returns:
Error code

Reimplemented from IOManagerUaNode.

UaStatus NodeManagerRoot::writeValues ( const UaVariableArray arrUaVariables,
const PDataValueArray arrpDataValues,
UaStatusCodeArray &  arrStatusCodes 
) [virtual]

Writes the value attributes for a list of UaVariables.

Parameters:
arrUaVariables An array of UaVariable interface pointers used to indicate which variables should be read. The implementation of the interface needs to have the necessary information to access the data from the external source.
arrpDataValues Array of pointers to OpcUa_DataValue structures containing the data to write.
arrStatusCodes An array of OpcUa_StatusCode values used to indicate if the write succeeds on a single variable base.
Returns:
Error code

Reimplemented from IOManagerUaNode.

NodeManager * NodeManagerRoot::getNodeManagerByNamespace ( OpcUa_UInt16  NsIdx  )  const [virtual]

Get the NodeManager by namespace index

Parameters:
NsIdx the Namespaceindex of the current Node.
Returns:
Interface pointer of NodeManager.

Implements NodeManagerList.

UaStatus NodeManagerRoot::addNodeManager ( NodeManager pNodeManager,
const UaString sNamespaceUri,
OpcUa_UInt16 &  assignedNamespaceIndex 
) [virtual]

Add a NodeManager to the list

Parameters:
pNodeManager Pointer to NodeManager that manages references from the starting node to nodes in the that NodeManager.
sNamespaceUri Namespace URI used for the NodeManager.
assignedNamespaceIndex Assigned namespace index of the added NodeManager.
Returns:
Error code

Implements NodeManagerList.

UaStatus NodeManagerRoot::removeNodeManager ( OpcUa_UInt16  namespaceIndex  )  [virtual]

Remove a NodeManager from the list

Parameters:
namespaceIndex Assigned namespace index of the added NodeManager.
Returns:
Error code

Implements NodeManagerList.

UaObjectServer* NodeManagerRoot::pServerObject (  )  const [inline]

Get the server object

Returns:
the new created Serverobject.

OpcUa_StatusCode NodeManagerRoot::getNamespaceIndexFromAlias ( const UaUShort *  sAlias,
OpcUa_UInt16 &  nsIndex 
) const

Returns a namespace index for a namespace alias.

Parameters:
sAlias alias name to convert to the namespaceindex.
nsIndex the Namespaceindex of the current Node.
Returns:
Error code

void NodeManagerRoot::startServerShutDown ( OpcUa_Int32  secondsTillShutdown,
const UaLocalizedText shutdownReason 
)

Inform the node manager about the shutdown of the server.

Parameters:
secondsTillShutdown Seconds till shutdown of the server.
shutdownReason Reason for the shutdown.

void NodeManagerRoot::changeServerState ( OpcUa_ServerState  newState  ) 

Update the server manager about the change of the server state.

Parameters:
newState New server status.

UaNode * NodeManagerRoot::getNode ( const UaNodeId nodeId  ) 

Get a UaNode pointer for a requested nodeId. If a UaNode object is found for the nodeId the reference count of the node gets incremented and a pointer to the node ist returned. The caller must release the reference when the node is not longer needed.

Parameters:
nodeId NodeId of the node to return.
Returns:
The requested node. Null if node was not found. The reference count for the found node is incremented.


The documentation for this class was generated from the following files:
  • src/uaserver/uaservercpp/coremodule/nodemanagerroot.h
  • src/uaserver/uaservercpp/coremodule/nodemanagerroot.cpp