org.springframework.data.rest.webmvc.RepositoryLinksResource Java Examples

The following examples show how to use org.springframework.data.rest.webmvc.RepositoryLinksResource. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SkipperLinksResourceProcessor.java    From spring-cloud-skipper with Apache License 2.0 5 votes vote down vote up
@Override
public RepositoryLinksResource process(RepositoryLinksResource resource) {
	resource.add(WebMvcLinkBuilder.linkTo(methodOn(AboutController.class).getAboutResource()).withRel("about"));
	resource.add(WebMvcLinkBuilder.linkTo(ReleaseController.class).withRel("release"));
	resource.add(WebMvcLinkBuilder.linkTo(PackageController.class).withRel("package"));
	return resource;
}
 
Example #2
Source File: EngineController.java    From micro-ecommerce with Apache License 2.0 5 votes vote down vote up
/**
 * Exposes the {@link EngineController} to the root resource exposed by
 * Spring Data REST.
 * 
 * @see org.springframework.hateoas.ResourceProcessor#process(org.springframework.hateoas.ResourceSupport)
 */
@Override
public RepositoryLinksResource process(RepositoryLinksResource resource) {

	resource.add(linkTo(methodOn(EngineController.class).showOrdersInProgress()).withRel(ENGINE_REL));

	return resource;
}
 
Example #3
Source File: InventoryResourceProcessor.java    From sos with Apache License 2.0 3 votes vote down vote up
@Override
public RepositoryLinksResource process(RepositoryLinksResource resource) {

	resource.add(linkTo(methodOn(InventoryController.class).shipment()).withRel("shipment"));

	return resource;
}
 
Example #4
Source File: ProductLinkProcessor.java    From sos with Apache License 2.0 3 votes vote down vote up
@Override
public RepositoryLinksResource process(RepositoryLinksResource resource) {

	Link products = entityLinks.linkToCollectionResource(Product.class);

	UriTemplate template = new UriTemplate(products.getHref().concat("/{id}"));

	resource.add(new Link(template, relProvider.getItemResourceRelFor(Product.class)));

	return resource;
}
 
Example #5
Source File: OrdersResourceProcessor.java    From sos with Apache License 2.0 3 votes vote down vote up
@Override
public RepositoryLinksResource process(RepositoryLinksResource resource) {

	resource.add(linkTo(methodOn(OrderController.class).createOrder()).withRel("create"));

	return resource;
}
 
Example #6
Source File: EventsResourceProcessor.java    From sos with Apache License 2.0 3 votes vote down vote up
@Override
public RepositoryLinksResource process(RepositoryLinksResource resource) {

	resource.add(linkTo(methodOn(EventController.class).events(null, null, null, null)).withRel("events"));

	return resource;
}