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
ConstructorsConstructorDescriptionRepositoryController(org.springframework.data.web.PagedResourcesAssembler<Object> assembler, org.springframework.data.repository.support.Repositories repositories, org.springframework.hateoas.server.EntityLinks entityLinks, ResourceMappings mappings) Creates a newRepositoryControllerfor the givenPagedResourcesAssembler,Repositories,EntityLinksandResourceMappings. -
Method Summary
Modifier and TypeMethodDescriptionprotected org.springframework.hateoas.CollectionModel<?>entitiesToResources(Iterable<Object> entities, PersistentEntityResourceAssembler assembler, Class<?> domainType) protected org.springframework.hateoas.CollectionModel<?>entitiesToResources(org.springframework.data.domain.Page<Object> page, PersistentEntityResourceAssembler assembler, Class<?> domainType, Optional<org.springframework.hateoas.Link> baseLink) protected org.springframework.hateoas.Linkorg.springframework.http.ResponseEntity<?>HEAD /org.springframework.http.HttpEntity<RepositoryLinksResource>Lists all repositories exported by creating a link list pointing to resources exposing the repositories.org.springframework.http.HttpEntity<?>OPTIONS /.protected org.springframework.hateoas.LinkresourceLink(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(org.springframework.data.web.PagedResourcesAssembler<Object> assembler, org.springframework.data.repository.support.Repositories repositories, org.springframework.hateoas.server.EntityLinks entityLinks, ResourceMappings mappings) Creates a newRepositoryControllerfor the givenPagedResourcesAssembler,Repositories,EntityLinksandResourceMappings.- Parameters:
assembler- must not be null.repositories- must not be null.entityLinks- must not be null.mappings- must not be null.
-
-
Method Details
-
optionsForRepositories
@RequestMapping(value={"/",""}, method=OPTIONS) public org.springframework.http.HttpEntity<?> optionsForRepositories()OPTIONS /.- Returns:
- Since:
- 2.2
-
headForRepositories
@RequestMapping(value={"/",""}, method=HEAD) public org.springframework.http.ResponseEntity<?> headForRepositories()HEAD /- Returns:
- Since:
- 2.2
-
listRepositories
@RequestMapping(value={"/",""}, method=GET) public org.springframework.http.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(org.springframework.data.domain.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()
-