Project

General

Profile

1
package eu.dnetlib.data.objectstore.modular.connector;
2

    
3
import eu.dnetlib.data.objectstore.modular.ObjectStoreRecord;
4
import eu.dnetlib.data.objectstore.rmi.MetadataObjectRecord;
5
import eu.dnetlib.data.objectstore.rmi.ObjectStoreFile;
6
import eu.dnetlib.data.objectstore.rmi.ObjectStoreServiceException;
7
import eu.dnetlib.enabling.resultset.ResultSetListener;
8

    
9
/**
10
 * The Interface ObjectStore.
11
 */
12
public interface ObjectStore {
13

    
14
	/**
15
	 * Gets the id of the objectStore.
16
	 *
17
	 * @return the id
18
	 */
19
	String getId();
20

    
21
	/**
22
	 * Gets the interpretation the objectStore.
23
	 *
24
	 * @return the interpretation
25
	 */
26
	String getInterpretation();
27

    
28
	/**
29
	 * Feed record into the objectstore.
30
	 *
31
	 * @param records
32
	 *            the records
33
	 * @param incremental
34
	 *            the incremental
35
	 * @return the int
36
	 */
37
	int feed(Iterable<ObjectStoreRecord> records, boolean incremental) throws ObjectStoreServiceException;
38

    
39
	/**
40
	 * Feed metadata record into the objectStore.
41
	 *
42
	 * @param records
43
	 *            the records
44
	 * @param incremental
45
	 *            the incremental
46
	 * @return the int
47
	 */
48
	int feedMetadataRecord(Iterable<MetadataObjectRecord> records, boolean incremental) throws ObjectStoreServiceException;
49

    
50
	/**
51
	 * Feed a single object record into the objectStore.
52
	 *
53
	 * @param record
54
	 *            the record
55
	 * @return the string
56
	 */
57
	String feedObjectRecord(ObjectStoreRecord record) throws ObjectStoreServiceException;
58

    
59
	/**
60
	 * Deliver Object from the objectStore.
61
	 *
62
	 * @param from
63
	 *            : start date which you want to filter
64
	 * @param until
65
	 *            : end date which you want to filter
66
	 * @return the result set listener
67
	 */
68
	ResultSetListener deliver(Long from, Long until) throws ObjectStoreServiceException;
69

    
70
	/**
71
	 * Deliver ids.
72
	 *
73
	 * @param ids
74
	 *            the ids
75
	 * @return the result set listener
76
	 */
77
	ResultSetListener deliverIds(Iterable<String> ids) throws ObjectStoreServiceException;
78

    
79
	/**
80
	 * Deliver object.
81
	 *
82
	 * @param objectId
83
	 *            the object id
84
	 * @return the object store file
85
	 * @throws ObjectStoreServiceException
86
	 */
87
	ObjectStoreFile deliverObject(String objectId) throws ObjectStoreServiceException;
88

    
89
	/**
90
	 * Gets the size.
91
	 *
92
	 * @return the size
93
	 */
94
	int getSize() throws ObjectStoreServiceException;
95

    
96
	/**
97
	 * Delete object.
98
	 *
99
	 * @param objectId
100
	 *            the object id
101
	 */
102
	void deleteObject(String objectId) throws ObjectStoreServiceException;
103

    
104
	/**
105
	 * Gets the object.
106
	 *
107
	 * @param recordId
108
	 *            the record id
109
	 * @return the object
110
	 */
111
	String getObject(String recordId) throws ObjectStoreServiceException;
112

    
113
	/**
114
	 * Find if exist an ID startingwith the string startId.
115
	 *
116
	 * @param startId
117
	 *            the start id
118
	 * @return if exist or less an id
119
	 */
120
	boolean existIDStartsWith(String startId) throws ObjectStoreServiceException;
121

    
122
	/**
123
	 * drop the content of the ObjectStore
124
	 * THIS METHOD DELETE ALL THE CONTENT INSIDE THE OBJECTSTORE PAY ATTENTION WHEN YOU CALL IT
125
	 *
126
	 * @return if the content has been refreshed
127
	 * @throws ObjectStoreServiceException
128
	 */
129
	boolean dropContent() throws ObjectStoreServiceException;
130

    
131
}
(1-1/2)