@RepositoryRestController public class RepositoryController extends Object
Constructor and Description |
---|
RepositoryController(PagedResourcesAssembler<Object> assembler,
Repositories repositories,
org.springframework.hateoas.EntityLinks entityLinks,
ResourceMappings mappings,
AuditableBeanWrapperFactory auditableBeanWrapperFactory)
Creates a new
RepositoryController for the given PagedResourcesAssembler , Repositories ,
EntityLinks and ResourceMappings . |
Modifier and Type | Method and Description |
---|---|
protected org.springframework.hateoas.Resources<?> |
entitiesToResources(Iterable<Object> entities,
PersistentEntityResourceAssembler assembler,
Class<?> domainType) |
protected org.springframework.hateoas.Resources<?> |
entitiesToResources(Page<Object> page,
PersistentEntityResourceAssembler assembler,
Class<?> domainType,
org.springframework.hateoas.Link baseLink) |
protected AuditableBeanWrapper |
getAuditableBeanWrapper(Object source)
Returns the
AuditableBeanWrapper for the given source. |
protected org.springframework.hateoas.Link |
getDefaultSelfLink() |
ResponseEntity<?> |
headForRepositories()
HEAD / |
HttpEntity<RepositoryLinksResource> |
listRepositories()
Lists all repositories exported by creating a link list pointing to resources exposing the repositories.
|
HttpEntity<?> |
optionsForRepositories()
OPTIONS / . |
protected HttpHeaders |
prepareHeaders(PersistentEntity<?,?> entity,
Object value)
Retruns the default headers to be returned for the given
PersistentEntity and value. |
protected HttpHeaders |
prepareHeaders(PersistentEntityResource resource)
Returns the default headers to be returned for the given
PersistentEntityResource . |
protected org.springframework.hateoas.Link |
resourceLink(RootResourceInformation resourceLink,
org.springframework.hateoas.Resource resource) |
protected Object |
toResource(Object source,
PersistentEntityResourceAssembler assembler,
Class<?> domainType,
org.springframework.hateoas.Link baseLink)
Turns the given source into a
ResourceSupport if needed and possible. |
protected org.springframework.hateoas.Resources<?> |
toResources(Iterable<?> source,
PersistentEntityResourceAssembler assembler,
Class<?> domainType,
org.springframework.hateoas.Link baseLink) |
@Autowired public RepositoryController(PagedResourcesAssembler<Object> assembler, Repositories repositories, org.springframework.hateoas.EntityLinks entityLinks, ResourceMappings mappings, AuditableBeanWrapperFactory auditableBeanWrapperFactory)
RepositoryController
for the given PagedResourcesAssembler
, Repositories
,
EntityLinks
and ResourceMappings
.assembler
- must not be null.repositories
- must not be null.entityLinks
- must not be null.mappings
- must not be null.auditableBeanWrapperFactory
- must not be null.@RequestMapping(value={"/",""}, method=OPTIONS) public HttpEntity<?> optionsForRepositories()
OPTIONS /
.@RequestMapping(value={"/",""}, method=HEAD) public ResponseEntity<?> headForRepositories()
HEAD /
@RequestMapping(value={"/",""}, method=GET) public HttpEntity<RepositoryLinksResource> listRepositories()
protected org.springframework.hateoas.Link resourceLink(RootResourceInformation resourceLink, org.springframework.hateoas.Resource resource)
protected org.springframework.hateoas.Resources<?> toResources(Iterable<?> source, PersistentEntityResourceAssembler assembler, Class<?> domainType, org.springframework.hateoas.Link baseLink)
protected Object toResource(Object source, PersistentEntityResourceAssembler assembler, Class<?> domainType, org.springframework.hateoas.Link baseLink)
ResourceSupport
if needed and possible. Uses the given
PersistentEntityResourceAssembler
for the actual conversion.source
- can be must not be null.assembler
- must not be null.domainType
- the domain type in case the source is an empty iterable, must not be null.baseLink
- can be null.protected org.springframework.hateoas.Resources<?> entitiesToResources(Page<Object> page, PersistentEntityResourceAssembler assembler, Class<?> domainType, org.springframework.hateoas.Link baseLink)
protected org.springframework.hateoas.Resources<?> entitiesToResources(Iterable<Object> entities, PersistentEntityResourceAssembler assembler, Class<?> domainType)
protected HttpHeaders prepareHeaders(PersistentEntityResource resource)
PersistentEntityResource
. Will set ETag
and Last-Modified
headers if applicable.resource
- can be null.protected HttpHeaders prepareHeaders(PersistentEntity<?,?> entity, Object value)
PersistentEntity
and value. Will set ETag
and Last-Modified
headers if applicable.entity
- must not be null.value
- must not be null.protected AuditableBeanWrapper getAuditableBeanWrapper(Object source)
AuditableBeanWrapper
for the given source.source
- can be null.protected org.springframework.hateoas.Link getDefaultSelfLink()
Copyright © 2011-2015–2016 Pivotal Software, Inc.. All rights reserved.