Class RepositoryController
java.lang.Object
org.springframework.data.rest.webmvc.RepositoryController
Controller for the root resource exposing links to the repository resources.
- Author:
- Jon Brisbin, Oliver Gierke
-
Constructor Summary
ConstructorDescriptionRepositoryController
(PagedResourcesAssembler<Object> assembler, Repositories repositories, org.springframework.hateoas.server.EntityLinks entityLinks, ResourceMappings mappings) Creates a newRepositoryController
for the givenPagedResourcesAssembler
,Repositories
,EntityLinks
andResourceMappings
. -
Method Summary
Modifier and TypeMethodDescriptionprotected org.springframework.hateoas.CollectionModel<?>
entitiesToResources
(Iterable<Object> entities, PersistentEntityResourceAssembler assembler, Class<?> domainType) protected org.springframework.hateoas.CollectionModel<?>
entitiesToResources
(Page<Object> page, PersistentEntityResourceAssembler assembler, Class<?> domainType, Optional<org.springframework.hateoas.Link> baseLink) protected org.springframework.hateoas.Link
HEAD /
Lists all repositories exported by creating a link list pointing to resources exposing the repositories.HttpEntity<?>
OPTIONS /
.protected org.springframework.hateoas.Link
resourceLink
(RootResourceInformation resourceLink, org.springframework.hateoas.EntityModel resource) protected org.springframework.hateoas.CollectionModel<?>
toCollectionModel
(Iterable<?> source, PersistentEntityResourceAssembler assembler, Class<?> domainType, Optional<org.springframework.hateoas.Link> baseLink)
-
Constructor Details
-
RepositoryController
@Autowired public RepositoryController(PagedResourcesAssembler<Object> assembler, Repositories repositories, org.springframework.hateoas.server.EntityLinks entityLinks, ResourceMappings mappings) Creates a newRepositoryController
for the givenPagedResourcesAssembler
,Repositories
,EntityLinks
andResourceMappings
.- Parameters:
assembler
- must not be null.repositories
- must not be null.entityLinks
- must not be null.mappings
- must not be null.
-
-
Method Details
-
optionsForRepositories
OPTIONS /
.- Returns:
- Since:
- 2.2
-
headForRepositories
HEAD /
- Returns:
- Since:
- 2.2
-
listRepositories
@RequestMapping(value={"/",""}, method=GET) public HttpEntity<RepositoryLinksResource> listRepositories()Lists all repositories exported by creating a link list pointing to resources exposing the repositories.- Returns:
-
resourceLink
protected org.springframework.hateoas.Link resourceLink(RootResourceInformation resourceLink, org.springframework.hateoas.EntityModel resource) -
toCollectionModel
protected org.springframework.hateoas.CollectionModel<?> toCollectionModel(Iterable<?> source, PersistentEntityResourceAssembler assembler, Class<?> domainType, Optional<org.springframework.hateoas.Link> baseLink) -
entitiesToResources
protected org.springframework.hateoas.CollectionModel<?> entitiesToResources(Page<Object> page, PersistentEntityResourceAssembler assembler, Class<?> domainType, Optional<org.springframework.hateoas.Link> baseLink) -
entitiesToResources
protected org.springframework.hateoas.CollectionModel<?> entitiesToResources(Iterable<Object> entities, PersistentEntityResourceAssembler assembler, Class<?> domainType) -
getDefaultSelfLink
protected org.springframework.hateoas.Link getDefaultSelfLink()
-