Fixed release confgurations
[pithos-ms-client] / trunk / Pithos.Core / IStatusKeeper.cs
index ce005c0..f1997ac 100644 (file)
@@ -46,6 +46,7 @@ using System.IO;
 using System.Linq;\r
 using System.Threading;\r
 using System.Threading.Tasks;\r
+using NHibernate;\r
 using Pithos.Interfaces;\r
 using Pithos.Network;\r
 \r
@@ -54,9 +55,9 @@ namespace Pithos.Core
     [ContractClass(typeof(IStatusKeeperContract))]\r
     public interface IStatusKeeper\r
     {\r
-        Task SetFileOverlayStatus(string path, FileOverlayStatus status);\r
+        void SetFileOverlayStatus(string path, FileOverlayStatus status);\r
         void UpdateFileChecksum(string path, string etag, TreeHash treeHash);\r
-        void UpdateFileTreeHash(string path, TreeHash treeHash);\r
+        void UpdateFileHashes(string path, TreeHash treeHash);\r
         void SetFileStatus(string path, FileStatus status);\r
         FileStatus GetFileStatus(string path);\r
         void ClearFileStatus(string path);\r
@@ -75,6 +76,8 @@ namespace Pithos.Core
         string BlockHash { get; set; }\r
         int BlockSize { get; set; }\r
         IStatusNotification StatusNotification { get; set; }\r
+        //ISessionFactory Factory { get; }\r
+        //IQueryable<T> Query<T>();\r
 \r
         void ChangeRoots(string oldPath, string newPath);\r
         FileState GetStateByFilePath(string path);\r
@@ -85,16 +88,28 @@ namespace Pithos.Core
         void CleanupStaleStates(Network.AccountInfo accountInfo, List<ObjectInfo> objectInfos);\r
         void CleanupOrphanStates();\r
         //void UpdateLastMD5(FileInfo path, string etag);\r
+        void SaveCopy<T>(T state) where T:class;\r
+\r
+        /// <summary>\r
+        /// Mark Unversioned all FileState rows from the database whose path\r
+        /// starts with one of the removed paths\r
+        /// </summary>\r
+        /// <param name="removed"></param>\r
+        void UnversionPaths(List<string> removed);\r
+\r
+        List<FileState> GetAllStates();\r
+        List<string> GetAllStatePaths();\r
+        List<FileState> GetConflictStates();\r
     }\r
 \r
     [ContractClassFor(typeof(IStatusKeeper))]\r
     public abstract class IStatusKeeperContract : IStatusKeeper\r
     {\r
-        public Task SetFileOverlayStatus(string path, FileOverlayStatus status)\r
+        public void SetFileOverlayStatus(string path, FileOverlayStatus status)\r
         {\r
             Contract.Requires(!String.IsNullOrWhiteSpace(path));\r
             Contract.Requires(Path.IsPathRooted(path));\r
-            return default(Task);\r
+            \r
         }\r
 \r
         public void UpdateFileChecksum(string path, string etag, TreeHash treeHash)\r
@@ -104,7 +119,7 @@ namespace Pithos.Core
             Contract.Requires(Path.IsPathRooted(path));\r
         }\r
 \r
-        public void UpdateFileTreeHash(string path, TreeHash treeHash)\r
+        public void UpdateFileHashes(string path, TreeHash treeHash)\r
         {\r
             Contract.Requires(!String.IsNullOrWhiteSpace(path));\r
             Contract.Requires(treeHash!=null);\r
@@ -230,6 +245,13 @@ namespace Pithos.Core
 \r
         public IStatusNotification StatusNotification { get; set; }\r
 \r
+        public ISessionFactory Factory { get; private set; }\r
+\r
+        public IQueryable<T> Query<T>()\r
+        {\r
+            throw new NotImplementedException();\r
+        }\r
+\r
         public void ChangeRoots(string oldPath, string newPath)\r
         {\r
             Contract.Requires(!String.IsNullOrWhiteSpace(oldPath));\r
@@ -276,9 +298,33 @@ namespace Pithos.Core
         {            \r
         }\r
 \r
-        public void UpdateLastMD5(FileInfo path, string etag)\r
+        public void SaveCopy<T>(T state) where T:class\r
         {\r
-            \r
+            Contract.Requires(state != null);\r
+        }\r
+\r
+        public void UnversionPaths(List<string> removed)\r
+        {\r
+            Contract.Requires(removed!=null);\r
+        }\r
+\r
+        public List<FileState> GetAllStates()\r
+        {\r
+            return null;\r
+        }\r
+\r
+        public List<string> GetAllStatePaths()\r
+        {\r
+            return null;\r
         }\r
+\r
+        public List<FileState> GetConflictStates()\r
+        {\r
+            return null;\r
+        }\r
+\r
+        //public void UpdateLastMD5(FileInfo path, string etag)\r
+        //{            \r
+        //}\r
     }\r
 }\r