C# Class DsatsDemoServer.DsatsDemoNodeManager

A node manager for a server that exposes several variables.
Inheritance: Opc.Ua.Server.CustomNodeManager2
ファイルを表示 Open project: OPCFoundation/UA-.NET Class Usage Examples

Public Methods

Method Description
CreateAddressSpace ( IDictionary externalReferences ) : void

Does any initialization required before the address space can be used.

The externalReferences is an out parameter that allows the node manager to link to nodes in other node managers. For example, the 'Objects' node is managed by the CoreNodeManager and should have a reference to the root folder node(s) exposed by this node manager.

DeleteAddressSpace ( ) : void

Frees any resources allocated for the address space.

DsatsDemoNodeManager ( IServerInternal server, ApplicationConfiguration configuration ) : System

Initializes the node manager.

LoadDataSource ( ISystemContext context ) : void

Loads the datasource file.

LoadDataSourceAccessRules ( ISystemContext context, ToolState tool, DsatsDemo declaration ) : void
LoadDataSourceDeclarations ( ISystemContext context, DsatsDemo datasource ) : void
LoadDataSourceLocks ( ISystemContext context, DsatsDemo datasource ) : void
LoadDataSourcePhases ( ISystemContext context, DsatsDemo datasource ) : void
LoadDataSourceSources ( ISystemContext context, ToolState tool, DsatsDemo datasource, DsatsDemo declaration ) : void
New ( ISystemContext context, NodeState node ) : Opc.Ua.NodeId

Creates the NodeId for the specified node.

OnChangeLockByWrite ( ISystemContext context, NodeState node, NumericRange indexRange, Opc.Ua.QualifiedName dataEncoding, object &value, Opc.Ua.StatusCode &statusCode, System.DateTime &timestamp ) : ServiceResult
OnChangePhase ( ISystemContext context, MethodState method, Opc.Ua.NodeId objectId, Opc.Ua.NodeId phaseId ) : ServiceResult

Handles a request to change the phase.

Read ( OperationContext context, double maxAge, IList nodesToRead, IList values, IList errors ) : void

Reads the value for the specified attribute.

SessionClosing ( OperationContext context, Opc.Ua.NodeId sessionId, bool deleteSubscriptions ) : void

Called when a session is closed.

Write ( OperationContext context, IList nodesToWrite, IList errors ) : void

Writes the value for the specified attributes.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

An overrideable version of the Dispose.

GetManagerHandle ( ServerSystemContext context, Opc.Ua.NodeId nodeId, NodeState>.IDictionary cache ) : NodeHandle

Returns a unique handle for the node.

LoadPredefinedNodes ( ISystemContext context ) : NodeStateCollection

Loads a node set from a file or resource and addes them to the set of predefined nodes.

OnCreateMonitoredItemsComplete ( ServerSystemContext context, IList monitoredItems ) : void
OnDeleteMonitoredItemsComplete ( ServerSystemContext context, IList monitoredItems ) : void
OnModifyMonitoredItemsComplete ( ServerSystemContext context, IList monitoredItems ) : void
OnSetMonitoringModeComplete ( ServerSystemContext context, IList monitoredItems ) : void
ValidateNode ( ServerSystemContext context, NodeHandle handle, NodeState>.IDictionary cache ) : NodeState

Verifies that the specified node exists.

Private Methods

Method Description
ChangePhase ( ISystemContext context, Opc.Ua.NodeId phaseId ) : void
CheckAdminAccess ( ISystemContext context ) : bool

Checks if the current session has admin priviledges.

CheckWriteAccess ( ServerSystemContext context, RemoteNode remoteNode ) : bool

Checks if the current user has write access to the remote node.

CollectRequests ( ServerSystemContext context, IList monitoredItems ) : List
GrantLockToSession ( ISystemContext context, Opc.Ua.NodeId sessionId, Opc.Ua.NodeId lockId ) : void

Grants the lock to the session.

OnApproveLock ( ISystemContext context, MethodState method, Opc.Ua.NodeId objectId, IList inputArguments, IList outputArguments ) : ServiceResult
OnChangePhaseByWrite ( ISystemContext context, NodeState node, NumericRange indexRange, Opc.Ua.QualifiedName dataEncoding, object &value, Opc.Ua.StatusCode &statusCode, System.DateTime &timestamp ) : ServiceResult
OnReadPhase ( ISystemContext context, NodeState node, object &value ) : ServiceResult

Used to receive notifications when the value attribute is read or written.

OnReleaseLock ( ISystemContext context, MethodState method, Opc.Ua.NodeId objectId, IList inputArguments, IList outputArguments ) : ServiceResult
OnRequestLock ( ISystemContext context, MethodState method, Opc.Ua.NodeId objectId, IList inputArguments, IList outputArguments ) : ServiceResult
RevokeLockForSession ( ISystemContext context, Opc.Ua.NodeId sessionId, Opc.Ua.NodeId lockId ) : void

Revokes the lock to the session.

SessionHasLock ( ISystemContext context, Opc.Ua.NodeId lockId ) : bool

Returns true if the current session has the lock.

Method Details

CreateAddressSpace() public method

Does any initialization required before the address space can be used.
The externalReferences is an out parameter that allows the node manager to link to nodes in other node managers. For example, the 'Objects' node is managed by the CoreNodeManager and should have a reference to the root folder node(s) exposed by this node manager.
public CreateAddressSpace ( IDictionary externalReferences ) : void
externalReferences IDictionary
return void

DeleteAddressSpace() public method

Frees any resources allocated for the address space.
public DeleteAddressSpace ( ) : void
return void

Dispose() protected method

An overrideable version of the Dispose.
protected Dispose ( bool disposing ) : void
disposing bool
return void

DsatsDemoNodeManager() public method

Initializes the node manager.
public DsatsDemoNodeManager ( IServerInternal server, ApplicationConfiguration configuration ) : System
server IServerInternal
configuration ApplicationConfiguration
return System

GetManagerHandle() protected method

Returns a unique handle for the node.
protected GetManagerHandle ( ServerSystemContext context, Opc.Ua.NodeId nodeId, NodeState>.IDictionary cache ) : NodeHandle
context Opc.Ua.Server.ServerSystemContext
nodeId Opc.Ua.NodeId
cache NodeState>.IDictionary
return Opc.Ua.Server.NodeHandle

LoadDataSource() public method

Loads the datasource file.
public LoadDataSource ( ISystemContext context ) : void
context ISystemContext
return void

LoadDataSourceAccessRules() public method

public LoadDataSourceAccessRules ( ISystemContext context, ToolState tool, DsatsDemo declaration ) : void
context ISystemContext
tool DsatsDemo.ToolState
declaration DsatsDemo
return void

LoadDataSourceDeclarations() public method

public LoadDataSourceDeclarations ( ISystemContext context, DsatsDemo datasource ) : void
context ISystemContext
datasource DsatsDemo
return void

LoadDataSourceLocks() public method

public LoadDataSourceLocks ( ISystemContext context, DsatsDemo datasource ) : void
context ISystemContext
datasource DsatsDemo
return void

LoadDataSourcePhases() public method

public LoadDataSourcePhases ( ISystemContext context, DsatsDemo datasource ) : void
context ISystemContext
datasource DsatsDemo
return void

LoadDataSourceSources() public method

public LoadDataSourceSources ( ISystemContext context, ToolState tool, DsatsDemo datasource, DsatsDemo declaration ) : void
context ISystemContext
tool DsatsDemo.ToolState
datasource DsatsDemo
declaration DsatsDemo
return void

LoadPredefinedNodes() protected method

Loads a node set from a file or resource and addes them to the set of predefined nodes.
protected LoadPredefinedNodes ( ISystemContext context ) : NodeStateCollection
context ISystemContext
return NodeStateCollection

New() public method

Creates the NodeId for the specified node.
public New ( ISystemContext context, NodeState node ) : Opc.Ua.NodeId
context ISystemContext
node NodeState
return Opc.Ua.NodeId

OnChangeLockByWrite() public method

public OnChangeLockByWrite ( ISystemContext context, NodeState node, NumericRange indexRange, Opc.Ua.QualifiedName dataEncoding, object &value, Opc.Ua.StatusCode &statusCode, System.DateTime &timestamp ) : ServiceResult
context ISystemContext
node NodeState
indexRange Opc.Ua.NumericRange
dataEncoding Opc.Ua.QualifiedName
value object
statusCode Opc.Ua.StatusCode
timestamp System.DateTime
return Opc.Ua.ServiceResult

OnChangePhase() public method

Handles a request to change the phase.
public OnChangePhase ( ISystemContext context, MethodState method, Opc.Ua.NodeId objectId, Opc.Ua.NodeId phaseId ) : ServiceResult
context ISystemContext
method Opc.Ua.MethodState
objectId Opc.Ua.NodeId
phaseId Opc.Ua.NodeId
return Opc.Ua.ServiceResult

OnCreateMonitoredItemsComplete() protected method

protected OnCreateMonitoredItemsComplete ( ServerSystemContext context, IList monitoredItems ) : void
context Opc.Ua.Server.ServerSystemContext
monitoredItems IList
return void

OnDeleteMonitoredItemsComplete() protected method

protected OnDeleteMonitoredItemsComplete ( ServerSystemContext context, IList monitoredItems ) : void
context Opc.Ua.Server.ServerSystemContext
monitoredItems IList
return void

OnModifyMonitoredItemsComplete() protected method

protected OnModifyMonitoredItemsComplete ( ServerSystemContext context, IList monitoredItems ) : void
context Opc.Ua.Server.ServerSystemContext
monitoredItems IList
return void

OnSetMonitoringModeComplete() protected method

protected OnSetMonitoringModeComplete ( ServerSystemContext context, IList monitoredItems ) : void
context Opc.Ua.Server.ServerSystemContext
monitoredItems IList
return void

Read() public method

Reads the value for the specified attribute.
public Read ( OperationContext context, double maxAge, IList nodesToRead, IList values, IList errors ) : void
context Opc.Ua.Server.OperationContext
maxAge double
nodesToRead IList
values IList
errors IList
return void

SessionClosing() public method

Called when a session is closed.
public SessionClosing ( OperationContext context, Opc.Ua.NodeId sessionId, bool deleteSubscriptions ) : void
context Opc.Ua.Server.OperationContext
sessionId Opc.Ua.NodeId
deleteSubscriptions bool
return void

ValidateNode() protected method

Verifies that the specified node exists.
protected ValidateNode ( ServerSystemContext context, NodeHandle handle, NodeState>.IDictionary cache ) : NodeState
context Opc.Ua.Server.ServerSystemContext
handle Opc.Ua.Server.NodeHandle
cache NodeState>.IDictionary
return NodeState

Write() public method

Writes the value for the specified attributes.
public Write ( OperationContext context, IList nodesToWrite, IList errors ) : void
context Opc.Ua.Server.OperationContext
nodesToWrite IList
errors IList
return void