Project

General

Profile

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

    
3
import java.util.List;
4

    
5
import eu.dnetlib.data.objectstore.rmi.ObjectStoreServiceException;
6

    
7
/**
8
 * The Interface ObjectStoreDao.
9
 */
10
public interface ObjectStoreDao {
11

    
12
	/**
13
	 * Gets an Object Store with the given identifier.
14
	 * <p>
15
	 * If an Object Store with the given identifier does not exist, a new one is created.
16
	 * </p>
17
	 *
18
	 * @param obsId
19
	 *            the object store identifier
20
	 * @return the object store
21
	 * @throws ObjectStoreServiceException
22
	 */
23
	ObjectStore getObjectStore(String obsId) throws ObjectStoreServiceException;
24

    
25
	/**
26
	 * List all the Object stores.
27
	 *
28
	 * @return the list of object store ids
29
	 */
30
	List<String> listObjectStores();
31

    
32
	/**
33
	 * Creates an Object Store with the given identifier.
34
	 * <p>
35
	 * If an Object Store with the given identifier already exists this method does nothing.
36
	 * </p>
37
	 *
38
	 * @param obsId            	the object store identifier
39
	 * @param interpretation    the interpretation of the store
40
	 * @param basePath 			the base path to store the object Store in case of file system implementation
41
	 * @return true, if successful
42
	 * @throws ObjectStoreServiceException
43
	 */
44
	boolean createObjectStore(String obsId, String interpretation, String basePath) throws ObjectStoreServiceException;
45

    
46
	/**
47
	 * Upddate an Object Store metadata with the given identifier.
48
	 * <p>
49
	 * If an Object Store with the given identifier does not exist, a new one is created.
50
	 * </p>
51
	 *
52
	 * @param obsId
53
	 *            the object store identifier
54
	 * @param interpretation
55
	 *            the interpretation of the store
56
	 * @return true, if successful
57
	 */
58
	boolean updateObjectStore(String obsId, String interpretation);
59

    
60
	/**
61
	 * Delete object store.
62
	 *
63
	 * @param obsId
64
	 *            the object store identifier
65
	 * @return true, if successful
66
	 * @throws ObjectStoreServiceException
67
	 */
68
	boolean deleteObjectStore(String obsId) throws ObjectStoreServiceException;
69

    
70
	boolean dropContent(String obsId) throws ObjectStoreServiceException;
71

    
72
}
(2-2/2)