[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;
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);
_deleteAgent.Post(action);
}
- private void DeleteCloudFile(AccountInfo accountInfo, ObjectInfo cloudFile)
+ public void DeleteCloudFile(AccountInfo accountInfo, ObjectInfo cloudFile)
{
if (accountInfo == null)
throw new ArgumentNullException("accountInfo");
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);
var fullPath = info.FullName.ToLower();
- StatusKeeper.SetFileOverlayStatus(fullPath, FileOverlayStatus.Modified);
+ StatusKeeper.SetFileOverlayStatus(fullPath, FileOverlayStatus.Modified).Wait();
var account = cloudFile.Account ?? accountInfo.UserName;
var container = cloudFile.Container;//?? FolderConstants.PithosContainer;
client.DeleteObject(account, container, cloudFile.Name);
StatusKeeper.ClearFileStatus(fullPath);
+ StatusNotification.Notify(new CloudNotification{Data=cloudFile});
}
}