Package org.gbif.api.service.collections
Interface DescriptorsService
-
public interface DescriptorsService
API service to work with collection descriptors.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description longcountDescriptors(DescriptorSearchRequest searchRequest)Counts the number ofDescriptorfor the request received.longcreateDescriptorGroup(@javax.validation.constraints.NotNull,@javax.validation.Valid byte[] descriptorsGroupFile, @NotNull ExportFormat format, @NotNull String title, String description, Set<String> tags, @NotNull UUID collectionKey)Creates a new descriptor group.voiddeleteDescriptorGroup(@javax.validation.constraints.NotNull long key)Deletes a descriptor group by key.DescriptorgetDescriptor(@javax.validation.constraints.NotNull long key)Retrieves a descriptor by its key.DescriptorGroupgetDescriptorGroup(@javax.validation.constraints.NotNull long key)Retrieves a descriptor group by its key.Set<String>getVerbatimNames(long descriptorGroupKey)Get the names of the verbatim fields of a descriptor group.PagingResponse<DescriptorGroup>listDescriptorGroups(@NotNull UUID collectionKey, DescriptorGroupSearchRequest searchRequest)PagesDescriptorGroupentities based on the parameters received.PagingResponse<Descriptor>listDescriptors(DescriptorSearchRequest searchRequest)PagesDescriptorentities based on the parameters received.voidreinterpretAllDescriptorGroups()Reinterprets all the descriptor groups of all collections.voidreinterpretCollectionDescriptorGroups(@NotNull UUID collectionKey)Reinterprets all the descriptor groups of a collection.voidreinterpretDescriptorGroup(@javax.validation.constraints.NotNull long descriptorGroupKey)Reinterprets a descriptor group.voidupdateDescriptorGroup(@javax.validation.constraints.NotNull long descriptorGroupKey, byte[] descriptorsGroupFile, @NotNull ExportFormat format, @NotNull String title, Set<String> tags, String description)Updates an existing descriptor group.
-
-
-
Method Detail
-
createDescriptorGroup
long createDescriptorGroup(@NotNull @Valid @javax.validation.constraints.NotNull,@javax.validation.Valid byte[] descriptorsGroupFile, @NotNull @NotNull ExportFormat format, @NotNull @NotNull String title, String description, Set<String> tags, @NotNull @NotNull UUID collectionKey)
Creates a new descriptor group. Takes the descriptor group file content, format, title, description, tags, and collection key as input.- Parameters:
descriptorsGroupFile- The byte array content of the descriptor group file.format- The format of the descriptor group file (e.g., CSV, TSV).title- The title of the descriptor group.description- Optional description for the descriptor group.tags- Optional set of tags associated with the descriptor group.collectionKey- The UUID key of the collection this descriptor group belongs to.- Returns:
- key of the created descriptor group.
-
deleteDescriptorGroup
void deleteDescriptorGroup(@NotNull @javax.validation.constraints.NotNull long key)
Deletes a descriptor group by key.- Parameters:
key- of the descriptor group to be deleted.
-
getDescriptorGroup
DescriptorGroup getDescriptorGroup(@NotNull @javax.validation.constraints.NotNull long key)
Retrieves a descriptor group by its key.- Parameters:
key- of the descriptor group to be retrieved.- Returns:
- the descriptor group
-
updateDescriptorGroup
void updateDescriptorGroup(@NotNull @javax.validation.constraints.NotNull long descriptorGroupKey, byte[] descriptorsGroupFile, @NotNull @NotNull ExportFormat format, @NotNull @NotNull String title, Set<String> tags, String description)
Updates an existing descriptor group.- Parameters:
descriptorGroupKey- The key of the descriptor group to update.descriptorsGroupFile- The new byte array content of the descriptor group file.format- The format of the new descriptor group file.title- The new title for the descriptor group.tags- An optional set of new tags for the descriptor group. Existing tags not included will be removed.description- An optional new description for the descriptor group.
-
listDescriptorGroups
PagingResponse<DescriptorGroup> listDescriptorGroups(@NotNull @NotNull UUID collectionKey, DescriptorGroupSearchRequest searchRequest)
PagesDescriptorGroupentities based on the parameters received.- Parameters:
searchRequest-DescriptorGroupSearchRequestwith all the parameters- Returns:
- a list of entities ordered by their creation date, newest coming first
-
getDescriptor
Descriptor getDescriptor(@NotNull @javax.validation.constraints.NotNull long key)
Retrieves a descriptor by its key.- Parameters:
key- of the descriptor to be retrieved.- Returns:
- the descriptor
-
listDescriptors
PagingResponse<Descriptor> listDescriptors(DescriptorSearchRequest searchRequest)
PagesDescriptorentities based on the parameters received.- Parameters:
searchRequest-DescriptorSearchRequestwith all the parameters- Returns:
- a list of entities ordered by their creation date, newest coming first
-
countDescriptors
long countDescriptors(DescriptorSearchRequest searchRequest)
Counts the number ofDescriptorfor the request received.- Parameters:
searchRequest-DescriptorSearchRequestwith all the parameters- Returns:
- number of descriptors
-
getVerbatimNames
Set<String> getVerbatimNames(long descriptorGroupKey)
Get the names of the verbatim fields of a descriptor group.- Parameters:
descriptorGroupKey- key of the descriptor group.- Returns:
- the names
-
reinterpretDescriptorGroup
void reinterpretDescriptorGroup(@NotNull @javax.validation.constraints.NotNull long descriptorGroupKey)
Reinterprets a descriptor group.- Parameters:
descriptorGroupKey- key of the descriptor group.
-
reinterpretCollectionDescriptorGroups
void reinterpretCollectionDescriptorGroups(@NotNull @NotNull UUID collectionKey)
Reinterprets all the descriptor groups of a collection.- Parameters:
collectionKey- key of the collection
-
reinterpretAllDescriptorGroups
void reinterpretAllDescriptorGroups()
Reinterprets all the descriptor groups of all collections.
-
-