Package org.gbif.api.service.registry
Interface OccurrenceDownloadService
public interface OccurrenceDownloadService
Interface to access and persist information about occurrence download events.
-
Method Summary
Modifier and TypeMethodDescriptionlong
count
(Set<Download.Status> status, String source) Counts downloads based on the given parameters.long
countByUser
(@NotNull String user, Set<Download.Status> status, LocalDateTime from) Counts the downloads created by a user.void
Persists the occurrence download object.void
createUsages
(@NotNull String downloadKey, @NotNull Map<UUID, Long> datasetCitations) Persists usages of datasets in an occurrence download.Retrieves a occurrence download by its unique key or DOI.getCitation
(@NotNull String keyOrDoi) Retrieve citation details of a download by its unique key or DOI.getDownloadedRecordsByDataset
(Date fromDate, Date toDate, Country publishingCountry, UUID datasetKey, UUID publishingOrgKey) Retrieves downloaded records monthly stats by country (user and publishing country) and dataset.getDownloadsByDataset
(Date fromDate, Date toDate, Country publishingCountry, UUID datasetKey, UUID publishingOrgKey) Retrieves downloads monthly stats by country (user and publishing country) and dataset.getDownloadsBySource
(Date fromDate, Date toDate, String source) Retrieves downloads monthly stats by source.getDownloadsByUserCountry
(Date fromDate, Date toDate, Country userCountry) Retrieves downloads monthly stats by country (user and publishing country) and dataset.getDownloadStatistics
(Date fromDate, Date toDate, Country publishingCountry, UUID datasetKey, UUID publishingOrgKey, Pageable page) Retrieves downloads monthly stats by country (user and publishing country) and dataset.list
(Pageable page, Set<Download.Status> status, String source) Retrieves a pageable result of all the downloads, optionally the downloads can be filtered by status and source.listByEraseAfter
(Pageable page, String eraseAfter, Long size, String erasureNotification) Retrieves a pageable result of the downloads created by a user in a given status.listByUser
(@NotNull String user, Pageable page, Set<Download.Status> status, LocalDateTime from, Boolean statistics) Retrieves a pageable result of the downloads created by a user in a given status.listCountryUsages
(@NotNull String keyOrDoi, CountryUsageSortField sortBy, SortOrder sortOrder, Pageable page) listDatasetUsages
(@NotNull String keyOrDoi, String datasetTitle, DatasetUsageSortField sortBy, SortOrder sortOrder, Pageable page) listDatasetUsages
(@NotNull String keyOrDoi, Pageable page) Retrieves a pageable result of the dataset usages in a occurrence download.listOrganizationUsages
(@NotNull String keyOrDoi, String organizationTitle, OrganizationUsageSortField sortBy, SortOrder sortOrder, Pageable page) Update an existing occurrence download.
-
Method Details
-
create
Persists the occurrence download object. The object must contain a unique key, the persistence storage doesn't generate one for it. -
get
Retrieves a occurrence download by its unique key or DOI. -
list
PagingResponse<Download> list(@Nullable Pageable page, @Nullable Set<Download.Status> status, @Nullable String source) Retrieves a pageable result of all the downloads, optionally the downloads can be filtered by status and source. -
count
Counts downloads based on the given parameters. -
listByUser
PagingResponse<Download> listByUser(@NotNull @NotNull String user, @Nullable Pageable page, @Nullable Set<Download.Status> status, LocalDateTime from, Boolean statistics) Retrieves a pageable result of the downloads created by a user in a given status. -
countByUser
long countByUser(@NotNull @NotNull String user, @Nullable Set<Download.Status> status, LocalDateTime from) Counts the downloads created by a user. -
listByEraseAfter
PagingResponse<Download> listByEraseAfter(@Nullable Pageable page, @Nullable String eraseAfter, @Nullable Long size, @Nullable String erasureNotification) Retrieves a pageable result of the downloads created by a user in a given status.Internal use only; behaviour may change without notice.
-
update
Update an existing occurrence download. -
listDatasetUsages
PagingResponse<DatasetOccurrenceDownloadUsage> listDatasetUsages(@NotNull @NotNull String keyOrDoi, @Nullable Pageable page) Retrieves a pageable result of the dataset usages in a occurrence download.The Downloads in the DatasetOccurrenceDownloadUsages are null, to avoid redundant repetition of potentially large objects.
-
listDatasetUsages
PagingResponse<DatasetOccurrenceDownloadUsage> listDatasetUsages(@NotNull @NotNull String keyOrDoi, @Nullable String datasetTitle, @Nullable DatasetUsageSortField sortBy, @Nullable SortOrder sortOrder, @Nullable Pageable page) -
listOrganizationUsages
PagingResponse<OrganizationOccurrenceDownloadUsage> listOrganizationUsages(@NotNull @NotNull String keyOrDoi, @Nullable String organizationTitle, @Nullable OrganizationUsageSortField sortBy, @Nullable SortOrder sortOrder, @Nullable Pageable page) -
listCountryUsages
PagingResponse<CountryOccurrenceDownloadUsage> listCountryUsages(@NotNull @NotNull String keyOrDoi, @Nullable CountryUsageSortField sortBy, @Nullable SortOrder sortOrder, @Nullable Pageable page) -
getCitation
Retrieve citation details of a download by its unique key or DOI. -
getDownloadsByUserCountry
Map<Integer,Map<Integer, getDownloadsByUserCountryLong>> (@Nullable Date fromDate, @Nullable Date toDate, @Nullable Country userCountry) Retrieves downloads monthly stats by country (user and publishing country) and dataset. -
getDownloadsBySource
Map<Integer,Map<Integer, getDownloadsBySourceLong>> (@Nullable Date fromDate, @Nullable Date toDate, @Nullable String source) Retrieves downloads monthly stats by source. -
getDownloadedRecordsByDataset
Map<Integer,Map<Integer, getDownloadedRecordsByDatasetLong>> (@Nullable Date fromDate, @Nullable Date toDate, @Nullable Country publishingCountry, @Nullable UUID datasetKey, @Nullable UUID publishingOrgKey) Retrieves downloaded records monthly stats by country (user and publishing country) and dataset. -
getDownloadsByDataset
Map<Integer,Map<Integer, getDownloadsByDatasetLong>> (@Nullable Date fromDate, @Nullable Date toDate, @Nullable Country publishingCountry, @Nullable UUID datasetKey, @Nullable UUID publishingOrgKey) Retrieves downloads monthly stats by country (user and publishing country) and dataset. -
getDownloadStatistics
PagingResponse<DownloadStatistics> getDownloadStatistics(@Nullable Date fromDate, @Nullable Date toDate, @Nullable Country publishingCountry, @Nullable UUID datasetKey, @Nullable UUID publishingOrgKey, @Nullable Pageable page) Retrieves downloads monthly stats by country (user and publishing country) and dataset. -
createUsages
void createUsages(@NotNull @NotNull String downloadKey, @NotNull @NotNull Map<UUID, Long> datasetCitations) Persists usages of datasets in an occurrence download.- Parameters:
downloadKey
- downloadkey of the datasets' usage information.datasetCitations
- map of datasetkey as key and number of records as value.
-