Package org.gbif.api.service.registry
Interface NetworkEntityService<T>
-
- All Superinterfaces:
CommentService
,ContactService
,EndpointService
,IdentifierService
,MachineTagService
,TagService
- All Known Subinterfaces:
DatasetService
,InstallationService
,NetworkService
,NodeService
,OrganizationService
public interface NetworkEntityService<T> extends MachineTagService, TagService, CommentService, IdentifierService, EndpointService, ContactService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description UUID
create(T entity)
Creates a new entity.void
delete(@NotNull UUID key)
Deletes an entity by the provided key.T
get(@NotNull UUID key)
Gets an entity by the provided key.Map<UUID,String>
getTitles(@NotNull Collection<UUID> keys)
Retrieves all titles for the requested entity keys in one goPagingResponse<T>
list(Pageable page)
Deprecated.PagingResponse<T>
listByIdentifier(String identifier, Pageable page)
Deprecated.PagingResponse<T>
listByIdentifier(IdentifierType type, String identifier, Pageable page)
Deprecated.PagingResponse<T>
listByMachineTag(String namespace, String name, String value, Pageable page)
Deprecated.PagingResponse<T>
search(String query, Pageable page)
Deprecated.void
update(T entity)
Updates an existing entity.-
Methods inherited from interface org.gbif.api.service.registry.CommentService
addComment, deleteComment, listComments
-
Methods inherited from interface org.gbif.api.service.registry.ContactService
addContact, deleteContact, listContacts, updateContact
-
Methods inherited from interface org.gbif.api.service.registry.EndpointService
addEndpoint, deleteEndpoint, listEndpoints
-
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.registry.TagService
addTag, addTag, deleteTag, listTags
-
-
-
-
Method Detail
-
create
UUID create(@NotNull @Valid T entity)
Creates a new entity. Data should be valid.- Parameters:
entity
- to create- Returns:
- a key of the newly created entity.
-
update
void update(@NotNull @Valid T entity)
Updates an existing entity. Data should be valid.- Parameters:
entity
- to update.
-
delete
void delete(@NotNull @NotNull UUID key)
Deletes an entity by the provided key.- Parameters:
key
- of the entity to delete.
-
get
T get(@NotNull @NotNull UUID key)
Gets an entity by the provided key.- Parameters:
key
- of the entity to get- Returns:
- an entity.
-
getTitles
Map<UUID,String> getTitles(@NotNull @NotNull Collection<UUID> keys)
Retrieves all titles for the requested entity keys in one go- Parameters:
keys
- entity keys to get titles- Returns:
- pairs of entity key - entity title.
-
list
@Deprecated PagingResponse<T> list(@Nullable Pageable page)
Deprecated.Used to retrieve a list of network entities.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());
- Returns:
- a list of network entities ordered by their creation date, newest coming first
Deprecated: use the list with parameters service.
-
search
@Deprecated PagingResponse<T> search(String query, @Nullable Pageable page)
Deprecated.A simple search that supports paging.- Returns:
- a pageable response of network entities, with accurate counts.
Deprecated: use the list with parameters service.
-
listByIdentifier
@Deprecated PagingResponse<T> listByIdentifier(IdentifierType type, String identifier, @Nullable Pageable page)
Deprecated.Lists the entities by the provided identifier, scoped by type.- Returns:
- a pageable response of network entities, with accurate counts for the identifier
provided
Deprecated: use the list with parameters service.
-
listByIdentifier
@Deprecated PagingResponse<T> listByIdentifier(String identifier, @Nullable Pageable page)
Deprecated.Lists the entities by the provided identifier, which may be of any type.- Returns:
- a pageable response of network entities, with accurate counts for the identifier
provided
Deprecated: use the list with parameters service.
-
listByMachineTag
@Deprecated PagingResponse<T> listByMachineTag(String namespace, @Nullable String name, @Nullable String value, @Nullable Pageable page)
Deprecated.Lists the entities having a machine tag in the provided namespace, with the provided name and value.- Returns:
- a pageable response of network entities, with accurate counts for the machine tag
provided
Deprecated: use the list with parameters service.
-
-