Opc.Ua.Server.StandardServer.HistoryRead C# (CSharp) Method

HistoryRead() public method

Invokes the HistoryRead service.
public HistoryRead ( RequestHeader requestHeader, ExtensionObject historyReadDetails, TimestampsToReturn timestampsToReturn, bool releaseContinuationPoints, HistoryReadValueIdCollection nodesToRead, HistoryReadResultCollection &results, DiagnosticInfoCollection &diagnosticInfos ) : ResponseHeader
requestHeader RequestHeader The request header.
historyReadDetails ExtensionObject The history read details.
timestampsToReturn TimestampsToReturn The timestamps to return.
releaseContinuationPoints bool if set to true continuation points are released.
nodesToRead HistoryReadValueIdCollection The nodes to read.
results HistoryReadResultCollection The results.
diagnosticInfos DiagnosticInfoCollection The diagnostic information for the results.
return ResponseHeader
        public override ResponseHeader HistoryRead(
            RequestHeader                   requestHeader, 
            ExtensionObject                 historyReadDetails, 
            TimestampsToReturn              timestampsToReturn, 
            bool                            releaseContinuationPoints, 
            HistoryReadValueIdCollection    nodesToRead, 
            out HistoryReadResultCollection results, 
            out DiagnosticInfoCollection    diagnosticInfos)
        {
            OperationContext context = ValidateRequest(requestHeader, RequestType.HistoryRead);
            
            try
            {
                if (nodesToRead == null || nodesToRead.Count == 0)
                {            
                    throw new ServiceResultException(StatusCodes.BadNothingToDo);
                }

                m_serverInternal.NodeManager.HistoryRead(
                    context,
                    historyReadDetails,
                    timestampsToReturn,
                    releaseContinuationPoints,
                    nodesToRead,
                    out results,
                    out diagnosticInfos);            

                return CreateResponse(requestHeader, context.StringTable);   
            }
            catch (ServiceResultException e)
            {
                lock (ServerInternal.DiagnosticsLock)
                {
                    ServerInternal.ServerDiagnostics.RejectedRequestsCount++;

                    if (IsSecurityError(e.StatusCode))
                    {
                        ServerInternal.ServerDiagnostics.SecurityRejectedRequestsCount++;
                    }
                }

                throw TranslateException(context, e);
            }  
            finally
            {
                OnRequestComplete(context);
            } 
        }