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

HistoryUpdate() public method

Invokes the HistoryUpdate service.
public HistoryUpdate ( RequestHeader requestHeader, ExtensionObjectCollection historyUpdateDetails, HistoryUpdateResultCollection &results, DiagnosticInfoCollection &diagnosticInfos ) : ResponseHeader
requestHeader RequestHeader The request header.
historyUpdateDetails ExtensionObjectCollection The details defined for the update.
results HistoryUpdateResultCollection The list of update results for the history update details.
diagnosticInfos DiagnosticInfoCollection The diagnostic information for the results.
return ResponseHeader
        public override ResponseHeader HistoryUpdate(
            RequestHeader                     requestHeader,
            ExtensionObjectCollection         historyUpdateDetails,
            out HistoryUpdateResultCollection results,
            out DiagnosticInfoCollection      diagnosticInfos)
        {   
            OperationContext context = ValidateRequest(requestHeader, RequestType.HistoryUpdate);
            
            try
            {
                if (historyUpdateDetails == null || historyUpdateDetails.Count == 0)
                {            
                    throw new ServiceResultException(StatusCodes.BadNothingToDo);
                }

                m_serverInternal.NodeManager.HistoryUpdate(
                    context,
                    historyUpdateDetails,
                    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);
            }
        }