root / trunk / Pithos.Core / IStatusKeeper.cs @ 0eea575a
History | View | Annotate | Download (2.6 kB)
1 |
using System; |
---|---|
2 |
using System.Collections.Generic; |
3 |
using System.Diagnostics.Contracts; |
4 |
using System.Linq; |
5 |
using Pithos.Interfaces; |
6 |
|
7 |
namespace Pithos.Core |
8 |
{ |
9 |
[ContractClass(typeof(IStatusKeeperContract))] |
10 |
public interface IStatusKeeper |
11 |
{ |
12 |
void SetFileOverlayStatus(string path,FileOverlayStatus status); |
13 |
void UpdateFileChecksum(string path, string checksum); |
14 |
void RemoveFileOverlayStatus(string path); |
15 |
void SetFileStatus(string path, FileStatus status); |
16 |
FileStatus GetFileStatus(string path); |
17 |
void ClearFileStatus(string path); |
18 |
void SetPithosStatus(PithosStatus status); |
19 |
FileOverlayStatus GetFileOverlayStatus(string path); |
20 |
IEnumerable<string> StoreUnversionedFiles(ParallelQuery<string> paths); |
21 |
void Stop(); |
22 |
} |
23 |
|
24 |
[ContractClassFor(typeof(IStatusKeeper))] |
25 |
public abstract class IStatusKeeperContract : IStatusKeeper |
26 |
{ |
27 |
public void SetFileOverlayStatus(string path, FileOverlayStatus status) |
28 |
{ |
29 |
Contract.Requires(!String.IsNullOrWhiteSpace(path)); |
30 |
} |
31 |
|
32 |
public void UpdateFileChecksum(string path, string checksum) |
33 |
{ |
34 |
Contract.Requires(!String.IsNullOrWhiteSpace(path)); |
35 |
Contract.Requires(checksum!=null); |
36 |
} |
37 |
|
38 |
public void RemoveFileOverlayStatus(string path) |
39 |
{ |
40 |
Contract.Requires(!String.IsNullOrWhiteSpace(path)); |
41 |
} |
42 |
|
43 |
public void RenameFileOverlayStatus(string oldPath, string newPath) |
44 |
{ |
45 |
Contract.Requires(!String.IsNullOrWhiteSpace(oldPath)); |
46 |
Contract.Requires(!String.IsNullOrWhiteSpace(newPath)); |
47 |
|
48 |
} |
49 |
|
50 |
public void SetFileStatus(string path, FileStatus status) |
51 |
{ |
52 |
Contract.Requires(!String.IsNullOrWhiteSpace(path)); |
53 |
} |
54 |
|
55 |
public FileStatus GetFileStatus(string path) |
56 |
{ |
57 |
Contract.Requires(!String.IsNullOrWhiteSpace(path)); |
58 |
|
59 |
return default(FileStatus); |
60 |
} |
61 |
|
62 |
public FileOverlayStatus GetFileOverlayStatus(string path) |
63 |
{ |
64 |
Contract.Requires(!String.IsNullOrWhiteSpace(path)); |
65 |
|
66 |
return default(FileOverlayStatus); |
67 |
} |
68 |
|
69 |
public IEnumerable<string> StoreUnversionedFiles(ParallelQuery<string> paths) |
70 |
{ |
71 |
Contract.Requires(paths!=null); |
72 |
|
73 |
return default(IEnumerable<string>); |
74 |
} |
75 |
|
76 |
public void Stop() |
77 |
{ |
78 |
|
79 |
} |
80 |
|
81 |
public void ClearFileStatus(string path) |
82 |
{ |
83 |
Contract.Requires(!String.IsNullOrWhiteSpace(path)); |
84 |
} |
85 |
|
86 |
public void SetPithosStatus(PithosStatus status) |
87 |
{ |
88 |
} |
89 |
} |
90 |
} |