D
- the kind of definition entity this controller deals withA
- a resource assembler that knows how to build Ts out of DsR
- the resource class for Dpublic abstract class XDController<D extends BaseDefinition,A extends org.springframework.hateoas.mvc.ResourceAssemblerSupport<D,R>,R extends NamedResource>
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
XDController.QueryOptions
Data holder class for controlling how the list methods should behave.
|
Modifier | Constructor and Description |
---|---|
protected |
XDController(AbstractDeployer<D> deployer,
A resourceAssemblerSupport) |
Modifier and Type | Method and Description |
---|---|
protected abstract D |
createDefinition(java.lang.String name,
java.lang.String definition) |
void |
delete(java.lang.String name)
Request removal of an existing resource definition (stream or job).
|
void |
deleteAll()
Request removal of all definitions.
|
void |
deploy(java.lang.String name,
java.lang.String properties)
Request deployment of an existing definition resource.
|
org.springframework.hateoas.ResourceSupport |
display(java.lang.String name)
Retrieve information about a single
ResourceSupport . |
protected ResourceDeployer<D> |
getDeployer() |
protected org.springframework.hateoas.PagedResources<R> |
listValues(org.springframework.data.domain.Pageable pageable,
org.springframework.data.web.PagedResourcesAssembler<D> assembler)
List module definitions.
|
R |
save(java.lang.String name,
java.lang.String definition,
boolean deploy)
Create a new resource definition.
|
void |
undeploy(java.lang.String name)
Request un-deployment of an existing resource.
|
void |
undeployAll()
Request un-deployment of all resources.
|
protected XDController(AbstractDeployer<D> deployer, A resourceAssemblerSupport)
protected ResourceDeployer<D> getDeployer()
@RequestMapping(value="/definitions/{name}", method=DELETE) @ResponseStatus(value=OK) public void delete(@PathVariable(value="name") java.lang.String name)
name
- the name of an existing definition (required)@RequestMapping(value="/definitions", method=DELETE) @ResponseStatus(value=OK) public void deleteAll()
@RequestMapping(value="/deployments/{name}", method=DELETE) @ResponseStatus(value=OK) public void undeploy(@PathVariable(value="name") java.lang.String name)
name
- the name of an existing resource (required)@RequestMapping(value="/deployments", method=DELETE) @ResponseStatus(value=OK) public void undeployAll()
@RequestMapping(value="/deployments/{name}", method=POST) @ResponseStatus(value=CREATED) @ResponseBody public void deploy(@PathVariable(value="name") java.lang.String name, @RequestParam(required=false) java.lang.String properties)
name
- the name of an existing definition resource (job or stream) (required)properties
- the deployment properties for the resource as a comma-delimited list of key=value pairs@RequestMapping(value="/definitions/{name}", method=GET) @ResponseStatus(value=OK) @ResponseBody public org.springframework.hateoas.ResourceSupport display(@PathVariable(value="name") java.lang.String name)
ResourceSupport
.name
- the name of an existing resource (required)protected org.springframework.hateoas.PagedResources<R> listValues(org.springframework.data.domain.Pageable pageable, org.springframework.data.web.PagedResourcesAssembler<D> assembler)
@RequestMapping(value="/definitions", method=POST) @ResponseStatus(value=CREATED) @ResponseBody public R save(@RequestParam(value="name") java.lang.String name, @RequestParam(value="definition") java.lang.String definition, @RequestParam(value="deploy",defaultValue="true") boolean deploy)
name
- The name of the entity to create (required)definition
- The entity definition, expressed in the XD DSL (required)protected abstract D createDefinition(java.lang.String name, java.lang.String definition)