001/*
002 * Copyright 2013 Global Biodiversity Information Facility (GBIF)
003 * Licensed under the Apache License, Version 2.0 (the "License");
004 * you may not use this file except in compliance with the License.
005 * You may obtain a copy of the License at
006 * http://www.apache.org/licenses/LICENSE-2.0
007 * Unless required by applicable law or agreed to in writing, software
008 * distributed under the License is distributed on an "AS IS" BASIS,
009 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
010 * See the License for the specific language governing permissions and
011 * limitations under the License.
012 */
013package org.gbif.api.service.registry;
014
015import org.gbif.api.model.common.paging.Pageable;
016import org.gbif.api.model.common.paging.PagingResponse;
017import org.gbif.api.model.registry.DatasetOccurrenceDownloadUsage;
018
019import java.util.UUID;
020
021import javax.annotation.Nullable;
022import javax.validation.constraints.NotNull;
023
024/**
025 * Interface to access and persists information about occurrence download events.
026 * This interface was initially implemented as a internal GBIF component that shouldn't be exposed for the public use.
027 */
028public interface DatasetOccurrenceDownloadUsageService {
029
030  /**
031   * Persists data about the usage of dataset in an occurrence download.
032   */
033  void create(@NotNull DatasetOccurrenceDownloadUsage downloadDataset);
034
035
036  /**
037   * Retrieves a pageable result of the downloads which contain data taken from a dataset.
038   */
039  PagingResponse<DatasetOccurrenceDownloadUsage> listByDataset(@NotNull UUID datasetKey,
040    @Nullable Pageable page);
041}