2019-02-16 11:04:41 +01:00
|
|
|
package eu.dnetlib.repo.manager.service;
|
|
|
|
|
2019-11-28 12:25:56 +01:00
|
|
|
import eu.dnetlib.repo.manager.domain.*;
|
2022-08-05 10:48:16 +02:00
|
|
|
import eu.dnetlib.repo.manager.exception.RepositoryServiceException;
|
2019-02-16 11:04:41 +01:00
|
|
|
import eu.dnetlib.repo.manager.exception.ResourceNotFoundException;
|
|
|
|
import org.json.JSONException;
|
|
|
|
import org.springframework.security.core.Authentication;
|
2019-12-16 11:54:06 +01:00
|
|
|
|
2019-02-16 11:04:41 +01:00
|
|
|
import java.io.IOException;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
public interface RepositoryService {
|
|
|
|
|
|
|
|
|
2021-07-21 13:51:18 +02:00
|
|
|
// TODO: move this elsewhere
|
|
|
|
Country[] getCountries();
|
|
|
|
|
|
|
|
List<Repository> getRepositories(List<String> ids) throws JSONException;
|
|
|
|
|
|
|
|
List<Repository> getRepositories(List<String> ids, int page, int size) throws JSONException;
|
|
|
|
|
|
|
|
List<RepositorySnippet> getRepositoriesSnippets(List<String> ids) throws Exception;
|
|
|
|
|
|
|
|
List<RepositorySnippet> getRepositoriesSnippets(List<String> ids, int page, int size) throws Exception;
|
2019-02-16 11:04:41 +01:00
|
|
|
|
|
|
|
List<RepositorySnippet> getRepositoriesByCountry(String country, String mode, Boolean managed) throws JSONException, IOException;
|
|
|
|
|
2021-07-21 13:51:18 +02:00
|
|
|
// TODO: remove?
|
|
|
|
List<Repository> getRepositoriesOfUser(String page, String size) throws JSONException, IOException;
|
|
|
|
|
|
|
|
// TODO: remove?
|
2019-02-16 11:04:41 +01:00
|
|
|
List<Repository> getRepositoriesOfUser(String userEmail,
|
|
|
|
String page,
|
2019-12-13 14:40:55 +01:00
|
|
|
String size) throws JSONException, IOException;
|
|
|
|
|
2021-07-21 13:51:18 +02:00
|
|
|
List<RepositorySnippet> getRepositoriesSnippetsOfUser(String page, String size) throws Exception;
|
|
|
|
|
|
|
|
List<RepositorySnippet> getRepositoriesSnippetsOfUser(String userEmail, String page, String size) throws Exception;
|
|
|
|
|
|
|
|
RepositorySnippet getRepositorySnippetById(String id) throws JSONException, ResourceNotFoundException;
|
2019-02-16 11:04:41 +01:00
|
|
|
|
|
|
|
Repository getRepositoryById(String id) throws JSONException, ResourceNotFoundException;
|
|
|
|
|
|
|
|
List<Repository> getRepositoriesByName(String name,
|
|
|
|
String page,
|
|
|
|
String size) throws JSONException;
|
|
|
|
|
2019-07-19 11:31:23 +02:00
|
|
|
List<RepositorySnippet> searchRegisteredRepositories(String country, String typology, String englishName,
|
2021-07-21 13:51:18 +02:00
|
|
|
String officialName, String requestSortBy, String order,
|
|
|
|
int page, int pageSize) throws Exception;
|
2019-07-19 11:31:23 +02:00
|
|
|
|
2023-01-23 16:45:35 +01:00
|
|
|
Integer getTotalRegisteredRepositories();
|
2021-10-12 15:30:38 +02:00
|
|
|
|
2019-02-16 11:04:41 +01:00
|
|
|
List<RepositoryInterface> getRepositoryInterface(String id) throws JSONException;
|
|
|
|
|
|
|
|
Repository addRepository(String datatype, Repository repository) throws Exception;
|
|
|
|
|
|
|
|
void deleteRepositoryInterface(String id, String registeredBy);
|
|
|
|
|
|
|
|
RepositoryInterface addRepositoryInterface(String datatype,
|
|
|
|
String repoId,
|
2023-01-16 19:30:09 +01:00
|
|
|
String comment,
|
|
|
|
RepositoryInterface repositoryInterface,
|
|
|
|
String desiredCompatibilityLevel) throws Exception;
|
2019-02-16 11:04:41 +01:00
|
|
|
|
|
|
|
List<String> getDnetCountries();
|
|
|
|
|
|
|
|
List<String> getTypologies();
|
|
|
|
|
|
|
|
List<Timezone> getTimezones();
|
|
|
|
|
|
|
|
Repository updateRepository(Repository repository, Authentication authentication) throws Exception;
|
|
|
|
|
|
|
|
List<String> getUrlsOfUserRepos(String user_email,
|
|
|
|
String page,
|
2021-07-21 13:51:18 +02:00
|
|
|
String size);
|
2019-02-16 11:04:41 +01:00
|
|
|
|
|
|
|
Map<String, String> getCompatibilityClasses(String mode);
|
|
|
|
|
|
|
|
Map<String, String> getDatasourceClasses(String mode);
|
|
|
|
|
|
|
|
String getCountryName(String countryCode);
|
|
|
|
|
|
|
|
MetricsInfo getMetricsInfoForRepository(String repoId) throws RepositoryServiceException;
|
|
|
|
|
2023-01-23 16:45:35 +01:00
|
|
|
Map<String, String> getListLatestUpdate(String mode);
|
2019-02-16 11:04:41 +01:00
|
|
|
|
2023-01-13 17:06:30 +01:00
|
|
|
RepositoryInterface updateRepositoryInterface(String repoId, String comment, RepositoryInterface repositoryInterface, String desiredCompatibilityLevel) throws Exception;
|
2019-02-16 11:04:41 +01:00
|
|
|
|
2023-01-13 17:06:30 +01:00
|
|
|
void updateInterfaceCompliance(String repositoryId, String repositoryInterfaceId, String compliance);
|
2019-02-16 11:04:41 +01:00
|
|
|
}
|