public SetMonitoringMode ( RequestHeader requestHeader, uint subscriptionId, MonitoringMode monitoringMode, UInt32Collection monitoredItemIds, StatusCodeCollection &results, DiagnosticInfoCollection &diagnosticInfos ) : ResponseHeader | ||
requestHeader | RequestHeader | The request header. |
subscriptionId | uint | The subscription id. |
monitoringMode | MonitoringMode | The monitoring mode to be set for the MonitoredItems. |
monitoredItemIds | UInt32Collection | The list of MonitoredItems to modify. |
results | StatusCodeCollection | The list of results for the MonitoredItems to modify. |
diagnosticInfos | DiagnosticInfoCollection | The diagnostic information for the results. |
Résultat | ResponseHeader |
public override ResponseHeader SetMonitoringMode(
RequestHeader requestHeader,
uint subscriptionId,
MonitoringMode monitoringMode,
UInt32Collection monitoredItemIds,
out StatusCodeCollection results,
out DiagnosticInfoCollection diagnosticInfos)
{
OperationContext context = ValidateRequest(requestHeader, RequestType.SetMonitoringMode);
try
{
if (monitoredItemIds == null || monitoredItemIds.Count == 0)
{
throw new ServiceResultException(StatusCodes.BadNothingToDo);
}
ServerInternal.SubscriptionManager.SetMonitoringMode(
context,
subscriptionId,
monitoringMode,
monitoredItemIds,
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);
}
}