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

ModifyMonitoredItems() public method

Invokes the ModifyMonitoredItems service.
public ModifyMonitoredItems ( RequestHeader requestHeader, uint subscriptionId, TimestampsToReturn timestampsToReturn, MonitoredItemModifyRequestCollection itemsToModify, MonitoredItemModifyResultCollection &results, DiagnosticInfoCollection &diagnosticInfos ) : ResponseHeader
requestHeader RequestHeader The request header.
subscriptionId uint The subscription id.
timestampsToReturn TimestampsToReturn The type of timestamps to be returned for the MonitoredItems.
itemsToModify MonitoredItemModifyRequestCollection The list of MonitoredItems to modify.
results MonitoredItemModifyResultCollection The list of results for the MonitoredItems to modify.
diagnosticInfos DiagnosticInfoCollection The diagnostic information for the results.
return ResponseHeader
        public override ResponseHeader ModifyMonitoredItems(
            RequestHeader                           requestHeader, 
            uint                                    subscriptionId, 
            TimestampsToReturn                      timestampsToReturn,
            MonitoredItemModifyRequestCollection    itemsToModify, 
            out MonitoredItemModifyResultCollection results, 
            out DiagnosticInfoCollection            diagnosticInfos)
        {
            OperationContext context = ValidateRequest(requestHeader, RequestType.ModifyMonitoredItems);

            try
            {
                if (itemsToModify == null || itemsToModify.Count == 0)
                {
                    throw new ServiceResultException(StatusCodes.BadNothingToDo);
                }         

                ServerInternal.SubscriptionManager.ModifyMonitoredItems(
                    context,
                    subscriptionId,
                    timestampsToReturn,
                    itemsToModify,
                    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);
            }    
        }