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 UUID
createFromDataset(UUID datasetKey, String collectionCode)
Creates aCollection
from aDataset
.UUID
createFromLatimerCore(@NotNull @Valid ObjectGroup objectGroup)
Similar toCrudService.create(CollectionEntity)
but it accepts Latimer Core.ObjectGroup
getAsLatimerCore(@NotNull UUID key)
Similar toCrudService.get(UUID)
but it returns the result in Latimer Core format.CollectionView
getCollectionView(@NotNull UUID key)
Retrieves aCollectionView
by the collection key.PagingResponse<CollectionView>
list(CollectionSearchRequest searchRequest)
PagesCollection
entities 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.void
updateFromLatimerCore(@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)
PagesCollection
entities 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
-CollectionSearchRequest
with 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 aCollectionView
by the collection key.
-
suggest
List<KeyCodeNameResult> suggest(@Nullable String q)
Provides a simple suggest service.
-
createFromDataset
UUID createFromDataset(UUID datasetKey, String collectionCode)
Creates aCollection
from 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
-
-