001/* 002 * Copyright 2020 Global Biodiversity Information Facility (GBIF) 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package org.gbif.api.service.occurrence; 017 018import org.gbif.api.vocabulary.BasisOfRecord; 019import org.gbif.api.vocabulary.Kingdom; 020 021import java.util.Map; 022 023import javax.validation.constraints.Min; 024 025/** 026 * Supports listing occurrence counts by known dimensions. 027 */ 028public interface OccurrenceDistributionIndexService { 029 030 /** 031 * Returns the occurrence records count by basis of record. The result is ordered descending by the count. 032 */ 033 Map<BasisOfRecord, Long> getBasisOfRecordCounts(); 034 035 /** 036 * Returns the occurrence records count by kingdom. The result is ordered descending by the count. 037 */ 038 Map<Kingdom, Long> getKingdomCounts(); 039 040 /** 041 * Returns the occurrence records count by year. The result is ordered descending by the count. 042 * 043 * @param from minimum year 044 * @param to maximum year 045 */ 046 Map<Integer, Long> getYearCounts(@Min(0) int from, @Min(0) int to); 047 048}