Here are the examples of the java api org.springframework.hateoas.ResourceSupport taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
3 Examples
17
Source : DataFlowTemplate.java
with Apache License 2.0
from spring-cloud
with Apache License 2.0
from spring-cloud
public Link getLink(ResourceSupport resourceSupport, String rel) {
Link link = resourceSupport.getLink(rel);
if (link == null) {
throw new DataFlowServerException("Server did not return a link for '" + rel + "', links: '" + resourceSupport + "'");
}
return link;
}
17
Source : IndexController.java
with MIT License
from ePages-de
with MIT License
from ePages-de
@RequestMapping(method = RequestMethod.GET)
public ResourceSupport index() {
ResourceSupport index = new ResourceSupport();
index.add(linkTo(NotesController.clreplaced).withRel("notes"));
index.add(linkTo(TagsController.clreplaced).withRel("tags"));
return index;
}
13
Source : RootController.java
with Apache License 2.0
from spring-cloud
with Apache License 2.0
from spring-cloud
/**
* Return a {@link ResourceSupport} object containing the resources
* served by the Data Flow server.
*
* @return {@code ResourceSupport} object containing the Data Flow server's resources
*/
@RequestMapping("/")
public ResourceSupport info() {
ResourceSupport resourceSupport = new ResourceSupport();
resourceSupport.add(new Link(dashboard(""), "dashboard"));
resourceSupport.add(enreplacedyLinks.linkToCollectionResource(AppRegistrationResource.clreplaced).withRel("apps"));
resourceSupport.add(enreplacedyLinks.linkToCollectionResource(AppStatusResource.clreplaced).withRel("runtime/apps"));
resourceSupport.add(unescapeTemplateVariables(enreplacedyLinks.linkForSingleResource(AppStatusResource.clreplaced, "{appId}").withRel("runtime/apps/app")));
resourceSupport.add(unescapeTemplateVariables(enreplacedyLinks.linkFor(AppInstanceStatusResource.clreplaced, UriComponents.UriTemplateVariables.SKIP_VALUE).withRel("runtime/apps/instances")));
resourceSupport.add(enreplacedyLinks.linkToCollectionResource(ApplicationDefinitionResource.clreplaced).withRel("applications/definitions"));
resourceSupport.add(unescapeTemplateVariables(enreplacedyLinks.linkToSingleResource(ApplicationDefinitionResource.clreplaced, "{name}").withRel("applications/definitions/definition")));
resourceSupport.add(enreplacedyLinks.linkToCollectionResource(ApplicationDeploymentResource.clreplaced).withRel("applications/deployments"));
resourceSupport.add(unescapeTemplateVariables(enreplacedyLinks.linkToSingleResource(ApplicationDeploymentResource.clreplaced, "{name}").withRel("applications/deployments/deployment")));
String completionStreamTemplated = enreplacedyLinks.linkFor(CompletionProposalsResource.clreplaced).withSelfRel().getHref() + ("/stream{?start,detailLevel}");
resourceSupport.add(new Link(completionStreamTemplated).withRel("completions/stream"));
String completionTaskTemplated = enreplacedyLinks.linkFor(CompletionProposalsResource.clreplaced).withSelfRel().getHref() + ("/task{?start,detailLevel}");
resourceSupport.add(new Link(completionTaskTemplated).withRel("completions/task"));
return resourceSupport;
}