Package io.rocketbase.commons.resource
Class AbstractCrudRestResource<Read,Write,ID extends Serializable>
- java.lang.Object
-
- io.rocketbase.commons.resource.AbstractBaseCrudRestResource<Read,Write>
-
- io.rocketbase.commons.resource.AbstractCrudRestResource<Read,Write,ID>
-
- All Implemented Interfaces:
BaseRestResource
public abstract class AbstractCrudRestResource<Read,Write,ID extends Serializable> extends AbstractBaseCrudRestResource<Read,Write>
-
-
Field Summary
-
Fields inherited from class io.rocketbase.commons.resource.AbstractBaseCrudRestResource
responseClass
-
-
Constructor Summary
Constructors Constructor Description AbstractCrudRestResource()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected org.springframework.web.util.UriComponentsBuilderbuildBaseUriBuilder()Readcreate(Write write)voiddelete(ID id)voidexecuteAll(Consumer<Read> execute, int batchSize)will call paged find method, iterate through all results and execute the consumer on all data instancesPageableResult<Read>find(int page, int pagesize)PageableResult<Read>find(org.springframework.data.domain.Pageable pageable)protected abstract StringgetBaseApiUrl()Optional<Read>getById(ID id)Readupdate(ID id, Write write)-
Methods inherited from class io.rocketbase.commons.resource.AbstractBaseCrudRestResource
create, createHttpEntity, createPagedTypeReference, delete, find, getById, getRestTemplate, update
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.rocketbase.commons.resource.BaseRestResource
appendParams, createHeaderWithLanguage, createUriComponentsBuilder, ensureEndsWithSlash, ensureStartsAndEndsWithSlash, ensureStartsWithSlash
-
-
-
-
Method Detail
-
executeAll
public void executeAll(Consumer<Read> execute, int batchSize)
will call paged find method, iterate through all results and execute the consumer on all data instances- Parameters:
execute- method to exeute on all found instancesbatchSize- pagesize with which the find method is called
-
find
public PageableResult<Read> find(int page, int pagesize)
-
find
public PageableResult<Read> find(org.springframework.data.domain.Pageable pageable)
-
delete
public void delete(ID id)
-
getBaseApiUrl
protected abstract String getBaseApiUrl()
- Returns:
- full qualified url to the entity base url
-
buildBaseUriBuilder
protected org.springframework.web.util.UriComponentsBuilder buildBaseUriBuilder()
-
-