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>
Public Member Functions | |
virtual | ~NodeManagerRoot () |
NodeManager * | getNodeManagerByNamespace (OpcUa_UInt16 NsIdx) const |
UaStatus | addNodeManager (NodeManager *pNodeManager, const UaString &sNamespaceUri, OpcUa_UInt16 &assignedNamespaceIndex) |
UaStatus | removeNodeManager (OpcUa_UInt16 namespaceIndex) |
UaObjectServer * | pServerObject () 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) |
UaNode * | getNode (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) |
ServerManager * | pServerManager () |
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) |
VariableHandle * | getVariableHandle (Session *pSession, VariableHandle::ServiceType serviceType, OpcUa_NodeId *pNodeId, OpcUa_Int32 AttributeId) const |
HistoryVariableHandle * | getHistoryVariableHandle (Session *pSession, HistoryVariableHandle::ServiceType serviceType, OpcUa_NodeId *pNodeId, UaStatus &result) const |
UaStatus | getEventManagers (Session *pSession, OpcUa_NodeId *pNodeId, OpcUa_EventFilter *eventFilter, EventManagerArray &eventManagers) const |
MethodHandle * | getMethodHandle (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) |
NodeManagerCrossReferences * | getNodeManagerCrossReferences () |
NodeManagerConfig * | getNodeManagerConfig () |
IOManager * | getIOManager (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 NodeManagerRoot * | CreateRootNodeManager () |
static OpcUa_Int16 | getTypeNamespace () |
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::~NodeManagerRoot | ( | ) | [virtual] |
destruction
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.
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. |
Reimplemented from NodeManager.
UaStatus NodeManagerRoot::addNodeManager | ( | NodeManager * | pNodeManager, |
const UaString & | sNamespaceUri, | ||
OpcUa_UInt16 & | assignedNamespaceIndex | ||
) | [virtual] |
Add a NodeManager to the list
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. |
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.
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. |
Reimplemented from NodeManager.
UaStatus NodeManagerRoot::afterStartUp | ( | ) | [virtual] |
Finish start up in derived class after starting up base class.
Implements NodeManagerUaNode.
UaStatus NodeManagerRoot::beforeShutDown | ( | ) | [virtual] |
Start shut down in derived class before shutting down base class.
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.
[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 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.
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. |
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.
[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 |
void NodeManagerRoot::changeServerState | ( | OpcUa_ServerState | newState ) |
Update the server manager about the change of the server state.
newState | New 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.
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 |
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.
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. |
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.
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. |
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.
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. |
Reimplemented from NodeManager.
IOManager * NodeManagerRoot::getIOManager | ( | UaNode * | pUaNode, |
OpcUa_Int32 | attributeId | ||
) | const [virtual] |
Get the responsible IOManager for the node and attribute combination.
pUaNode | the actual Node where to get all information from. |
attributeId | AttributeId of the requested node |
Implements NodeManagerUaNode.
UaStatus NodeManagerRoot::getListOfSuperTypes | ( | const UaNodeId & | startingNode, |
UaNodeIdArray & | superTypeList | ||
) |
Returns the list of super types for a passed OPC UA type node.
[in] | startingNode | Starting type node for the type tree resolution |
[out] | superTypeList | List 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.
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. |
Reimplemented from NodeManagerUaNode.
OpcUa_StatusCode NodeManagerRoot::getNamespaceIndexFromUri | ( | const UaString & | sNamespaceUri, |
OpcUa_UInt16 & | namespaceIndex | ||
) |
Returns a namespace index for a namespace URI.
sNamespaceUri | Namespace URI to convert to the namespace index. |
namespaceIndex | The Namespace index for the passed namespace URI. |
OpcUa_StatusCode NodeManagerRoot::getNamespaceUriFromIndex | ( | OpcUa_UInt16 | namespaceIndex, |
UaString & | sNamespaceUri | ||
) | const |
Returns a namespace URI for a namespace index.
namespaceIndex | Namespace index to convert to the namespace URI. |
sNamespaceUri | Namespace URI for the passed namespace index. |
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.
nodeId | NodeId of the node to return. |
Reimplemented from NodeManagerUaNode.
NodeManager * NodeManagerRoot::getNodeManagerByNamespace | ( | OpcUa_UInt16 | NsIdx ) | const [virtual] |
Get the NodeManager by namespace index
NsIdx | the Namespaceindex of the current Node. |
Implements NodeManagerList.
NodeManagerConfig * NodeManagerRoot::getNodeManagerConfig | ( | ) | [virtual] |
Get the interface NodeManagerConfig if available.
Reimplemented from NodeManagerUaNode.
NodeManagerCrossReferences * NodeManagerRoot::getNodeManagerCrossReferences | ( | ) | [virtual] |
Get the interface NodeManagerCrossReferences if available.
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.
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 - Read service WRITE - Write service MONITORING - CreateMonitoredItems service |
pNodeId | NodeId of the requested Node. |
AttributeId | AttributeId of the requested node |
Reimplemented from NodeManagerUaNode.
ServerManager* NodeManagerRoot::pServerManager | ( | ) | [inline] |
Get the server manager.
UaObjectServer* NodeManagerRoot::pServerObject | ( | ) | const [inline] |
Get the server object
UaStatus NodeManagerRoot::readValues | ( | const UaVariableArray & | arrUaVariables, |
UaDataValueArray & | arrDataValues | ||
) | [virtual] |
Reads the value attributes for a list of UaVariables.
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. |
Reimplemented from IOManagerUaNode.
UaStatus NodeManagerRoot::removeNodeManager | ( | OpcUa_UInt16 | namespaceIndex ) | [virtual] |
Remove a NodeManager from the list
namespaceIndex | Assigned namespace index of the added NodeManager. |
Implements NodeManagerList.
Notifies the node manager that a session was activated.
session | Interface 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. |
Reimplemented from NodeManager.
Notifies the node manager that a session was closed.
session | Interface 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. |
Reimplemented from NodeManager.
Notifies the node manager that a new session was opened.
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. |
Reimplemented from NodeManager.
void NodeManagerRoot::startServerShutDown | ( | OpcUa_Int32 | secondsTillShutdown, |
const UaLocalizedText & | shutdownReason | ||
) |
Inform the node manager about the shutdown of the server.
secondsTillShutdown | Seconds till shutdown of the server. |
shutdownReason | Reason for the shutdown. |
UaStatus NodeManagerRoot::startUp | ( | ServerManager * | pServerManager ) | [virtual] |
Start up NodeManager.
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 |
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.
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. |
Reimplemented from NodeManagerUaNode.
UaStatus NodeManagerRoot::writeValues | ( | const UaVariableArray & | arrUaVariables, |
const PDataValueArray & | arrpDataValues, | ||
UaStatusCodeArray & | arrStatusCodes | ||
) | [virtual] |
Writes the value attributes for a list of UaVariables.
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. |
Reimplemented from IOManagerUaNode.