Added Tags retrieval
[pithos-ms-client] / trunk / Pithos.Interfaces / ICloudClient.cs
index 6db6591..dd293cd 100644 (file)
@@ -4,6 +4,7 @@ using System.Diagnostics.Contracts;
 using System.IO;
 using System.Linq;
 using System.Text;
+using System.Threading.Tasks;
 
 namespace Pithos.Interfaces
 {
@@ -16,20 +17,28 @@ namespace Pithos.Interfaces
         string Token { get; set; }
         bool UsePithos { get; set; }
         void Authenticate(string userName,string apiKey);
+        Uri Proxy { get; set; }
+        double DownloadPercentLimit { get; set; }
+        double UploadPercentLimit { get; set; }
+
         
         IList<ContainerInfo> ListContainers();
         IList<ObjectInfo> ListObjects(string container);
+        IList<ObjectInfo> ListObjects(string container, string folder); 
         bool ContainerExists(string container);
         ContainerInfo GetContainerInfo(string container);
         void CreateContainer(string container);
         void DeleteContainer(string container);
         
         Stream GetObject(string container, string objectName);
-        void PutObject(string container, string objectName, string fileName,long fileSize);
+        Task PutObject(string container, string objectName, string fileName, string hash = null);
         void DeleteObject(string container, string objectName);
         void MoveObject(string container, string oldObjectName, string newObjectName);
         bool ObjectExists(string container,string objectName);
         ObjectInfo GetObjectInfo(string container, string objectName);
+        void CreateFolder(string container, string folder);
+
+
     }
 
 
@@ -40,6 +49,9 @@ namespace Pithos.Interfaces
         public string UserName { get; set; }
         public Uri StorageUrl { get; set; }
         public string Token { get; set; }
+        public Uri Proxy { get; set; }
+        public double DownloadPercentLimit { get; set; }
+        public double UploadPercentLimit { get; set; }
 
         public bool UsePithos { get; set; }
 
@@ -72,6 +84,16 @@ namespace Pithos.Interfaces
 
             return default(IList<ObjectInfo>);
         }
+        public IList<ObjectInfo> ListObjects(string container, string folder)
+        {
+            Contract.Requires(!String.IsNullOrWhiteSpace(Token));
+            Contract.Requires(StorageUrl != null);
+            Contract.Requires(!String.IsNullOrWhiteSpace(container));
+            Contract.Requires(!String.IsNullOrWhiteSpace(folder));
+
+            return default(IList<ObjectInfo>);
+        }
 
         public bool ContainerExists(string container)
         {
@@ -115,14 +137,15 @@ namespace Pithos.Interfaces
             return default(Stream);
         }
 
-        public void PutObject(string container, string objectName, string fileName,long fileSize)
+        public Task PutObject(string container, string objectName, string fileName, string hash = null)
         {
             Contract.Requires(!String.IsNullOrWhiteSpace(Token));
             Contract.Requires(StorageUrl!=null);
             Contract.Requires(!String.IsNullOrWhiteSpace(container));
-            Contract.Requires(!String.IsNullOrWhiteSpace(fileName));            
-            Contract.Requires(fileSize>=0);            
+            Contract.Requires(!String.IsNullOrWhiteSpace(fileName));                        
             Contract.Requires(!String.IsNullOrWhiteSpace(objectName));
+
+            return default(Task);
         }
 
         public void DeleteObject(string container, string objectName)
@@ -161,6 +184,14 @@ namespace Pithos.Interfaces
 
             return default(ObjectInfo);
         }
+
+        public void CreateFolder(string container, string folder)
+        {
+            Contract.Requires(!String.IsNullOrWhiteSpace(Token));
+            Contract.Requires(StorageUrl != null);
+            Contract.Requires(!String.IsNullOrWhiteSpace(container));
+            Contract.Requires(!String.IsNullOrWhiteSpace(folder));            
+        }
     }
 
     public class ContainerInfo
@@ -180,6 +211,13 @@ namespace Pithos.Interfaces
         public string Content_Type { get; set; }
         public DateTime Last_Modified { get; set; }
 
+        private Dictionary<string, string> _tags=new Dictionary<string, string>();
+        public Dictionary<string, string> Tags
+        {
+            get { return _tags; }
+            set { _tags = value; }
+        }
+
         public static ObjectInfo Empty=new ObjectInfo {Name=String.Empty,Hash=String.Empty,Bytes=0,Content_Type=String.Empty,Last_Modified=DateTime.MinValue};
     }
 }