Merge branch 'develop' of code-repo.d4science.org:MaDgIK/uoa-repository-manager-service into develop

This commit is contained in:
Konstantinos Spyrou 2023-02-17 16:17:56 +02:00
commit bae9a132cb
4 changed files with 20 additions and 13 deletions

View File

@ -114,6 +114,7 @@ public class BrokerServiceImpl implements BrokerService {
new ParameterizedTypeReference<List<BrowseEntry>>() { new ParameterizedTypeReference<List<BrowseEntry>>() {
}); });
} catch (RestClientException e) { } catch (RestClientException e) {
logger.error(e.getMessage());
throw new BrokerException(e); throw new BrokerException(e);
} }
@ -146,6 +147,7 @@ public class BrokerServiceImpl implements BrokerService {
new ParameterizedTypeReference<EventsPage>() {} new ParameterizedTypeReference<EventsPage>() {}
); );
} catch (RestClientException e) { } catch (RestClientException e) {
logger.error(e.getMessage());
throw new BrokerException(e); throw new BrokerException(e);
} }
return resp.getBody(); return resp.getBody();
@ -195,6 +197,7 @@ public class BrokerServiceImpl implements BrokerService {
new ParameterizedTypeReference<EventsPage>() { new ParameterizedTypeReference<EventsPage>() {
}); });
} catch (RestClientException e) { } catch (RestClientException e) {
logger.error(e.getMessage());
throw new BrokerException(e); throw new BrokerException(e);
} }
return resp.getBody(); return resp.getBody();
@ -219,6 +222,7 @@ public class BrokerServiceImpl implements BrokerService {
new ParameterizedTypeReference<Map<String, List<SimpleSubscriptionDesc>>>() { new ParameterizedTypeReference<Map<String, List<SimpleSubscriptionDesc>>>() {
}); });
} catch (RestClientException e) { } catch (RestClientException e) {
logger.error(e.getMessage());
throw new BrokerException(e); throw new BrokerException(e);
} }
return resp.getBody(); return resp.getBody();
@ -252,6 +256,7 @@ public class BrokerServiceImpl implements BrokerService {
new ParameterizedTypeReference<Subscription>() { new ParameterizedTypeReference<Subscription>() {
}); });
} catch (RestClientException e) { } catch (RestClientException e) {
logger.error(e.getMessage());
throw new BrokerException(e); throw new BrokerException(e);
} }
@ -274,6 +279,7 @@ public class BrokerServiceImpl implements BrokerService {
new ParameterizedTypeReference<Void>() { new ParameterizedTypeReference<Void>() {
}); });
} catch (RestClientException e) { } catch (RestClientException e) {
logger.error(e.getMessage());
throw new BrokerException(e); throw new BrokerException(e);
} }
return new ResponseEntity<>("OK", HttpStatus.OK); return new ResponseEntity<>("OK", HttpStatus.OK);
@ -296,6 +302,7 @@ public class BrokerServiceImpl implements BrokerService {
new ParameterizedTypeReference<Subscription>() { new ParameterizedTypeReference<Subscription>() {
}); });
} catch (RestClientException e) { } catch (RestClientException e) {
logger.error(e.getMessage());
throw new BrokerException(e); throw new BrokerException(e);
} }
return resp.getBody(); return resp.getBody();
@ -325,6 +332,7 @@ public class BrokerServiceImpl implements BrokerService {
new ParameterizedTypeReference<EventsPage>() { new ParameterizedTypeReference<EventsPage>() {
}); });
} catch (RestClientException e) { } catch (RestClientException e) {
logger.error(e.getMessage());
throw new BrokerException(e); throw new BrokerException(e);
} }
return resp.getBody(); return resp.getBody();

View File

@ -1,7 +1,7 @@
package eu.dnetlib.repo.manager.service; package eu.dnetlib.repo.manager.service;
import eu.dnetlib.enabling.datasources.common.AggregationInfo; import eu.dnetlib.enabling.datasources.common.AggregationInfo;
import eu.dnetlib.repo.manager.domain.MetricsInfo; import eu.dnetlib.repo.manager.domain.MetricsNumbers;
import eu.dnetlib.repo.manager.domain.RepositorySnippet; import eu.dnetlib.repo.manager.domain.RepositorySnippet;
import eu.dnetlib.repo.manager.domain.RepositorySummaryInfo; import eu.dnetlib.repo.manager.domain.RepositorySummaryInfo;
import eu.dnetlib.repo.manager.domain.broker.BrowseEntry; import eu.dnetlib.repo.manager.domain.broker.BrowseEntry;
@ -68,9 +68,9 @@ public class DashboardServiceImpl implements DashboardService {
logger.warn("Could not find repo aggregations, after " + (end - start) + "ms!"); logger.warn("Could not find repo aggregations, after " + (end - start) + "ms!");
try { try {
MetricsInfo metricsInfo = repositoryService.getMetricsInfoForRepository(repoId); MetricsNumbers metricsNumbers = repositoryService.getMetricsInfoForRepository(repoId).getMetricsNumbers();
repositorySummaryInfo.setTotalDownloads(metricsInfo.getMetricsNumbers().getTotalDownloads()); repositorySummaryInfo.setTotalDownloads(metricsNumbers.getTotalDownloads());
repositorySummaryInfo.setTotalViews(metricsInfo.getMetricsNumbers().getTotalViews()); repositorySummaryInfo.setTotalViews(metricsNumbers.getTotalViews());
} catch (RepositoryServiceException e) { } catch (RepositoryServiceException e) {
logger.error("Exception getting metrics info for repository: {}, {} ", repoId, repoOfficialName, e); logger.error("Exception getting metrics info for repository: {}, {} ", repoId, repoOfficialName, e);
} }

View File

@ -773,12 +773,10 @@ public class RepositoryServiceImpl implements RepositoryService {
@Override @Override
public MetricsInfo getMetricsInfoForRepository(String repoId) throws RepositoryServiceException { public MetricsInfo getMetricsInfoForRepository(String repoId) throws RepositoryServiceException {
try { try {
MetricsInfo metricsInfo = new MetricsInfo(); MetricsInfo metricsInfo = new MetricsInfo();
metricsInfo.setDiagramsBaseURL(this.usageStatisticsDiagramsBaseURL); metricsInfo.setDiagramsBaseURL(this.usageStatisticsDiagramsBaseURL);
metricsInfo.setMetricsNumbers(getMetricsNumbers(getOpenAIREId(repoId))); metricsInfo.setMetricsNumbers(getMetricsNumbers(getOpenAIREId(repoId)));
return metricsInfo; return metricsInfo;
} catch (Exception e) { } catch (Exception e) {
logger.error("Error while getting metrics info for repository: ", e); logger.error("Error while getting metrics info for repository: ", e);
throw new RepositoryServiceException("General error", RepositoryServiceException.ErrorCode.GENERAL_ERROR); throw new RepositoryServiceException("General error", RepositoryServiceException.ErrorCode.GENERAL_ERROR);

View File

@ -14,10 +14,11 @@ spring:
driverClassName: ${services.provide.db.driverClassName} driverClassName: ${services.provide.db.driverClassName}
services: services:
openaireServicesBaseUrl: https://beta.services.openaire.eu
provide: provide:
dev-machine: 88.197.53.71 # VM-71 dev-machine: 88.197.53.71 # VM-71
aai: aai:
baseURL: https://aai.openaire.eu baseURL: https://beta.aai.openaire.eu
oidc: oidc:
domain: .openaire.eu # use empty value for local, otherwise: ".openaire.eu" domain: .openaire.eu # use empty value for local, otherwise: ".openaire.eu"
id: XX id: XX
@ -27,10 +28,10 @@ services:
webURL: http://localhost:4200/join webURL: http://localhost:4200/join
registry: registry:
coid: XX coid: XX
username: XX
password: XX password: XX
production: false production: false
url: ${services.provide.aai.baseURL}/registry/ url: ${services.provide.aai.baseURL}/registry/
username: provide_openaire
adminEmail: XX adminEmail: XX
analyticsURL: https://analytics.openaire.eu/addsite.php? analyticsURL: https://analytics.openaire.eu/addsite.php?
baseUrl: https://dev-openaire.d4science.org/openaire baseUrl: https://dev-openaire.d4science.org/openaire
@ -41,9 +42,9 @@ services:
url: https://beta.broker.openaire.eu url: https://beta.broker.openaire.eu
clients: clients:
dsm: https://dev-openaire.d4science.org/openaire dsm: https://dev-openaire.d4science.org/openaire
search: https://beta.services.openaire.eu/search/v2/api search: ${services.openaireServicesBaseUrl}/search/v2/api
usageEvents: http://beta.lbs.openaire.eu:8080/ajax/summary usageEvents: http://beta.lbs.openaire.eu:8080/ajax/summary
usagestats: https://beta.services.openaire.eu/usagestats usagestats: ${services.openaireServicesBaseUrl}/usagestats
db: db:
driverClassName: org.postgresql.Driver driverClassName: org.postgresql.Driver
password: dnetPwd password: dnetPwd
@ -66,12 +67,12 @@ services:
password: XX password: XX
port: 6379 port: 6379
topic_types: topic_types:
url: https://beta.services.openaire.eu/provision/mvc/vocabularies/dnet:topic_types.json url: ${services.openaireServicesBaseUrl}/provision/mvc/vocabularies/dnet:topic_types.json
usageStatisticsDiagramsBaseURL: https://beta.openaire.eu/stats3/ usageStatisticsDiagramsBaseURL: https://beta.openaire.eu/stats3/
usageStatisticsNumbersBaseURL: https://beta.services.openaire.eu/usagestats/datasources/ usageStatisticsNumbersBaseURL: ${services.openaireServicesBaseUrl}/usagestats/datasources/
usagestats: usagestats:
adminEmail: XX adminEmail: XX
sushiliteEndpoint: https://beta.services.openaire.eu/usagestats/sushilite/ sushiliteEndpoint: ${services.openaireServicesBaseUrl}/usagestats/sushilite/
validator: validator:
results: results:
url: https://beta.provide.openaire.eu/compatibility/browseHistory/ url: https://beta.provide.openaire.eu/compatibility/browseHistory/