Package org.gbif.api.util.iterables
Class Iterables
java.lang.Object
org.gbif.api.util.iterables.Iterables
Factory constructing registry entity iterables using specific pagers under the hood.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Iterable<CollectionView>
collections
(CollectionSearchRequest searchRequest, CollectionService service, Integer limit) Iterable forCollectionService.list(CollectionSearchRequest)
.constituentDatasets
(UUID key, DatasetService service) datasetOccurrenceDownloadUsages
(OccurrenceDownloadService service, String downloadKey, Integer limit) datasets
(UUID key, DatasetType type, DatasetService ds, OrganizationService os, InstallationService is, NetworkService ns, NodeService nos) datasets
(UUID key, DatasetType type, DatasetService ds, OrganizationService os, InstallationService is, NetworkService ns, NodeService nos, int pageSize) Returns a dataset iterable by testing the given registry key first to see whether it is a dataset, organization or installation.datasets
(DatasetType type, DatasetService service) static Iterable<DatasetSearchResult>
datasetSearchResults
(DatasetSearchRequest datasetSearchRequest, DatasetSearchService datasetSearchService, Integer limit) Iterates over dataset search results.static Iterable<Descriptor>
descriptors
(DescriptorsService service, DescriptorSearchRequest searchRequest, Integer limit) descriptorVerbatims
(DescriptorsService service, DescriptorSearchRequest searchRequest, Integer limit) Iterable for the verbatim fields ofDescriptorsService.listDescriptors(DescriptorSearchRequest)
.static Iterable<DownloadStatistics>
downloadStatistics
(OccurrenceDownloadService service, Date fromDate, Date toDate, Country publishingCountry, UUID datasetKey, UUID publishingOrgKey, Integer limit) endorsedDatasets
(UUID nodeKey, DatasetType type, NodeService service) static Iterable<Organization>
endorsedOrganizations
(UUID nodeKey, NodeService service) hostedDatasets
(UUID key, DatasetType type, InstallationService service) hostedDatasets
(UUID key, DatasetType type, OrganizationService service) static Iterable<Institution>
institutions
(InstitutionSearchRequest searchRequest, InstitutionService service, Integer limit) Iterable forInstitutionService.list(InstitutionSearchRequest)
.networkDatasets
(UUID key, DatasetType type, NetworkService service) Iterates over all constituents of a given network.nodes
(NodeService service) Iterate over all endorsing nodesstatic Iterable<Organization>
organizations
(Country country, OrganizationService service) publishedDatasets
(UUID key, DatasetType type, OrganizationService service)
-
Method Details
-
datasets
public static Iterable<Dataset> datasets(@Nullable UUID key, @Nullable DatasetType type, DatasetService ds, OrganizationService os, InstallationService is, NetworkService ns, NodeService nos) - Parameters:
key
- a valid dataset, organization or installation key. If null all datasets will be iterated over- Throws:
IllegalArgumentException
- if given key is not existing
-
datasets
public static Iterable<Dataset> datasets(@Nullable UUID key, @Nullable DatasetType type, DatasetService ds, OrganizationService os, InstallationService is, NetworkService ns, NodeService nos, int pageSize) Returns a dataset iterable by testing the given registry key first to see whether it is a dataset, organization or installation. In case of an organization key the published datasets will be returned.- Parameters:
key
- a valid dataset, organization or installation key. If null all datasets will be iterated overpageSize
- to use when talking to the registry- Throws:
IllegalArgumentException
- if given key is not existing
-
datasets
- Parameters:
type
- an optional filter to just include the given dataset type
-
datasetSearchResults
public static Iterable<DatasetSearchResult> datasetSearchResults(@Nullable DatasetSearchRequest datasetSearchRequest, DatasetSearchService datasetSearchService, @Nullable Integer limit) Iterates over dataset search results. -
publishedDatasets
public static Iterable<Dataset> publishedDatasets(UUID key, @Nullable DatasetType type, OrganizationService service) - Parameters:
key
- a valid organization keytype
- an optional filter to just include the given dataset type
-
hostedDatasets
public static Iterable<Dataset> hostedDatasets(UUID key, @Nullable DatasetType type, OrganizationService service) - Parameters:
key
- a valid organization keytype
- an optional filter to just include the given dataset type
-
hostedDatasets
public static Iterable<Dataset> hostedDatasets(UUID key, @Nullable DatasetType type, InstallationService service) - Parameters:
key
- a valid installation keytype
- an optional filter to just include the given dataset type
-
constituentDatasets
- Parameters:
key
- a valid dataset key
-
networkDatasets
public static Iterable<Dataset> networkDatasets(UUID key, @Nullable DatasetType type, NetworkService service) Iterates over all constituents of a given network.- Parameters:
key
- a valid network keytype
- an optional filter to just include the given dataset type
-
endorsedDatasets
public static Iterable<Dataset> endorsedDatasets(UUID nodeKey, @Nullable DatasetType type, NodeService service) - Parameters:
nodeKey
- a valid endorsing node keytype
- an optional filter to just include the given dataset type
-
datasetsIterable
public static Iterable<Dataset> datasetsIterable(Function<PagingRequest, PagingResponse<Dataset>> pager) - Parameters:
pager
- producer function of next page response- Returns:
- a dataset iterable based on producer function
-
organizations
public static Iterable<Organization> organizations(@Nullable Country country, OrganizationService service) - Parameters:
country
- an optional country filter
-
endorsedOrganizations
- Parameters:
nodeKey
- a valid endorsing node key
-
nodes
Iterate over all endorsing nodes -
downloadStatistics
public static Iterable<DownloadStatistics> downloadStatistics(OccurrenceDownloadService service, @Nullable Date fromDate, @Nullable Date toDate, @Nullable Country publishingCountry, @Nullable UUID datasetKey, @Nullable UUID publishingOrgKey, @Nullable Integer limit) -
datasetOccurrenceDownloadUsages
public static Iterable<DatasetOccurrenceDownloadUsage> datasetOccurrenceDownloadUsages(OccurrenceDownloadService service, String downloadKey, @Nullable Integer limit) -
collections
public static Iterable<CollectionView> collections(CollectionSearchRequest searchRequest, CollectionService service, @Nullable Integer limit) Iterable forCollectionService.list(CollectionSearchRequest)
. -
institutions
public static Iterable<Institution> institutions(InstitutionSearchRequest searchRequest, InstitutionService service, @Nullable Integer limit) Iterable forInstitutionService.list(InstitutionSearchRequest)
. -
descriptors
public static Iterable<Descriptor> descriptors(DescriptorsService service, DescriptorSearchRequest searchRequest, @Nullable Integer limit) -
descriptorVerbatims
public static Iterable<Map<String,String>> descriptorVerbatims(DescriptorsService service, DescriptorSearchRequest searchRequest, @Nullable Integer limit) Iterable for the verbatim fields ofDescriptorsService.listDescriptors(DescriptorSearchRequest)
.
-