package eu.dnetlib.repo.manager.service; import com.fasterxml.jackson.core.JsonProcessingException; import eu.dnetlib.repo.manager.domain.*; import eu.dnetlib.repo.manager.exception.RepositoryServiceException; import eu.dnetlib.repo.manager.exception.ResourceNotFoundException; import org.json.JSONException; import org.springframework.security.core.Authentication; import java.io.IOException; import java.util.List; import java.util.Map; public interface RepositoryService { // TODO: move this elsewhere Country[] getCountries(); List getRepositories(List ids) throws JSONException; List getRepositories(List ids, int page, int size) throws JSONException; List getRepositoriesSnippets(List ids) throws Exception; List getRepositoriesSnippets(List ids, int page, int size) throws Exception; List getRepositoriesByCountry(String country, String mode, Boolean managed) throws JSONException, IOException; // TODO: remove? List getRepositoriesOfUser(String page, String size) throws JSONException, IOException; // TODO: remove? List getRepositoriesOfUser(String userEmail, String page, String size) throws JSONException, IOException; List getRepositoriesSnippetsOfUser(String page, String size) throws Exception; List getRepositoriesSnippetsOfUser(String userEmail, String page, String size) throws Exception; RepositorySnippet getRepositorySnippetById(String id) throws JSONException, ResourceNotFoundException; Repository getRepositoryById(String id) throws JSONException, ResourceNotFoundException; List getRepositoriesByName(String name, String page, String size) throws JSONException; List searchRegisteredRepositories(String country, String typology, String englishName, String officialName, String requestSortBy, String order, int page, int pageSize) throws Exception; Integer getTotalRegisteredRepositories(); List 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, String comment, RepositoryInterface repositoryInterface, String desiredCompatibilityLevel) throws Exception; List getDnetCountries(); List getTypologies(); List getTimezones(); Repository updateRepository(Repository repository, Authentication authentication) throws Exception; List getUrlsOfUserRepos(String user_email, String page, String size); Map getCompatibilityClasses(String mode); Map getDatasourceClasses(String mode); String getCountryName(String countryCode); MetricsInfo getMetricsInfoForRepository(String repoId) throws RepositoryServiceException; Map getListLatestUpdate(String mode); RepositoryInterface updateRepositoryInterface(String repoId, String comment, RepositoryInterface repositoryInterface, String desiredCompatibilityLevel) throws Exception; void updateInterfaceCompliance(String repositoryId, String repositoryInterfaceId, String compliance); }