Package org.gbif.api.service.registry
Interface OccurrenceDownloadService
-
public interface OccurrenceDownloadService
Interface to access and persist information about occurrence download events.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description long
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
create(@NotNull @Valid Download download)
Persists the occurrence download object.void
createUsages(@NotNull String downloadKey, @NotNull Map<UUID,Long> datasetCitations)
Persists usages of datasets in an occurrence download.Download
get(@NotNull String keyOrDoi)
Retrieves a occurrence download by its unique key or DOI.String
getCitation(@NotNull String keyOrDoi)
Retrieve citation details of a download by its unique key or DOI.Map<Integer,Map<Integer,Long>>
getDownloadedRecordsByDataset(Date fromDate, Date toDate, Country publishingCountry, UUID datasetKey, UUID publishingOrgKey)
Retrieves downloaded records monthly stats by country (user and publishing country) and dataset.Map<Integer,Map<Integer,Long>>
getDownloadsByDataset(Date fromDate, Date toDate, Country publishingCountry, UUID datasetKey, UUID publishingOrgKey)
Retrieves downloads monthly stats by country (user and publishing country) and dataset.Map<Integer,Map<Integer,Long>>
getDownloadsBySource(Date fromDate, Date toDate, String source)
Retrieves downloads monthly stats by source.Map<Integer,Map<Integer,Long>>
getDownloadsByUserCountry(Date fromDate, Date toDate, Country userCountry)
Retrieves downloads monthly stats by country (user and publishing country) and dataset.PagingResponse<DownloadStatistics>
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.PagingResponse<Download>
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.PagingResponse<Download>
listByEraseAfter(Pageable page, String eraseAfter, Long size, String erasureNotification)
Retrieves a pageable result of the downloads created by a user in a given status.PagingResponse<Download>
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.PagingResponse<CountryOccurrenceDownloadUsage>
listCountryUsages(@NotNull String keyOrDoi, CountryUsageSortField sortBy, SortOrder sortOrder, Pageable page)
PagingResponse<DatasetOccurrenceDownloadUsage>
listDatasetUsages(@NotNull String keyOrDoi, String datasetTitle, DatasetUsageSortField sortBy, SortOrder sortOrder, Pageable page)
PagingResponse<DatasetOccurrenceDownloadUsage>
listDatasetUsages(@NotNull String keyOrDoi, Pageable page)
Retrieves a pageable result of the dataset usages in a occurrence download.PagingResponse<OrganizationOccurrenceDownloadUsage>
listOrganizationUsages(@NotNull String keyOrDoi, String organizationTitle, OrganizationUsageSortField sortBy, SortOrder sortOrder, Pageable page)
void
update(@NotNull @Valid Download download)
Update an existing occurrence download.
-
-
-
Method Detail
-
create
void create(@NotNull @Valid @NotNull @Valid Download download)
Persists the occurrence download object. The object must contain a unique key, the persistence storage doesn't generate one for it.
-
get
Download get(@NotNull @NotNull String keyOrDoi)
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
long count(@Nullable Set<Download.Status> status, @Nullable String source)
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
void update(@NotNull @Valid @NotNull @Valid Download download)
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
String getCitation(@NotNull @NotNull String keyOrDoi)
Retrieve citation details of a download by its unique key or DOI.
-
getDownloadsByUserCountry
Map<Integer,Map<Integer,Long>> getDownloadsByUserCountry(@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,Long>> getDownloadsBySource(@Nullable Date fromDate, @Nullable Date toDate, @Nullable String source)
Retrieves downloads monthly stats by source.
-
getDownloadedRecordsByDataset
Map<Integer,Map<Integer,Long>> getDownloadedRecordsByDataset(@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,Long>> getDownloadsByDataset(@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.
-
-