Package org.gbif.api.service.collections
Interface CollectionService
- All Superinterfaces:
CollectionEntityService<Collection>,CommentService,ContactService,CrudService<Collection>,IdentifierService,MachineTagService,OccurrenceMappingService,PrimaryIdentifierService,TagService
API Service to work with collections.
-
Method Summary
Modifier and TypeMethodDescriptioncreateFromDataset(UUID datasetKey, String collectionCode) Creates aCollectionfrom aDataset.createFromLatimerCore(@NotNull @Valid ObjectGroup objectGroup) Similar toCrudService.create(CollectionEntity)but it accepts Latimer Core.getAsLatimerCore(@NotNull UUID key) Similar toCrudService.get(UUID)but it returns the result in Latimer Core format.getCollectionsForInstitutionsBySearch(InstitutionSearchRequest searchRequest) Gets collections that belong to institutions matching the provided search criteria.getCollectionView(@NotNull UUID key) Retrieves aCollectionViewby the collection key.list(CollectionSearchRequest searchRequest) PagesCollectionentities based on the parameters received.listAsLatimerCore(CollectionSearchRequest searchRequest) Similar to thelist(CollectionSearchRequest)method but returns the results in Latimer Core format.listDeleted(CollectionSearchRequest searchRequest) Provides access to deleted collections.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, updateMethods inherited from interface org.gbif.api.service.registry.CommentService
addComment, deleteComment, listCommentsMethods inherited from interface org.gbif.api.service.collections.ContactService
addContactPerson, addSuggestionContacts, listContactPersons, removeContactPerson, replaceContactPersons, updateContactPersonMethods inherited from interface org.gbif.api.service.collections.CrudService
create, delete, exists, get, updateMethods inherited from interface org.gbif.api.service.registry.IdentifierService
addIdentifier, deleteIdentifier, listIdentifiersMethods inherited from interface org.gbif.api.service.registry.MachineTagService
addMachineTag, addMachineTag, addMachineTag, deleteMachineTag, deleteMachineTags, deleteMachineTags, deleteMachineTags, deleteMachineTags, listMachineTagsMethods inherited from interface org.gbif.api.service.collections.OccurrenceMappingService
addOccurrenceMapping, deleteOccurrenceMapping, listOccurrenceMappingsMethods inherited from interface org.gbif.api.service.registry.PrimaryIdentifierService
updateIdentifierMethods inherited from interface org.gbif.api.service.registry.TagService
addTag, addTag, deleteTag, listTags
-
Method Details
-
list
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
Similar to thelist(CollectionSearchRequest)method but returns the results in Latimer Core format. -
listDeleted
Provides access to deleted collections. -
getAsLatimerCore
Similar toCrudService.get(UUID)but it returns the result in Latimer Core format. -
createFromLatimerCore
Similar toCrudService.create(CollectionEntity)but it accepts Latimer Core. -
updateFromLatimerCore
Similar toCrudService.update(CollectionEntity))} but it accepts Latimer Core. -
getCollectionView
Retrieves aCollectionViewby the collection key. -
suggest
Provides a simple suggest service. -
createFromDataset
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
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
-