-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIObjectManager.java
More file actions
114 lines (100 loc) · 3.24 KB
/
IObjectManager.java
File metadata and controls
114 lines (100 loc) · 3.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
package org.rmatil.sync.version.api;
import org.rmatil.sync.persistence.api.IPathElement;
import org.rmatil.sync.persistence.core.tree.ITreeStorageAdapter;
import org.rmatil.sync.persistence.exceptions.InputOutputException;
import org.rmatil.sync.version.core.model.Index;
import org.rmatil.sync.version.core.model.PathObject;
import java.util.List;
public interface IObjectManager {
/**
* Clears the index and the whole saved object history
*
* @throws InputOutputException
*/
void clear()
throws InputOutputException;
/**s
* Writes the given PathObject to the object store
*
* @param path The path object to write
*
* @throws InputOutputException If writing fails
*/
void writeObject(PathObject path)
throws InputOutputException;
/**
* Returns the path object for the given filename hash, if any
*
* @param fileNameHash The file name hash of which to get the path object
*
* @return The found path object
*
* @throws InputOutputException If reading the object store fails
*/
PathObject getObject(String fileNameHash)
throws InputOutputException;
/**
* Returns the path object for the file on the given relative path
*
* @param relativeFilePath The relative path of which to get the path object
*
* @return The path object
*
* @throws InputOutputException If reading the object store fails
*/
PathObject getObjectForPath(String relativeFilePath)
throws InputOutputException;
/**
* Returns the corresponding hash for the given file path
*
* @param relativeFilePath The file path for which to get the hash
*
* @return The hash of the specified path
*/
String getHashForPath(String relativeFilePath);
/**
* Removes the path object of the given file name hash from the object store
*
* @param fileNameHash The hash of the file name of which the path object should be removed
*
* @throws InputOutputException If removing fails
*/
void removeObject(String fileNameHash)
throws InputOutputException;
/**
* Returns all path objects which are children of the given parent file
*
* @param relativeParentFileName The relative path of the parent of which to get the children
*
* @return The list of children
*
* @throws InputOutputException If reading the object store fails
*/
List<PathObject> getChildren(String relativeParentFileName)
throws InputOutputException;
/**
* Returns the current instance of the object store's index
*
* @return The index
*/
Index getIndex();
/**
* Returns the file name in which the index is stored
*
* @return The file name
*/
String getIndexFileName();
/**
* Returns the object directory
*
* @return The object directory path
*/
IPathElement getObjectDir();
/**
* Returns the storage adapter to access the object store manually.
* The returned storage adapter will have the the object store as root path
*
* @return The storage adapter for the object store
*/
ITreeStorageAdapter getStorageAdapater();
}