1
|
package eu.dnetlib.enabling.datasources.common;
|
2
|
|
3
|
import java.util.Date;
|
4
|
import java.util.List;
|
5
|
|
6
|
public interface DatasourceManager<DS extends Datasource<?, ?>, API extends Api> {
|
7
|
|
8
|
List<String> listIds(int page, int size) throws DatasourceManagerException;
|
9
|
|
10
|
DatasourceResponse<DS> getDsInfo(String id) throws DatasourceManagerException;
|
11
|
|
12
|
DS getDs(String id) throws DatasourceManagerException;
|
13
|
|
14
|
List<? extends DatasourceResponse<DS>> searchByName(String name, int page, int size) throws DatasourceManagerException;
|
15
|
|
16
|
List<? extends DatasourceResponse<DS>> searchByContactemail(String contactemail, int page, int size) throws DatasourceManagerException;
|
17
|
|
18
|
List<? extends DatasourceResponse<DS>> searchByCountry(String country, int page, int size) throws DatasourceManagerException;
|
19
|
|
20
|
List<? extends SearchApisEntry> searchApis(String field, String value) throws DatasourceManagerException;
|
21
|
|
22
|
List<? extends BrowseTerm> browseField(String field) throws DatasourceManagerException;
|
23
|
|
24
|
List<? extends Api> getApis(String dsId) throws DatasourceManagerException;
|
25
|
|
26
|
void deleteDs(String dsId) throws DatasourceManagerException;
|
27
|
|
28
|
void deleteApi(String dsId, String apiId) throws DatasourceManagerException;
|
29
|
|
30
|
void addApi(API api) throws DatasourceManagerException;
|
31
|
|
32
|
void setManaged(String id, boolean managed) throws DatasourceManagerException;
|
33
|
|
34
|
void saveDs(DS datasource) throws DatasourceManagerException;
|
35
|
|
36
|
void updateOfficialname(String dsId, String officialname) throws DatasourceManagerException;
|
37
|
|
38
|
void updateEnglishname(String dsId, String english) throws DatasourceManagerException;
|
39
|
|
40
|
void updateLatitude(String dsId, Double latitude) throws DatasourceManagerException;
|
41
|
|
42
|
void updateLongitude(String dsId, Double longitude) throws DatasourceManagerException;
|
43
|
|
44
|
void updateActivationStatus(String dsId, String ifaceId, boolean active) throws DatasourceManagerException; // TODO resettare last_*_*
|
45
|
// if active == false
|
46
|
|
47
|
void updateCompliance(String dsId, String ifaceId, String compliance) throws DatasourceManagerException;
|
48
|
|
49
|
void setLastCollectionInfo(String dsId, String ifaceId, String mdId, int size, Date date) throws DatasourceManagerException;
|
50
|
|
51
|
void setLastAggregationInfo(String dsId, String ifaceId, String mdId, int size, Date date) throws DatasourceManagerException;
|
52
|
|
53
|
void setLastDownloadInfo(String dsId, String ifaceId, String objId, int size, Date date) throws DatasourceManagerException;
|
54
|
|
55
|
void updateBaseUrl(String dsId, String ifaceId, String baseUrl) throws DatasourceManagerException;
|
56
|
|
57
|
}
|