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 ()
NodeManagergetNodeManagerByNamespace (OpcUa_UInt16 NsIdx) const
UaStatus addNodeManager (NodeManager *pNodeManager, const UaString &sNamespaceUri, OpcUa_UInt16 &assignedNamespaceIndex)
UaStatus removeNodeManager (OpcUa_UInt16 namespaceIndex)
UaObjectServerpServerObject () const
OpcUa_StatusCode getNamespaceIndexFromUri (const UaString &sNamespaceUri, OpcUa_UInt16 &namespaceIndex)
OpcUa_StatusCode getNamespaceUriFromIndex (OpcUa_UInt16 namespaceIndex, UaString &sNamespaceUri) const
void startServerShutDown (OpcUa_Int32 secondsTillShutdown, const UaLocalizedText &shutdownReason)
void changeServerState (OpcUa_ServerState newState)
UaNodegetNode (const UaNodeId &nodeId)
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 getListOfSuperTypes (const UaNodeId &startingNode, UaNodeIdArray &superTypeList)
ServerManagerpServerManager ()
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)
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)

Static Public Member Functions

static NodeManagerRootCreateRootNodeManager ()
static OpcUa_Int16 getTypeNamespace ()

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

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:
serviceContextGeneral context for the service calls containing information like the session object, return diagnostic mask and timeout hint.
parentNodeIdthe parentNodeId of the current Node.
referenceTypeIdType of the reference to create from the source node to the new node.
requestedNewNodeIdthe new NodeId of the requested Node.
browseNamethe actual browse name of the Node.
nodeClassthe actual node class of the Node.
nodeAttributesall attributes of the current Node.
typeDefinitionthe Definition of the actual Node.
addedNodeIdthe added NodeId.
Returns:
Error code

Reimplemented from NodeManager.

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

Add a NodeManager to the list

Parameters:
pNodeManagerPointer to NodeManager that manages references from the starting node to nodes in the that NodeManager.
sNamespaceUriNamespace URI used for the NodeManager.
assignedNamespaceIndexAssigned namespace index of the added NodeManager.
Returns:
Error code

Implements NodeManagerList.

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:
serviceContextGeneral context for the service calls containing information like the session object, return diagnostic mask and timeout hint.
sourceNodeIdthe source NodeId of the actual Node.
referenceTypeIdType of the reference to create from the source node to the new node.
isForwardindicates if the Node is forwardreferenced or not.
targetNodeIdthe NodeId of the target Node.
targetNodeClassthe NodeClass of the target Node.
Returns:
Error code

Reimplemented from NodeManager.

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::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 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:
serviceContextGeneral context for the service calls containing information like the session object, return diagnostic mask and timeout hint.
browseContextBrowse context for the first browse or the following browse with continuation point.
ReferencesArray of ReferenceDescription results for the browsed node.
Returns:
Error code

Reimplemented from NodeManagerUaNode.

UaStatus NodeManagerRoot::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
void NodeManagerRoot::changeServerState ( OpcUa_ServerState  newState )

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

Parameters:
newStateNew server status.
NodeManagerRoot * NodeManagerRoot::CreateRootNodeManager (  ) [static]

construction

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

Delete node from the NodeManager.

Parameters:
serviceContextGeneral context for the service calls containing information like the session object, return diagnostic mask and timeout hint.
nodeIdthe Id of the current Node.
deleteTargetReferenceIndicates 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:
serviceContextGeneral context for the service calls containing information like the session object, return diagnostic mask and timeout hint.
sourceNodeIdthe source NodeId of the actual Node.
referenceTypeIdType of the reference to create from the source node to the new node.
isForwardindicates if the Node is forwardreferenced or not.
targetNodeIdthe NodeId of the target Node.
deleteBidirectionalTRUE if delete bidirectional FALSE if not.
Returns:
Error code

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:
pSessionInterface 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.
pNodeIdNodeId of the requested node
eventFilterEvent filter defined by the client
eventManagersa list of EventManager interfaces for an event notifier.
Returns:
Error code

Reimplemented from NodeManager.

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:
pSessionInterface 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.
serviceTypeService 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
pNodeIdNodeId of the requested Node.
resultthe result of the current Operation.
Returns:
the history variable handle for the passed node Id.

Reimplemented from NodeManager.

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

Get the responsible IOManager for the node and attribute combination.

Parameters:
pUaNodethe actual Node where to get all information from.
attributeIdAttributeId of the requested node
Returns:
a Variable to the IOManager.

Implements NodeManagerUaNode.

UaStatus NodeManagerRoot::getListOfSuperTypes ( const UaNodeId startingNode,
UaNodeIdArray &  superTypeList 
)

Returns the list of super types for a passed OPC UA type node.

Returns:
Status result code for the call.
Parameters:
[in]startingNodeStarting type node for the type tree resolution
[out]superTypeListList of super types for the passed type node
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:
pSessionInterface 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.
pObjectNodeIdthe NodeId of the actual Object.
pMethodNodeIdthe NodeId of the actual Method.
resultthe result of the current Operation.
Returns:
the method handle for the passed node Id.

Reimplemented from NodeManagerUaNode.

OpcUa_StatusCode NodeManagerRoot::getNamespaceIndexFromUri ( const UaString sNamespaceUri,
OpcUa_UInt16 &  namespaceIndex 
)

Returns a namespace index for a namespace URI.

Parameters:
sNamespaceUriNamespace URI to convert to the namespace index.
namespaceIndexThe Namespace index for the passed namespace URI.
Returns:
Error code
OpcUa_StatusCode NodeManagerRoot::getNamespaceUriFromIndex ( OpcUa_UInt16  namespaceIndex,
UaString sNamespaceUri 
) const

Returns a namespace URI for a namespace index.

Parameters:
namespaceIndexNamespace index to convert to the namespace URI.
sNamespaceUriNamespace URI for the passed namespace index.
Returns:
Error code
UaNode * NodeManagerRoot::getNode ( const UaNodeId nodeId ) [virtual]

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:
nodeIdNodeId of the node to return.
Returns:
The requested node. Null if node was not found. The reference count for the found node is incremented.

Reimplemented from NodeManagerUaNode.

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

Get the NodeManager by namespace index

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

Implements NodeManagerList.

NodeManagerConfig * NodeManagerRoot::getNodeManagerConfig (  ) [virtual]

Get the interface NodeManagerConfig if available.

Returns:
the NodeManagerConfig Variable.

Reimplemented from NodeManagerUaNode.

NodeManagerCrossReferences * NodeManagerRoot::getNodeManagerCrossReferences (  ) [virtual]

Get the interface NodeManagerCrossReferences if available.

Returns:
the NodeManagerCrossReferences Variable.

Reimplemented from NodeManagerUaNode.

static OpcUa_Int16 NodeManagerRoot::getTypeNamespace (  ) [inline, static]

Get the type namespace index.

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:
pSessionInterface 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.
serviceTypeService type enumerator with the following possible settings READ - Read service WRITE - Write service MONITORING - CreateMonitoredItems service
pNodeIdNodeId of the requested Node.
AttributeIdAttributeId of the requested node
Returns:
the variable handle for the passed node Id.

Reimplemented from NodeManagerUaNode.

ServerManager* NodeManagerRoot::pServerManager (  ) [inline]

Get the server manager.

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

Get the server object

Returns:
the new created Serverobject.
UaStatus NodeManagerRoot::readValues ( const UaVariableArray arrUaVariables,
UaDataValueArray arrDataValues 
) [virtual]

Reads the value attributes for a list of UaVariables.

Parameters:
arrUaVariablesAn 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.
arrDataValuesAn array of OpcUa_DataValue structures used to return the values to read.
Returns:
Error code

Reimplemented from IOManagerUaNode.

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

Remove a NodeManager from the list

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

Implements NodeManagerList.

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

Notifies the node manager that a session was activated.

Parameters:
sessionInterface pointer of the activated 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 pSession ) [virtual]

Notifies the node manager that a session was closed.

Parameters:
sessionInterface pointer of the closed 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::sessionOpened ( Session pSession ) [virtual]

Notifies the node manager that a new session was opened.

Parameters:
sessionInterface 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.

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

Inform the node manager about the shutdown of the server.

Parameters:
secondsTillShutdownSeconds till shutdown of the server.
shutdownReasonReason for the shutdown.
UaStatus NodeManagerRoot::startUp ( ServerManager pServerManager ) [virtual]

Start up NodeManager.

Parameters:
pServerManagerInterface 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::translateBrowsePathToNodeId ( const ServiceContext serviceContext,
const UaNodeId startingNode,
UaRelativePath relativePath,
UaBrowsePathTargets &  browsePathTargets 
) [virtual]

Translates a relative browse path to a node id.

Parameters:
serviceContextGeneral context for the service calls containing information like the session object, return diagnostic mask and timeout hint.
startingNodeStarting node from where the relative path is defined.
relativePathRelative path from the starting node to the searched node.
browsePathTargetsall needed targets of the Browsepath.
Returns:
Error code

Reimplemented from NodeManagerUaNode.

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

Writes the value attributes for a list of UaVariables.

Parameters:
arrUaVariablesAn 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.
arrpDataValuesArray of pointers to OpcUa_DataValue structures containing the data to write.
arrStatusCodesAn array of OpcUa_StatusCode values used to indicate if the write succeeds on a single variable base.
Returns:
Error code

Reimplemented from IOManagerUaNode.


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