Package org.gbif.api.service.collections
Interface DescriptorsService
public interface DescriptorsService
API service to work with collection descriptors.
-
Method Summary
Modifier and TypeMethodDescriptionlongcountDescriptors(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.getDescriptor(@javax.validation.constraints.NotNull long key) Retrieves a descriptor by its key.getDescriptorGroup(@javax.validation.constraints.NotNull long key) Retrieves a descriptor group by its key.getVerbatimNames(long descriptorGroupKey) Get the names of the verbatim fields of a descriptor group.listDescriptorGroups(@NotNull UUID collectionKey, DescriptorGroupSearchRequest searchRequest) PagesDescriptorGroupentities based on the parameters received.listDescriptors(DescriptorSearchRequest searchRequest) PagesDescriptorentities based on the parameters received.voidReinterprets 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 Details
-
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
Deletes a descriptor group by key.- Parameters:
key- of the descriptor group to be deleted.
-
getDescriptorGroup
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
Retrieves a descriptor by its key.- Parameters:
key- of the descriptor to be retrieved.- Returns:
- the descriptor
-
listDescriptors
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
Counts the number ofDescriptorfor the request received.- Parameters:
searchRequest-DescriptorSearchRequestwith all the parameters- Returns:
- number of descriptors
-
getVerbatimNames
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
Reinterprets all the descriptor groups of a collection.- Parameters:
collectionKey- key of the collection
-
reinterpretAllDescriptorGroups
Reinterprets all the descriptor groups of all collections.
-