Package org.gbif.api.service.collections
Interface CollectionService
-
- All Superinterfaces:
CollectionEntityService<Collection>,CommentService,ContactService,CrudService<Collection>,IdentifierService,MachineTagService,OccurrenceMappingService,PrimaryIdentifierService,TagService
public interface CollectionService extends CollectionEntityService<Collection>
API Service to work with collections.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description UUIDcreateFromDataset(UUID datasetKey, String collectionCode)Creates aCollectionfrom aDataset.UUIDcreateFromLatimerCore(@NotNull @Valid ObjectGroup objectGroup)Similar toCrudService.create(CollectionEntity)but it accepts Latimer Core.ObjectGroupgetAsLatimerCore(@NotNull UUID key)Similar toCrudService.get(UUID)but it returns the result in Latimer Core format.List<CollectionView>getCollectionsForInstitutionsBySearch(InstitutionSearchRequest searchRequest)Gets collections that belong to institutions matching the provided search criteria.CollectionViewgetCollectionView(@NotNull UUID key)Retrieves aCollectionViewby the collection key.PagingResponse<CollectionView>list(CollectionSearchRequest searchRequest)PagesCollectionentities based on the parameters received.PagingResponse<ObjectGroup>listAsLatimerCore(CollectionSearchRequest searchRequest)Similar to thelist(CollectionSearchRequest)method but returns the results in Latimer Core format.PagingResponse<CollectionView>listDeleted(CollectionSearchRequest searchRequest)Provides access to deleted collections.List<KeyCodeNameResult>suggest(String q)Provides a simple suggest service.voidupdateFromLatimerCore(@NotNull @Valid ObjectGroup entity)Similar toCrudService.update(CollectionEntity))} but it accepts Latimer Core.-
Methods inherited from interface org.gbif.api.service.collections.CollectionEntityService
addMasterSourceMetadata, deleteMasterSourceMetadata, findByMasterSource, getMasterSourceMetadata, replace, update
-
Methods inherited from interface org.gbif.api.service.registry.CommentService
addComment, deleteComment, listComments
-
Methods inherited from interface org.gbif.api.service.collections.ContactService
addContactPerson, addSuggestionContacts, listContactPersons, removeContactPerson, replaceContactPersons, updateContactPerson
-
Methods inherited from interface org.gbif.api.service.collections.CrudService
create, delete, exists, get, update
-
Methods inherited from interface org.gbif.api.service.registry.IdentifierService
addIdentifier, deleteIdentifier, listIdentifiers
-
Methods inherited from interface org.gbif.api.service.registry.MachineTagService
addMachineTag, addMachineTag, addMachineTag, deleteMachineTag, deleteMachineTags, deleteMachineTags, deleteMachineTags, deleteMachineTags, listMachineTags
-
Methods inherited from interface org.gbif.api.service.collections.OccurrenceMappingService
addOccurrenceMapping, deleteOccurrenceMapping, listOccurrenceMappings
-
Methods inherited from interface org.gbif.api.service.registry.PrimaryIdentifierService
updateIdentifier
-
Methods inherited from interface org.gbif.api.service.registry.TagService
addTag, addTag, deleteTag, listTags
-
-
-
-
Method Detail
-
list
PagingResponse<CollectionView> list(CollectionSearchRequest searchRequest)
PagesCollectionentities based on the parameters received.To iterate over all entities you can use code like this:
PagingRequest req = new PagingRequest(); PagingResponse<T> response; do { response = service.list(req); for (T obj : response.getResults()) { doStuff(); } req.nextPage(); } while (!response.isEndOfRecords());- Parameters:
searchRequest-CollectionSearchRequestwith all the parameters- Returns:
- a list of entities ordered by their creation date, newest coming first
-
listAsLatimerCore
PagingResponse<ObjectGroup> listAsLatimerCore(CollectionSearchRequest searchRequest)
Similar to thelist(CollectionSearchRequest)method but returns the results in Latimer Core format.
-
listDeleted
PagingResponse<CollectionView> listDeleted(CollectionSearchRequest searchRequest)
Provides access to deleted collections.
-
getAsLatimerCore
ObjectGroup getAsLatimerCore(@NotNull @NotNull UUID key)
Similar toCrudService.get(UUID)but it returns the result in Latimer Core format.
-
createFromLatimerCore
UUID createFromLatimerCore(@NotNull @Valid @NotNull @Valid ObjectGroup objectGroup)
Similar toCrudService.create(CollectionEntity)but it accepts Latimer Core.
-
updateFromLatimerCore
void updateFromLatimerCore(@NotNull @Valid @NotNull @Valid ObjectGroup entity)
Similar toCrudService.update(CollectionEntity))} but it accepts Latimer Core.
-
getCollectionView
CollectionView getCollectionView(@NotNull @NotNull UUID key)
Retrieves aCollectionViewby the collection key.
-
suggest
List<KeyCodeNameResult> suggest(@Nullable String q)
Provides a simple suggest service.
-
createFromDataset
UUID createFromDataset(UUID datasetKey, String collectionCode)
Creates aCollectionfrom aDataset.- Parameters:
datasetKey- key of the dataset to create the collection fromcollectionCode- the code to assign to the collection since it can't be inferred from the dataset- Returns:
- UUID of the created collection
-
getCollectionsForInstitutionsBySearch
List<CollectionView> getCollectionsForInstitutionsBySearch(InstitutionSearchRequest searchRequest)
Gets collections that belong to institutions matching the provided search criteria. The method first retrieves all matching institutions using pagination, then returns their collections.- Parameters:
searchRequest- the institution search criteria- Returns:
- a list of collections
-
-