1
|
package eu.dnetlib.repo.manager.service;
|
2
|
|
3
|
import eu.dnetlib.domain.data.Repository;
|
4
|
import eu.dnetlib.domain.data.RepositoryInterface;
|
5
|
import eu.dnetlib.repo.manager.domain.*;
|
6
|
import eu.dnetlib.repo.manager.exception.ResourceNotFoundException;
|
7
|
import org.json.JSONException;
|
8
|
import org.springframework.security.core.Authentication;
|
9
|
|
10
|
import java.io.IOException;
|
11
|
import java.util.List;
|
12
|
import java.util.Map;
|
13
|
|
14
|
public interface RepositoryService {
|
15
|
|
16
|
|
17
|
// TODO: move this elsewhere
|
18
|
Country[] getCountries();
|
19
|
|
20
|
List<Repository> getRepositories(List<String> ids) throws JSONException;
|
21
|
|
22
|
List<Repository> getRepositories(List<String> ids, int page, int size) throws JSONException;
|
23
|
|
24
|
List<RepositorySnippet> getRepositoriesSnippets(List<String> ids) throws Exception;
|
25
|
|
26
|
List<RepositorySnippet> getRepositoriesSnippets(List<String> ids, int page, int size) throws Exception;
|
27
|
|
28
|
List<RepositorySnippet> getRepositoriesByCountry(String country, String mode, Boolean managed) throws JSONException, IOException;
|
29
|
|
30
|
// TODO: remove?
|
31
|
List<Repository> getRepositoriesOfUser(String page, String size) throws JSONException, IOException;
|
32
|
|
33
|
// TODO: remove?
|
34
|
List<Repository> getRepositoriesOfUser(String userEmail,
|
35
|
String page,
|
36
|
String size) throws JSONException, IOException;
|
37
|
|
38
|
List<RepositorySnippet> getRepositoriesSnippetsOfUser(String page, String size) throws Exception;
|
39
|
|
40
|
List<RepositorySnippet> getRepositoriesSnippetsOfUser(String userEmail, String page, String size) throws Exception;
|
41
|
|
42
|
RepositorySnippet getRepositorySnippetById(String id) throws JSONException, ResourceNotFoundException;
|
43
|
|
44
|
Repository getRepositoryById(String id) throws JSONException, ResourceNotFoundException;
|
45
|
|
46
|
List<AggregationDetails> getRepositoryAggregations(String id) throws JSONException;
|
47
|
|
48
|
List<AggregationDetails> getRepositoryAggregations(String id, int from, int size) throws JSONException;
|
49
|
|
50
|
Map<String, List<AggregationDetails>> getRepositoryAggregationsByYear(String id) throws JSONException;
|
51
|
|
52
|
List<Repository> getRepositoriesByName(String name,
|
53
|
String page,
|
54
|
String size) throws JSONException;
|
55
|
|
56
|
List<RepositorySnippet> searchRegisteredRepositories(String country, String typology, String englishName,
|
57
|
String officialName, String requestSortBy, String order,
|
58
|
int page, int pageSize) throws Exception;
|
59
|
|
60
|
int getTotalRegisteredRepositories();
|
61
|
|
62
|
List<RepositoryInterface> getRepositoryInterface(String id) throws JSONException;
|
63
|
|
64
|
Repository addRepository(String datatype, Repository repository) throws Exception;
|
65
|
|
66
|
void deleteRepositoryInterface(String id, String registeredBy);
|
67
|
|
68
|
RepositoryInterface addRepositoryInterface(String datatype,
|
69
|
String repoId,
|
70
|
String registeredBy,
|
71
|
String comment, RepositoryInterface repositoryInterface) throws Exception;
|
72
|
|
73
|
List<String> getDnetCountries();
|
74
|
|
75
|
List<String> getTypologies();
|
76
|
|
77
|
List<Timezone> getTimezones();
|
78
|
|
79
|
Repository updateRepository(Repository repository, Authentication authentication) throws Exception;
|
80
|
|
81
|
List<String> getUrlsOfUserRepos(String user_email,
|
82
|
String page,
|
83
|
String size);
|
84
|
|
85
|
Map<String, String> getCompatibilityClasses(String mode);
|
86
|
|
87
|
Map<String, String> getDatasourceClasses(String mode);
|
88
|
|
89
|
String getCountryName(String countryCode);
|
90
|
|
91
|
MetricsInfo getMetricsInfoForRepository(String repoId) throws RepositoryServiceException;
|
92
|
|
93
|
Map<String, String> getListLatestUpdate(String mode) throws JSONException;
|
94
|
|
95
|
RepositoryInterface updateRepositoryInterface(String repoId, String registeredBy, String comment, RepositoryInterface repositoryInterface) throws Exception;
|
96
|
|
97
|
}
|