@RepositoryRestController public class RepositoryController extends Object
Constructor and Description |
---|
RepositoryController(PagedResourcesAssembler<Object> assembler,
Repositories repositories,
org.springframework.hateoas.EntityLinks entityLinks,
ResourceMappings mappings)
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 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 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)
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.@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 org.springframework.hateoas.Link getDefaultSelfLink()
Copyright © 2011-2015–2017 Pivotal Software, Inc.. All rights reserved.