Class RepositoryController

java.lang.Object
org.springframework.data.rest.webmvc.RepositoryController

@RepositoryRestController public class RepositoryController extends Object
Controller for the root resource exposing links to the repository resources.
Author:
Jon Brisbin, Oliver Gierke
  • 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 new RepositoryController for the given PagedResourcesAssembler, Repositories, EntityLinks and ResourceMappings.
      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()