Project

General

Profile

1
package eu.dnetlib.rmi.soap;
2

    
3
import java.util.List;
4

    
5
import javax.jws.WebMethod;
6
import javax.jws.WebParam;
7
import javax.jws.WebService;
8

    
9
import eu.dnetlib.rmi.objects.data.MetadataObjectRecord;
10
import eu.dnetlib.rmi.objects.data.ObjectStoreFile;
11
import eu.dnetlib.rmi.objects.resultSet.ResultSet;
12
import eu.dnetlib.rmi.soap.exceptions.ObjectStoreServiceException;
13

    
14
/**
15
 * Main ObjectStore Service interface.
16
 * 
17
 * @author <a href="mailto:sandro.labruzzo at isti.cnr.it">Sandro La Bruzzo</a>
18
 * @version 0.0.1
19
 */
20
@WebService(targetNamespace = "http://services.dnetlib.eu/")
21
public interface ObjectStoreService extends BaseService {
22

    
23
	/**
24
	 * Returns a ResultSet for delivered ObjectStore records in a particular range date.
25
	 * <p>
26
	 * Please check service implementations for details on the expected format of the records in the resultSet.
27
	 * </p>
28
	 * <p>
29
	 * This method could be used for a bulk deliver of all objects in the store
30
	 * </p>
31
	 * 
32
	 * @param obsId
33
	 *            identifier of the ObjectStore
34
	 * @param from
35
	 *            the minimum date of the object
36
	 * @param until
37
	 *            the maximum date of the object
38
	 * @return a ResultSet. Each element of the result set contains the objIdentifier of a record and its URL for retrieve the inputstream
39
	 *         of the file.
40
	 * @throws ObjectStoreServiceException
41
	 *             the object store service exception
42
	 */
43
	@WebMethod(operationName = "deliverObjects", action = "deliverObjects")
44
	public ResultSet<ObjectStoreFile> deliverObjects(@WebParam(name = "obsId") String obsId,
45
			@WebParam(name = "from") Long from,
46
			@WebParam(name = "until") Long until)
47
			throws ObjectStoreServiceException;
48

    
49
	/**
50
	 * Returns a ResultSet for delivered ObjectStore records.
51
	 * <p>
52
	 * Please check service implementations for details on the expected format of the records in the resultSet.
53
	 * </p>
54
	 * 
55
	 * @param obsId
56
	 *            identifier of the ObjectStore
57
	 * @param rs
58
	 *            a ResultSet with the identifiers of the interesting objects. Each element of the result set contains the objIdentifier of
59
	 *            a record
60
	 * @return a ResultSet. Each element of the result set contains the objIdentifier of a record and its URL for retrieve the inputstream
61
	 *         of the file.
62
	 * @throws ObjectStoreServiceException
63
	 *             the object store service exception
64
	 */
65
	@WebMethod(operationName = "deliverObjectsByIds", action = "deliverObjectsByIds")
66
	public ResultSet<ObjectStoreFile> deliverObjectsByIds(@WebParam(name = "obsId") String obsId, @WebParam(name = "rs") ResultSet<String> rs)
67
			throws ObjectStoreServiceException;
68

    
69
	/**
70
	 * Returns an URL to retrieve the ObjectStore record.
71
	 * 
72
	 * @param obsId
73
	 *            identifier of the ObjectStore
74
	 * @param objectId
75
	 *            the id of the object
76
	 * @return the URL for retrieve the record
77
	 * @throws ObjectStoreServiceException
78
	 *             the object store service exception
79
	 */
80
	@WebMethod(operationName = "deliverObject", action = "deliverObject")
81
	public ObjectStoreFile deliverRecord(@WebParam(name = "obsId") String obsId, @WebParam(name = "objectId") String objectId)
82
			throws ObjectStoreServiceException;
83

    
84
	/**
85
	 * Feed the object in the objectStore
86
	 * 
87
	 * @param obsId
88
	 *            identifier of the ObjectStore
89
	 * @param objectMetadata
90
	 *            the String serialized of the JSON object ObjectStoreFile
91
	 * @return
92
	 * @throws ObjectStoreServiceException
93
	 */
94

    
95
	@WebMethod(operationName = "feedObject", action = "feedObject")
96
	public void feedObject(@WebParam(name = "obsId") String obsId, @WebParam(name = "objectMetadata") MetadataObjectRecord objectMetadata)
97
			throws ObjectStoreServiceException;
98

    
99
	/**
100
	 * Returns list of all stored indices.
101
	 * 
102
	 * @return list of all stored indices
103
	 */
104
	@WebMethod(operationName = "getListOfObjectStores", action = "getListOfObjectStores")
105
	public List<String> getListOfObjectStores();
106

    
107
	/**
108
	 * Gets the size of the objectStore ID.
109
	 * 
110
	 * @param obsId
111
	 *            the obs id
112
	 * @return the size
113
	 */
114
	@WebMethod(operationName = "getSize", action = "getSize")
115
	public int getSize(@WebParam(name = "obsId") String obsId) throws ObjectStoreServiceException;
116
}
(12-12/14)