@RepositoryRestController public class RepositoryPropertyReferenceController extends Object implements ApplicationEventPublisherAware
| Constructor and Description |
|---|
RepositoryPropertyReferenceController(Repositories repositories,
DomainClassConverter<?> domainClassConverter,
PagedResourcesAssembler<Object> assembler,
PersistentEntityResourceAssembler<Object> perAssembler) |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
protected <T extends Throwable> |
badRequest(HttpHeaders headers,
T throwable) |
protected <T extends Throwable> |
badRequest(T throwable) |
ResponseEntity<? extends org.springframework.hateoas.ResourceSupport> |
createPropertyReference(org.springframework.data.rest.webmvc.RepositoryRestRequest repoRequest,
org.springframework.hateoas.Resources<Object> incoming,
String id,
String property,
UriComponentsBuilder builder) |
ResponseEntity<? extends org.springframework.hateoas.ResourceSupport> |
deletePropertyReference(org.springframework.data.rest.webmvc.RepositoryRestRequest repoRequest,
String id,
String property) |
ResponseEntity<org.springframework.hateoas.ResourceSupport> |
deletePropertyReferenceId(org.springframework.data.rest.webmvc.RepositoryRestRequest repoRequest,
String id,
String property,
String propertyId) |
protected org.springframework.hateoas.Resources<org.springframework.hateoas.Resource<Object>> |
entitiesToResources(Iterable<Object> entities) |
protected org.springframework.hateoas.Resources<? extends org.springframework.hateoas.Resource<Object>> |
entitiesToResources(Page<Object> page,
PagedResourcesAssembler<Object> assembler) |
<T extends Throwable> |
errorResponse(HttpHeaders headers,
T throwable,
HttpStatus status) |
<T extends Throwable> |
errorResponse(T throwable,
HttpStatus status) |
ResponseEntity<org.springframework.hateoas.ResourceSupport> |
followPropertyReference(org.springframework.data.rest.webmvc.RepositoryRestRequest repoRequest,
String id,
String property) |
ResponseEntity<org.springframework.hateoas.ResourceSupport> |
followPropertyReference(org.springframework.data.rest.webmvc.RepositoryRestRequest repoRequest,
String id,
String property,
String propertyId) |
ResponseEntity<org.springframework.hateoas.ResourceSupport> |
followPropertyReferenceCompact(org.springframework.data.rest.webmvc.RepositoryRestRequest repoRequest,
String id,
String property) |
ResponseEntity |
handleConflict(Exception ex)
Send a 409 Conflict in case of concurrent modification.
|
ResponseEntity |
handleMiscFailures(Throwable t)
Handle failures commonly thrown from code tries to read incoming data and convert or cast it to the right type.
|
ResponseEntity<?> |
handleNoSuchMethod() |
ResponseEntity<?> |
handleNotFound() |
ResponseEntity<ExceptionMessage> |
handleNotReadable(HttpMessageNotReadableException e) |
ResponseEntity<?> |
handleNPE(NullPointerException npe) |
ResponseEntity |
handleRepositoryConstraintViolationException(Locale locale,
RepositoryConstraintViolationException rcve) |
protected <T> ResponseEntity<T> |
notFound() |
protected <T> ResponseEntity<T> |
notFound(HttpHeaders headers,
T body) |
protected org.springframework.hateoas.Link |
resourceLink(org.springframework.data.rest.webmvc.RepositoryRestRequest repoRequest,
org.springframework.hateoas.Resource resource) |
<T> ResponseEntity<T> |
response(HttpHeaders headers,
T body,
HttpStatus status) |
protected org.springframework.hateoas.Resources |
resultToResources(Object result) |
void |
setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) |
void |
setMessageSource(MessageSource messageSource) |
@Autowired public RepositoryPropertyReferenceController(Repositories repositories, DomainClassConverter<?> domainClassConverter, PagedResourcesAssembler<Object> assembler, PersistentEntityResourceAssembler<Object> perAssembler)
public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher)
setApplicationEventPublisher in interface ApplicationEventPublisherAware@RequestMapping(value="/{repository}/{id}/{property}", method=GET) public ResponseEntity<org.springframework.hateoas.ResourceSupport> followPropertyReference(org.springframework.data.rest.webmvc.RepositoryRestRequest repoRequest, @PathVariable String id, @PathVariable String property) throws ResourceNotFoundException, NoSuchMethodException
@RequestMapping(value="/{repository}/{id}/{property}", method=DELETE) public ResponseEntity<? extends org.springframework.hateoas.ResourceSupport> deletePropertyReference(org.springframework.data.rest.webmvc.RepositoryRestRequest repoRequest, @PathVariable String id, @PathVariable String property) throws ResourceNotFoundException, NoSuchMethodException, HttpRequestMethodNotSupportedException
@RequestMapping(value="/{repository}/{id}/{property}/{propertyId}", method=GET, produces={"application/json","application/x-spring-data-verbose+json","application/x-spring-data-compact+json","text/uri-list"}) public ResponseEntity<org.springframework.hateoas.ResourceSupport> followPropertyReference(org.springframework.data.rest.webmvc.RepositoryRestRequest repoRequest, @PathVariable String id, @PathVariable String property, @PathVariable String propertyId) throws ResourceNotFoundException, NoSuchMethodException
@RequestMapping(value="/{repository}/{id}/{property}", method=GET, produces={"application/x-spring-data-compact+json","text/uri-list"}) public ResponseEntity<org.springframework.hateoas.ResourceSupport> followPropertyReferenceCompact(org.springframework.data.rest.webmvc.RepositoryRestRequest repoRequest, @PathVariable String id, @PathVariable String property) throws ResourceNotFoundException, NoSuchMethodException
@RequestMapping(value="/{repository}/{id}/{property}", method={POST,PUT}, consumes={"application/json","application/x-spring-data-compact+json","text/uri-list"}) @ResponseBody public ResponseEntity<? extends org.springframework.hateoas.ResourceSupport> createPropertyReference(org.springframework.data.rest.webmvc.RepositoryRestRequest repoRequest, @RequestBody org.springframework.hateoas.Resources<Object> incoming, @PathVariable String id, @PathVariable String property, UriComponentsBuilder builder) throws NoSuchMethodException
NoSuchMethodException@RequestMapping(value="/{repository}/{id}/{property}/{propertyId}", method=DELETE) @ResponseBody public ResponseEntity<org.springframework.hateoas.ResourceSupport> deletePropertyReferenceId(org.springframework.data.rest.webmvc.RepositoryRestRequest repoRequest, @PathVariable String id, @PathVariable String property, @PathVariable String propertyId) throws NoSuchMethodException
NoSuchMethodExceptionpublic void setMessageSource(MessageSource messageSource)
setMessageSource in interface MessageSourceAwarepublic void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface InitializingBeanException@ExceptionHandler(value=java.lang.NullPointerException.class) @ResponseBody public ResponseEntity<?> handleNPE(NullPointerException npe)
@ExceptionHandler(value=ResourceNotFoundException.class) @ResponseBody public ResponseEntity<?> handleNotFound()
@ExceptionHandler(value={java.lang.NoSuchMethodError.class,org.springframework.web.HttpRequestMethodNotSupportedException.class}) @ResponseBody public ResponseEntity<?> handleNoSuchMethod()
@ExceptionHandler(value={org.springframework.http.converter.HttpMessageNotReadableException.class,org.springframework.http.converter.HttpMessageNotWritableException.class}) @ResponseBody public ResponseEntity<ExceptionMessage> handleNotReadable(HttpMessageNotReadableException e)
@ExceptionHandler(value={java.lang.reflect.InvocationTargetException.class,java.lang.IllegalArgumentException.class,java.lang.ClassCastException.class,org.springframework.core.convert.ConversionFailedException.class}) @ResponseBody public ResponseEntity handleMiscFailures(Throwable t)
t - @ExceptionHandler(value=org.springframework.data.rest.core.RepositoryConstraintViolationException.class) @ResponseBody public ResponseEntity handleRepositoryConstraintViolationException(Locale locale, RepositoryConstraintViolationException rcve)
@ExceptionHandler(value={org.springframework.dao.OptimisticLockingFailureException.class,org.springframework.dao.DataIntegrityViolationException.class}) @ResponseBody public ResponseEntity handleConflict(Exception ex)
ex - protected <T> ResponseEntity<T> notFound()
protected <T> ResponseEntity<T> notFound(HttpHeaders headers, T body)
protected <T extends Throwable> ResponseEntity<ExceptionMessage> badRequest(T throwable)
protected <T extends Throwable> ResponseEntity<ExceptionMessage> badRequest(HttpHeaders headers, T throwable)
public <T extends Throwable> ResponseEntity<ExceptionMessage> errorResponse(T throwable, HttpStatus status)
public <T extends Throwable> ResponseEntity<ExceptionMessage> errorResponse(HttpHeaders headers, T throwable, HttpStatus status)
public <T> ResponseEntity<T> response(HttpHeaders headers, T body, HttpStatus status)
protected org.springframework.hateoas.Link resourceLink(org.springframework.data.rest.webmvc.RepositoryRestRequest repoRequest,
org.springframework.hateoas.Resource resource)
protected org.springframework.hateoas.Resources resultToResources(Object result)
protected org.springframework.hateoas.Resources<? extends org.springframework.hateoas.Resource<Object>> entitiesToResources(Page<Object> page, PagedResourcesAssembler<Object> assembler)
Copyright © 2011-2013-2014 Pivotal. All Rights Reserved.