// ------------------------------------------------------------ // Copyright (c) 2005-2025 The OPC Foundation, Inc. All rights reserved. // Licensed under the MIT License (MIT). See License.txt in the repo root for license information. // ------------------------------------------------------------ using System.Threading; using System.Threading.Tasks; namespace Opc.Ua.Client { /// /// Interface between node cache and a session /// public interface INodeCacheContext { /// /// Gets the table of namespace uris known to the server. /// NamespaceTable NamespaceUris { get; } /// /// Get the table with the server uris known to the server. /// StringTable ServerUris { get; } /// /// Reads the values for the node attributes and returns a node object /// collection. /// /// /// If the nodeclass for the nodes in nodeIdCollection is already known /// and passed as nodeClass, reads only values of required attributes. /// Otherwise NodeClass.Unspecified should be used. /// /// Request header to use /// The nodeId collection to read. /// If optional attributes should /// not be read. /// The cancellation token. /// The node collection and associated errors. ValueTask> FetchNodesAsync( RequestHeader? requestHeader, ArrayOf nodeIds, bool skipOptionalAttributes = false, CancellationToken ct = default); /// /// Reads the values for the node attributes and returns a node object /// collection. /// /// /// If the nodeclass for the nodes in nodeIdCollection is already known /// and passed as nodeClass, reads only values of required attributes. /// Otherwise NodeClass.Unspecified should be used. /// /// Request header to use /// The nodeId collection to read. /// The nodeClass of all nodes in the collection. /// Set to NodeClass.Unspecified if the nodeclass is unknown. /// Set to true if optional /// attributes should omitted. /// The cancellation token. /// The node collection and associated errors. ValueTask> FetchNodesAsync( RequestHeader? requestHeader, ArrayOf nodeIds, NodeClass nodeClass, bool skipOptionalAttributes = false, CancellationToken ct = default); /// /// Reads the values for the node attributes and returns a node object. /// /// /// If the nodeclass is known, only the supported attribute values are /// read. /// /// Request header to use /// The nodeId. /// The nodeclass of the node to read. /// Skip reading optional attributes. /// The cancellation token for the request. ValueTask FetchNodeAsync( RequestHeader? requestHeader, NodeId nodeId, NodeClass nodeClass = NodeClass.Unspecified, bool skipOptionalAttributes = false, CancellationToken ct = default); /// /// Fetches all references for the specified node. /// /// Request header to use /// The node id. /// ValueTask> FetchReferencesAsync( RequestHeader? requestHeader, NodeId nodeId, CancellationToken ct = default); /// /// Fetches all references for the specified nodes. /// /// Request header to use /// The node id collection. /// /// A list of reference collections and the errors reported by the /// server. ValueTask>> FetchReferencesAsync( RequestHeader? requestHeader, ArrayOf nodeIds, CancellationToken ct = default); /// /// Reads the value for a node. /// /// Request header to use /// The node Id. /// The cancellation token for the request. ValueTask FetchValueAsync( RequestHeader? requestHeader, NodeId nodeId, CancellationToken ct = default); /// /// Reads the values for a node collection. Returns diagnostic errors. /// /// Request header to use /// The node Id. /// The cancellation token for the request. ValueTask> FetchValuesAsync( RequestHeader? requestHeader, ArrayOf nodeIds, CancellationToken ct = default); } }