using System;
+using System.Collections.Generic;
using System.Diagnostics.Contracts;
+using System.IO;
+using System.Linq;
+using System.Threading;
using Pithos.Interfaces;
namespace Pithos.Core
{
void SetFileOverlayStatus(string path,FileOverlayStatus status);
void UpdateFileChecksum(string path, string checksum);
- void RemoveFileOverlayStatus(string path);
void SetFileStatus(string path, FileStatus status);
FileStatus GetFileStatus(string path);
void ClearFileStatus(string path);
+ void SetPithosStatus(PithosStatus status);
+ FileOverlayStatus GetFileOverlayStatus(string path);
+ void ProcessExistingFiles(IEnumerable<FileInfo> paths);
+ void Stop();
+ void SetFileState(string path, FileStatus fileStatus, FileOverlayStatus overlayStatus);
+ void StoreInfo(string path, ObjectInfo objectInfo);
+ T GetStatus<T>(string path,Func<FileState,T> getter,T defaultValue );
+ void SetStatus(string path, Action<FileState> setter);
+
+ void StartProcessing(CancellationToken token);
+
+ string BlockHash { get; set; }
+ int BlockSize { get; set; }
+ void ChangeRoots(string oldPath, string newPath);
}
[ContractClassFor(typeof(IStatusKeeper))]
public void SetFileOverlayStatus(string path, FileOverlayStatus status)
{
Contract.Requires(!String.IsNullOrWhiteSpace(path));
+ Contract.Requires(Path.IsPathRooted(path));
}
public void UpdateFileChecksum(string path, string checksum)
{
Contract.Requires(!String.IsNullOrWhiteSpace(path));
Contract.Requires(checksum!=null);
+ Contract.Requires(Path.IsPathRooted(path));
}
- public void RemoveFileOverlayStatus(string path)
+ /* public void RemoveFileOverlayStatus(string path)
{
Contract.Requires(!String.IsNullOrWhiteSpace(path));
- }
+ Contract.Requires(Path.IsPathRooted(path));
+ }*/
public void RenameFileOverlayStatus(string oldPath, string newPath)
{
Contract.Requires(!String.IsNullOrWhiteSpace(oldPath));
+ Contract.Requires(Path.IsPathRooted(oldPath));
Contract.Requires(!String.IsNullOrWhiteSpace(newPath));
+ Contract.Requires(Path.IsPathRooted(newPath));
}
public void SetFileStatus(string path, FileStatus status)
{
Contract.Requires(!String.IsNullOrWhiteSpace(path));
+ Contract.Requires(Path.IsPathRooted(path));
}
public FileStatus GetFileStatus(string path)
{
Contract.Requires(!String.IsNullOrWhiteSpace(path));
+ Contract.Requires(Path.IsPathRooted(path));
return default(FileStatus);
}
+ public FileOverlayStatus GetFileOverlayStatus(string path)
+ {
+ Contract.Requires(!String.IsNullOrWhiteSpace(path));
+ Contract.Requires(Path.IsPathRooted(path));
+
+ return default(FileOverlayStatus);
+ }
+
+ public void ProcessExistingFiles(IEnumerable<FileInfo> paths)
+ {
+ Contract.Requires(paths!=null);
+ }
+
+ public void Stop()
+ {
+
+ }
+
+ public void SetFileState(string path, FileStatus fileStatus, FileOverlayStatus overlayStatus)
+ {
+ Contract.Requires(!String.IsNullOrWhiteSpace(path));
+ Contract.Requires(Path.IsPathRooted(path));
+ }
+
+ public void StoreInfo(string path, ObjectInfo objectInfo)
+ {
+ Contract.Requires(!String.IsNullOrWhiteSpace(path));
+ Contract.Requires(objectInfo!=null);
+ Contract.Requires(Path.IsPathRooted(path));
+ }
+
+ public T GetStatus<T>(string path, Func<FileState, T> getter, T defaultValue)
+ {
+ Contract.Requires(!String.IsNullOrWhiteSpace(path));
+ Contract.Requires(getter!=null);
+ Contract.Requires(Path.IsPathRooted(path));
+
+ return default(T);
+ }
+
+ public void SetStatus(string path, Action<FileState> setter)
+ {
+ Contract.Requires(!String.IsNullOrWhiteSpace(path));
+ Contract.Requires(setter != null);
+ Contract.Requires(Path.IsPathRooted(path));
+ }
+
+ public void SetNetworkState(string path, NetworkOperation operation)
+ {
+ Contract.Requires(!String.IsNullOrWhiteSpace(path));
+ Contract.Requires(Path.IsPathRooted(path));
+ Contract.Requires(Path.IsPathRooted(path));
+ }
+
+ public NetworkOperation GetNetworkState(string path)
+ {
+ Contract.Requires(!String.IsNullOrWhiteSpace(path));
+ Contract.Requires(Path.IsPathRooted(path));
+
+ return default(NetworkOperation);
+ }
+
public void ClearFileStatus(string path)
{
Contract.Requires(!String.IsNullOrWhiteSpace(path));
+ Contract.Requires(Path.IsPathRooted(path));
+ }
+
+ public void SetPithosStatus(PithosStatus status)
+ {
+ }
+
+ public void StartProcessing(CancellationToken token)
+ {
+ Contract.Requires(token != null, "token can't be empty");
+ }
+
+ public abstract string BlockHash { get; set; }
+ public abstract int BlockSize { get; set; }
+ public void ChangeRoots(string oldPath, string newPath)
+ {
+ Contract.Requires(!String.IsNullOrWhiteSpace(oldPath));
+ Contract.Requires(Path.IsPathRooted(oldPath));
+ Contract.Requires(!string.IsNullOrWhiteSpace(newPath));
+ Contract.Requires(Path.IsPathRooted(newPath));
}
}
}