Project

General

Profile

1
package eu.dnetlib.repo.manager.service;
2

    
3
import eu.dnetlib.repo.manager.domain.Repository;
4
import eu.dnetlib.repo.manager.domain.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.Date;
12
import java.util.List;
13
import java.util.Map;
14

    
15
public interface RepositoryService {
16

    
17

    
18
    // TODO: move this elsewhere
19
    Country[] getCountries();
20

    
21
    List<Repository> getRepositories(List<String> ids) throws JSONException;
22

    
23
    List<Repository> getRepositories(List<String> ids, int page, int size) throws JSONException;
24

    
25
    List<RepositorySnippet> getRepositoriesSnippets(List<String> ids) throws Exception;
26

    
27
    List<RepositorySnippet> getRepositoriesSnippets(List<String> ids, int page, int size) throws Exception;
28

    
29
    List<RepositorySnippet> getRepositoriesByCountry(String country, String mode, Boolean managed) throws JSONException, IOException;
30

    
31
    // TODO: remove?
32
    List<Repository> getRepositoriesOfUser(String page, String size) throws JSONException, IOException;
33

    
34
    // TODO: remove?
35
    List<Repository> getRepositoriesOfUser(String userEmail,
36
                                           String page,
37
                                           String size) throws JSONException, IOException;
38

    
39
    List<RepositorySnippet> getRepositoriesSnippetsOfUser(String page, String size) throws Exception;
40

    
41
    List<RepositorySnippet> getRepositoriesSnippetsOfUser(String userEmail, String page, String size) throws Exception;
42

    
43
    RepositorySnippet getRepositorySnippetById(String id) throws JSONException, ResourceNotFoundException;
44

    
45
    Repository getRepositoryById(String id) throws JSONException, ResourceNotFoundException;
46

    
47
    List<AggregationDetails> getRepositoryAggregations(String id) throws JSONException;
48

    
49
    List<AggregationDetails> getRepositoryAggregations(String id, int from, int size) throws JSONException;
50

    
51
    Map<String, List<AggregationDetails>> getRepositoryAggregationsByYear(String id) throws JSONException;
52

    
53
    List<Repository> getRepositoriesByName(String name,
54
                                           String page,
55
                                           String size) throws JSONException;
56

    
57
    List<RepositorySnippet> searchRegisteredRepositories(String country, String typology, String englishName,
58
                                                         String officialName, String requestSortBy, String order,
59
                                                         int page, int pageSize) throws Exception;
60

    
61
    int getTotalRegisteredRepositories();
62

    
63
    List<RepositoryInterface> getRepositoryInterface(String id) throws JSONException;
64

    
65
    Repository addRepository(String datatype, Repository repository) throws Exception;
66

    
67
    void deleteRepositoryInterface(String id, String registeredBy);
68

    
69
    RepositoryInterface addRepositoryInterface(String datatype,
70
                                               String repoId,
71
                                               String registeredBy,
72
                                               String comment, RepositoryInterface repositoryInterface) throws Exception;
73

    
74
    List<String> getDnetCountries();
75

    
76
    List<String> getTypologies();
77

    
78
    List<Timezone> getTimezones();
79

    
80
    Repository updateRepository(Repository repository, Authentication authentication) throws Exception;
81

    
82
    List<String> getUrlsOfUserRepos(String user_email,
83
                                    String page,
84
                                    String size);
85

    
86
    Map<String, String> getCompatibilityClasses(String mode);
87

    
88
    Map<String, String> getDatasourceClasses(String mode);
89

    
90
    String getCountryName(String countryCode);
91

    
92
    MetricsInfo getMetricsInfoForRepository(String repoId) throws RepositoryServiceException;
93

    
94
    Map<String, String> getListLatestUpdate(String mode) throws JSONException;
95

    
96
    RepositoryInterface updateRepositoryInterface(String repoId, String registeredBy, String comment, RepositoryInterface repositoryInterface) throws Exception;
97

    
98
}
(11-11/20)