Package org.gbif.api.util.iterables
Class Iterables
- java.lang.Object
-
- org.gbif.api.util.iterables.Iterables
-
-
Method Summary
-
-
-
Method Detail
-
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
public static Iterable<Dataset> datasets(@Nullable DatasetType type, DatasetService service)
- 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
public static Iterable<Dataset> constituentDatasets(UUID key, DatasetService service)
- 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
public static Iterable<Organization> endorsedOrganizations(UUID nodeKey, NodeService service)
- Parameters:
nodeKey
- a valid endorsing node key
-
nodes
public static Iterable<Node> nodes(NodeService service)
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)
.
-
-