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,I extends BaseInstance<D>>
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(AbstractInstancePersistingDeployer<D,I> deployer,
A resourceAssemblerSupport,
DeploymentUnitType deploymentUnitType) |
Modifier and Type | Method and Description |
---|---|
protected java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
cleanRabbitBus(java.lang.String stream,
java.lang.String adminUri,
java.lang.String user,
java.lang.String pw,
java.lang.String vhost,
java.lang.String busPrefix,
boolean isJob) |
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 org.springframework.hateoas.PagedResources<R> |
listValues(org.springframework.data.domain.Pageable pageable,
org.springframework.data.web.PagedResourcesAssembler<D> assembler)
List module definitions.
|
void |
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(AbstractInstancePersistingDeployer<D,I> deployer, A resourceAssemblerSupport, DeploymentUnitType deploymentUnitType)
@RequestMapping(value="/definitions/{name}", method=DELETE) @ResponseStatus(value=OK) public void delete(@PathVariable(value="name") java.lang.String name) throws java.lang.Exception
name
- the name of an existing definition (required)java.lang.Exception
@RequestMapping(value="/definitions", method=DELETE) @ResponseStatus(value=OK) public void deleteAll() throws java.lang.Exception
java.lang.Exception
@RequestMapping(value="/deployments/{name}", method=DELETE) @ResponseStatus(value=OK) public void undeploy(@PathVariable(value="name") java.lang.String name) throws java.lang.Exception
name
- the name of an existing resource (required)java.lang.Exception
@RequestMapping(value="/deployments", method=DELETE) @ResponseStatus(value=OK) public void undeployAll() throws java.lang.Exception
java.lang.Exception
@RequestMapping(value="/deployments/{name}", method=POST) @ResponseStatus(value=CREATED) public void deploy(@PathVariable(value="name") java.lang.String name, @RequestParam(required=false) java.lang.String properties) throws java.lang.Exception
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 pairsjava.lang.Exception
@RequestMapping(value="/definitions/{name}", method=GET) @ResponseStatus(value=OK) @ResponseBody public org.springframework.hateoas.ResourceSupport display(@PathVariable(value="name") java.lang.String name) throws java.lang.Exception
ResourceSupport
.name
- the name of an existing resource (required)java.lang.Exception
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) public void save(@RequestParam(value="name") java.lang.String name, @RequestParam(value="definition") java.lang.String definition, @RequestParam(value="deploy",defaultValue="true") boolean deploy) throws java.lang.Exception
name
- The name of the entity to create (required)definition
- The entity definition, expressed in the XD DSL (required)java.lang.Exception
protected abstract D createDefinition(java.lang.String name, java.lang.String definition)
protected java.util.Map<java.lang.String,java.util.List<java.lang.String>> cleanRabbitBus(java.lang.String stream, java.lang.String adminUri, java.lang.String user, java.lang.String pw, java.lang.String vhost, java.lang.String busPrefix, boolean isJob)