Project

General

Profile

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, int from, int size) throws JSONException;
47

    
48
    Map<String, List<AggregationDetails>> getRepositoryAggregationsByYear(String id) throws JSONException;
49

    
50
    List<Repository> getRepositoriesByName(String name,
51
                                           String page,
52
                                           String size) throws JSONException;
53

    
54
    List<RepositorySnippet> searchRegisteredRepositories(String country, String typology, String englishName,
55
                                                         String officialName, String requestSortBy, String order,
56
                                                         int page, int pageSize) throws Exception;
57

    
58
    List<RepositoryInterface> getRepositoryInterface(String id) throws JSONException;
59

    
60
    Repository addRepository(String datatype, Repository repository) throws Exception;
61

    
62
    void deleteRepositoryInterface(String id, String registeredBy);
63

    
64
    RepositoryInterface addRepositoryInterface(String datatype,
65
                                               String repoId,
66
                                               String registeredBy,
67
                                               String comment, RepositoryInterface repositoryInterface) throws Exception;
68

    
69
    List<String> getDnetCountries();
70

    
71
    List<String> getTypologies();
72

    
73
    List<Timezone> getTimezones();
74

    
75
    Repository updateRepository(Repository repository, Authentication authentication) throws Exception;
76

    
77
    List<String> getUrlsOfUserRepos(String user_email,
78
                                    String page,
79
                                    String size);
80

    
81
    List<String> getDatasourceVocabularies(String mode);
82

    
83
    Map<String, String> getCompatibilityClasses(String mode);
84

    
85
    Map<String, String> getDatasourceClasses(String mode);
86

    
87
    String getCountryName(String countryCode);
88

    
89
    MetricsInfo getMetricsInfoForRepository(String repoId) throws RepositoryServiceException;
90

    
91
    Map<String, String> getListLatestUpdate(String mode) throws JSONException;
92

    
93
    RepositoryInterface updateRepositoryInterface(String repoId, String registeredBy, String comment, RepositoryInterface repositoryInterface) throws Exception;
94

    
95
}
(11-11/20)