コード例 #1
0
 public bool SkipItemOperation(COWSettings settings, IDumpsterItemOperations dumpster, COWTriggerAction operation, COWTriggerActionState state, StoreSession session, StoreObjectId itemId, CoreItem item, bool onBeforeNotification, bool onDumpster, bool success, CallbackContext callbackContext)
 {
     Util.ThrowOnNullArgument(settings, "settings");
     Util.ThrowOnNullArgument(session, "session");
     Util.ThrowOnNullArgument(dumpster, "dumpster");
     EnumValidator.ThrowIfInvalid <COWTriggerAction>(operation, "operation");
     EnumValidator.ThrowIfInvalid <COWTriggerActionState>(state, "state");
     if (onDumpster)
     {
         ExTraceGlobals.CalendarLoggingTracer.Information <string>((long)session.GetHashCode(), "Skipping calendar COW item operation for user {0}, since the operation is on dumpster", session.UserLegacyDN);
         return(true);
     }
     if (!CalendarLoggingHelper.ShouldLog(operation))
     {
         ExTraceGlobals.CalendarLoggingTracer.Information <string, COWTriggerAction>((long)session.GetHashCode(), "Skipping calendar COW item operation for user {0}, since the trigger action {1} is not interesting", session.UserLegacyDN, operation);
         return(true);
     }
     if (!onBeforeNotification && operation != COWTriggerAction.Update)
     {
         ExTraceGlobals.CalendarLoggingTracer.Information <string>((long)session.GetHashCode(), "Skipping calendar COW item operation for user {0}, since we are only interested in on-before notifications and update trigger actions", session.UserLegacyDN);
         return(true);
     }
     if (COWSettings.IsImapPoisonMessage(onBeforeNotification, operation, session, item))
     {
         ExTraceGlobals.CalendarLoggingTracer.Information <string>((long)session.GetHashCode(), "Skipping calendar COW item operation for user {0}, since the items is marked as IMAP poison message", session.UserLegacyDN);
         return(true);
     }
     if (!settings.IsCalendarLoggingEnabled())
     {
         ExTraceGlobals.CalendarLoggingTracer.Information <string>((long)session.GetHashCode(), "Skipping calendar COW item operation for user {0}, since calendar logging is disabled for this user", session.UserLegacyDN);
         return(true);
     }
     return(false);
 }
コード例 #2
0
 public CowClientOperationSensitivity SkipGroupOperation(COWSettings settings, IDumpsterItemOperations dumpster, COWTriggerAction operation, FolderChangeOperationFlags flags, StoreSession sourceSession, StoreSession destinationSession, StoreObjectId sourceFolderId, StoreObjectId destinationFolderId, ICollection <StoreObjectId> itemIds, bool onBeforeNotification, bool onDumpster, CallbackContext callbackContext)
 {
     EnumValidator.ThrowIfInvalid <COWTriggerAction>(operation, "operation");
     EnumValidator.ThrowIfInvalid <FolderChangeOperationFlags>(flags, "flags");
     Util.ThrowOnNullArgument(settings, "settings");
     Util.ThrowOnNullArgument(sourceSession, "sourceSession");
     Util.ThrowOnNullArgument(dumpster, "dumpster");
     if (onDumpster)
     {
         ExTraceGlobals.CalendarLoggingTracer.Information <string>((long)sourceSession.GetHashCode(), "Skipping calendar COW group operation for user {0}, since the operation is on dumpster", sourceSession.UserLegacyDN);
         return(CowClientOperationSensitivity.Skip);
     }
     if (!onBeforeNotification)
     {
         ExTraceGlobals.CalendarLoggingTracer.Information <string>((long)sourceSession.GetHashCode(), "Skipping calendar COW group operation for user {0}, since we are only interested in on-before notifications", sourceSession.UserLegacyDN);
         return(CowClientOperationSensitivity.Skip);
     }
     if (!CalendarLoggingHelper.ShouldLog(operation))
     {
         ExTraceGlobals.CalendarLoggingTracer.Information <string, COWTriggerAction>((long)sourceSession.GetHashCode(), "Skipping calendar COW group operation for user {0}, since the trigger action {1} is not interesting", sourceSession.UserLegacyDN, operation);
         return(CowClientOperationSensitivity.Skip);
     }
     if (DumpsterFolderHelper.IsAuditFolder(callbackContext.SessionWithBestAccess, sourceFolderId))
     {
         ExTraceGlobals.CalendarLoggingTracer.Information <string>((long)sourceSession.GetHashCode(), "Skipping calendar COW group operation for user {0}, since the operation is on audit folder", sourceSession.UserLegacyDN);
         return(CowClientOperationSensitivity.Skip);
     }
     if (!settings.IsCalendarLoggingEnabled())
     {
         ExTraceGlobals.CalendarLoggingTracer.Information <string>((long)sourceSession.GetHashCode(), "Skipping calendar COW group operation for user {0}, since calendar logging is disabled for this user", sourceSession.UserLegacyDN);
         return(CowClientOperationSensitivity.Skip);
     }
     if (!DumpsterFolderHelper.IsDumpsterFolder(callbackContext.SessionWithBestAccess, sourceFolderId))
     {
         return(CowClientOperationSensitivity.Capture);
     }
     if (operation == COWTriggerAction.HardDelete && !sourceFolderId.Equals(dumpster.CalendarLoggingFolderId))
     {
         return(CowClientOperationSensitivity.Capture);
     }
     ExTraceGlobals.CalendarLoggingTracer.Information <string>((long)sourceSession.GetHashCode(), "Skipping calendar COW group operation for user {0}, since we are not interested in hard deletes in calendar logging folder", sourceSession.UserLegacyDN);
     return(CowClientOperationSensitivity.Skip);
 }