public override ResponseHeader SetTriggering(
RequestHeader requestHeader,
uint subscriptionId,
uint triggeringItemId,
UInt32Collection linksToAdd,
UInt32Collection linksToRemove,
out StatusCodeCollection addResults,
out DiagnosticInfoCollection addDiagnosticInfos,
out StatusCodeCollection removeResults,
out DiagnosticInfoCollection removeDiagnosticInfos)
{
addResults = null;
addDiagnosticInfos = null;
removeResults = null;
removeDiagnosticInfos = null;
OperationContext context = ValidateRequest(requestHeader, RequestType.SetTriggering);
try
{
if ((linksToAdd == null || linksToAdd.Count == 0) && (linksToRemove == null || linksToRemove.Count == 0))
{
throw new ServiceResultException(StatusCodes.BadNothingToDo);
}
ServerInternal.SubscriptionManager.SetTriggering(
context,
subscriptionId,
triggeringItemId,
linksToAdd,
linksToRemove,
out addResults,
out addDiagnosticInfos,
out removeResults,
out removeDiagnosticInfos);
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);
}
}