1 |
26600
|
sandro.lab
|
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 |
31786
|
sandro.lab
|
import eu.dnetlib.data.objectstore.rmi.ObjectStoreServiceException;
|
7 |
26600
|
sandro.lab
|
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 |
31786
|
sandro.lab
|
* @param records
|
32 |
|
|
* the records
|
33 |
|
|
* @param incremental
|
34 |
|
|
* the incremental
|
35 |
26600
|
sandro.lab
|
* @return the int
|
36 |
|
|
*/
|
37 |
31786
|
sandro.lab
|
int feed(Iterable<ObjectStoreRecord> records, boolean incremental) throws ObjectStoreServiceException;
|
38 |
26600
|
sandro.lab
|
|
39 |
|
|
/**
|
40 |
|
|
* Feed metadata record into the objectStore.
|
41 |
|
|
*
|
42 |
31786
|
sandro.lab
|
* @param records
|
43 |
|
|
* the records
|
44 |
|
|
* @param incremental
|
45 |
|
|
* the incremental
|
46 |
26600
|
sandro.lab
|
* @return the int
|
47 |
|
|
*/
|
48 |
31786
|
sandro.lab
|
int feedMetadataRecord(Iterable<MetadataObjectRecord> records, boolean incremental) throws ObjectStoreServiceException;
|
49 |
26600
|
sandro.lab
|
|
50 |
|
|
/**
|
51 |
31786
|
sandro.lab
|
* Feed a single object record into the objectStore.
|
52 |
26600
|
sandro.lab
|
*
|
53 |
31786
|
sandro.lab
|
* @param record
|
54 |
|
|
* the record
|
55 |
26600
|
sandro.lab
|
* @return the string
|
56 |
|
|
*/
|
57 |
31786
|
sandro.lab
|
String feedObjectRecord(ObjectStoreRecord record) throws ObjectStoreServiceException;
|
58 |
26600
|
sandro.lab
|
|
59 |
|
|
/**
|
60 |
|
|
* Deliver Object from the objectStore.
|
61 |
|
|
*
|
62 |
31786
|
sandro.lab
|
* @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 |
26600
|
sandro.lab
|
*/
|
68 |
32509
|
sandro.lab
|
ResultSetListener deliver(Long from, Long until) throws ObjectStoreServiceException;
|
69 |
26600
|
sandro.lab
|
|
70 |
|
|
/**
|
71 |
|
|
* Deliver ids.
|
72 |
|
|
*
|
73 |
31786
|
sandro.lab
|
* @param ids
|
74 |
|
|
* the ids
|
75 |
26600
|
sandro.lab
|
* @return the result set listener
|
76 |
|
|
*/
|
77 |
31786
|
sandro.lab
|
ResultSetListener deliverIds(Iterable<String> ids) throws ObjectStoreServiceException;
|
78 |
26600
|
sandro.lab
|
|
79 |
|
|
/**
|
80 |
|
|
* Deliver object.
|
81 |
|
|
*
|
82 |
31786
|
sandro.lab
|
* @param objectId
|
83 |
|
|
* the object id
|
84 |
26600
|
sandro.lab
|
* @return the object store file
|
85 |
31786
|
sandro.lab
|
* @throws ObjectStoreServiceException
|
86 |
26600
|
sandro.lab
|
*/
|
87 |
31786
|
sandro.lab
|
ObjectStoreFile deliverObject(String objectId) throws ObjectStoreServiceException;
|
88 |
26600
|
sandro.lab
|
|
89 |
|
|
/**
|
90 |
|
|
* Gets the size.
|
91 |
|
|
*
|
92 |
|
|
* @return the size
|
93 |
|
|
*/
|
94 |
31786
|
sandro.lab
|
int getSize() throws ObjectStoreServiceException;
|
95 |
26600
|
sandro.lab
|
|
96 |
|
|
/**
|
97 |
|
|
* Delete object.
|
98 |
|
|
*
|
99 |
31786
|
sandro.lab
|
* @param objectId
|
100 |
|
|
* the object id
|
101 |
26600
|
sandro.lab
|
*/
|
102 |
31786
|
sandro.lab
|
void deleteObject(String objectId) throws ObjectStoreServiceException;
|
103 |
26600
|
sandro.lab
|
|
104 |
|
|
/**
|
105 |
|
|
* Gets the object.
|
106 |
|
|
*
|
107 |
31786
|
sandro.lab
|
* @param recordId
|
108 |
|
|
* the record id
|
109 |
26600
|
sandro.lab
|
* @return the object
|
110 |
|
|
*/
|
111 |
31786
|
sandro.lab
|
String getObject(String recordId) throws ObjectStoreServiceException;
|
112 |
26600
|
sandro.lab
|
|
113 |
|
|
/**
|
114 |
|
|
* Find if exist an ID startingwith the string startId.
|
115 |
|
|
*
|
116 |
31786
|
sandro.lab
|
* @param startId
|
117 |
|
|
* the start id
|
118 |
26600
|
sandro.lab
|
* @return if exist or less an id
|
119 |
|
|
*/
|
120 |
31786
|
sandro.lab
|
boolean existIDStartsWith(String startId) throws ObjectStoreServiceException;
|
121 |
26600
|
sandro.lab
|
|
122 |
41466
|
sandro.lab
|
/**
|
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 |
26600
|
sandro.lab
|
}
|