Modifications to enable Sync Pausing for all operations
[pithos-ms-client] / trunk / Pithos.Core / Agents / DeleteAgent.cs
index bf3dc2d..6659b8a 100644 (file)
@@ -65,6 +65,8 @@ namespace Pithos.Core.Agents
 
         [Import]
         public IStatusKeeper StatusKeeper { get; set; }
+        
+        public IStatusNotification StatusNotification { get; set; }
 
         //A separate agent is used to execute delete actions immediatelly;
         private readonly ActionBlock<CloudDeleteAction> _deleteAgent;
@@ -111,7 +113,7 @@ namespace Pithos.Core.Agents
 
             var accountInfo = action.AccountInfo;
 
-            using (log4net.ThreadContext.Stacks["NETWORK"].Push("PROCESS"))
+            using (log4net.ThreadContext.Stacks["Operation"].Push("ProcessDelete"))
             {
                 Log.InfoFormat("[ACTION] Start Processing {0}", action);
 
@@ -212,7 +214,7 @@ namespace Pithos.Core.Agents
 
             var fileAgent = GetFileAgent(accountInfo);
 
-            using (ThreadContext.Stacks["DeleteCloudFile"].Push("Delete"))
+            using (ThreadContext.Stacks["Operation"].Push("DeleteCloudFile"))
             {
                 var fileName = cloudFile.RelativeUrlToFilePath(accountInfo.UserName);
                 var info = fileAgent.GetFileSystemInfo(fileName);
@@ -227,6 +229,7 @@ namespace Pithos.Core.Agents
                 client.DeleteObject(account, container, cloudFile.Name);
 
                 StatusKeeper.ClearFileStatus(fullPath);
+                StatusNotification.Notify(new CloudNotification{Data=cloudFile});
             }
         }