Opc.Ua.Server.MasterNodeManager.UpdateReferenceDescription C# (CSharp) Method

UpdateReferenceDescription() private method

Updates the reference description with the node attributes.
private UpdateReferenceDescription ( OperationContext context, NodeId targetId, NodeClass nodeClassMask, BrowseResultMask resultMask, ReferenceDescription description ) : bool
context OperationContext
targetId NodeId
nodeClassMask NodeClass
resultMask BrowseResultMask
description ReferenceDescription
return bool
        private bool UpdateReferenceDescription(
            OperationContext     context,
            NodeId               targetId,
            NodeClass            nodeClassMask,
            BrowseResultMask     resultMask,
            ReferenceDescription description)
        {
            if (targetId == null)    throw new ArgumentNullException("targetId");
            if (description == null) throw new ArgumentNullException("description");
                        
            // find node manager that owns the node.
            INodeManager nodeManager = null;                
            object handle = GetManagerHandle(targetId, out nodeManager);

            // dangling reference - nothing more to do.
            if (handle == null)
            {
                return false;
            }

            // fetch the node attributes.
            NodeMetadata metadata = nodeManager.GetNodeMetadata(context, handle, resultMask);

            if (metadata == null)
            {
                return false;
            }

            // check nodeclass filter.
            if (nodeClassMask != NodeClass.Unspecified && (metadata.NodeClass & nodeClassMask) == 0)
            {
                return false;
            }

            // update attributes.
            description.NodeId = metadata.NodeId;
            
            description.SetTargetAttributes(
                resultMask,
                metadata.NodeClass,
                metadata.BrowseName,
                metadata.DisplayName,
                metadata.TypeDefinition);

            description.Unfiltered = false;

            return true;
        }