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);
}
}