org.springframework.cloud.dataflow.server.controller

## Class StreamDefinitionController

- java.lang.Object
- - org.springframework.cloud.dataflow.server.controller.StreamDefinitionController

-     @RestController
       @RequestMapping(value="/streams/definitions")
       @ExposesResourceFor(value=StreamDefinitionResource.class)
      public class StreamDefinitionController
      extends Object

  Controller for operations on `StreamDefinition`. This includes CRUD and optional deployment operations.
  Author:
    Eric Bottard, Mark Fisher, Patrick Peralta, Ilayaperumal Gopinathan, Gunnar Hillert, Oleg Zhurakousky, Glenn Renfro, Christian Tzolov, Andy Clement

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `StreamDefinitionController(StreamService streamService, StreamDefinitionService streamDefinitionService, AppRegistryService appRegistryService, StreamDefinitionAssemblerProvider<? extends StreamDefinitionResource> streamDefinitionAssemblerProvider, AppRegistrationAssemblerProvider<? extends AppRegistrationResource> appRegistrationAssemblerProvider)` Create a `StreamDefinitionController` that delegates to `StreamService`.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `delete(String name)` Request removal of an existing stream definition.
    `void` | `deleteAll()` Request removal of all stream definitions.
    `StreamDefinitionResource` | `display(String name)` Return a given stream definition resource.
    `org.springframework.hateoas.PagedModel<? extends StreamDefinitionResource>` | `list(org.springframework.data.domain.Pageable pageable, String search, org.springframework.data.web.PagedResourcesAssembler<StreamDefinition> assembler)` Return a page-able list of `StreamDefinitionResource` defined streams.
    `List<? extends AppRegistrationResource>` | `listApplications(String name)`
    `org.springframework.hateoas.PagedModel<? extends StreamDefinitionResource>` | `listRelated(org.springframework.data.domain.Pageable pageable, String name, boolean nested, org.springframework.data.web.PagedResourcesAssembler<StreamDefinition> assembler)` Return a list of related stream definition resources based on the given stream name.
    `StreamDefinitionResource` | `save(String name, String dsl, String description, boolean deploy)` Create a new stream.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### StreamDefinitionController

          public StreamDefinitionController(StreamService streamService,
                                            StreamDefinitionService streamDefinitionService,
                                            AppRegistryService appRegistryService,
                                            StreamDefinitionAssemblerProvider<? extends StreamDefinitionResource> streamDefinitionAssemblerProvider,
                                            AppRegistrationAssemblerProvider<? extends AppRegistrationResource> appRegistrationAssemblerProvider)

      Create a `StreamDefinitionController` that delegates to `StreamService`.
      Parameters:
        `streamService` - the stream service to use
        `streamDefinitionService` - the stream definition service to use
        `appRegistryService` - the app registry service to use
        `streamDefinitionAssemblerProvider` - the stream definition assembler provider to use
        `appRegistrationAssemblerProvider` - the app registry assembler provider to use

  - ### Method Detail

    - #### list

          @RequestMapping(value="",
                          method=GET)
           @ResponseStatus(value=OK)
          public org.springframework.hateoas.PagedModel<? extends StreamDefinitionResource> list(org.springframework.data.domain.Pageable pageable,
                                                                                                                                                                                  @RequestParam(required=false)
                                                                                                                                                                                  String search,
                                                                                                                                                                                  org.springframework.data.web.PagedResourcesAssembler<StreamDefinition> assembler)

      Return a page-able list of `StreamDefinitionResource` defined streams.
      Parameters:
        `pageable` - Pagination information
        `assembler` - assembler for `StreamDefinition`
        `search` - optional findByTaskNameContains parameter
      Returns:
        list of stream definitions

    - #### save

          @RequestMapping(value="",
                          method=POST)
           @ResponseStatus(value=CREATED)
          public StreamDefinitionResource save(@RequestParam(value="name")
                                                                                                                                      String name,
                                                                                                                                      @RequestParam(value="definition")
                                                                                                                                      String dsl,
                                                                                                                                      @RequestParam(value="description",defaultValue="")
                                                                                                                                      String description,
                                                                                                                                      @RequestParam(value="deploy",defaultValue="false")
                                                                                                                                      boolean deploy)

      Create a new stream.
      Parameters:
        `name` - stream name
        `dsl` - DSL definition for stream
        `deploy` - if `true`, the stream is deployed upon creation (default is `false`)
        `description` - description of the stream definition
      Returns:
        the created stream definition
      Throws:
        `DuplicateStreamDefinitionException` - if a stream definition with the same name already exists
        `InvalidStreamDefinitionException` - if there errors in parsing the stream DSL, resolving the name, or type of applications in the stream

    - #### delete

          @RequestMapping(value="/{name}",
                          method=DELETE)
           @ResponseStatus(value=OK)
          public void delete(@PathVariable(value="name")
                                                                                                                        String name)

      Request removal of an existing stream definition.
      Parameters:
        `name` - the name of an existing stream definition (required)

    - #### listRelated

          @RequestMapping(value="/{name}/related",
                          method=GET)
           @ResponseStatus(value=OK)
          public org.springframework.hateoas.PagedModel<? extends StreamDefinitionResource> listRelated(org.springframework.data.domain.Pageable pageable,
                                                                                                                                                                                                        @PathVariable(value="name")
                                                                                                                                                                                                        String name,
                                                                                                                                                                                                        @RequestParam(value="nested",required=false,defaultValue="false")
                                                                                                                                                                                                        boolean nested,
                                                                                                                                                                                                        org.springframework.data.web.PagedResourcesAssembler<StreamDefinition> assembler)

      Return a list of related stream definition resources based on the given stream name. Related streams include the main stream and the tap stream(s) on the main stream.
      Parameters:
        `pageable` - Pagination information
        `name` - the name of an existing stream definition (required)
        `nested` - if should recursively findByTaskNameContains for related stream definitions
        `assembler` - resource assembler for stream definition
      Returns:
        a list of related stream definitions

    - #### display

          @RequestMapping(value="/{name}",
                          method=GET)
           @ResponseStatus(value=OK)
          public StreamDefinitionResource display(@PathVariable(value="name")
                                                                                                                                          String name)

      Return a given stream definition resource.
      Parameters:
        `name` - the name of an existing stream definition (required)
      Returns:
        the stream definition

    - #### listApplications

          @RequestMapping(value="/{name}/applications",
                          method=GET)
           @ResponseStatus(value=OK)
          public List<? extends AppRegistrationResource> listApplications(@PathVariable(value="name")
                                                                                                                                                                               String name)

    - #### deleteAll

          @RequestMapping(value="",
                          method=DELETE)
           @ResponseStatus(value=OK)
          public void deleteAll()

      Request removal of all stream definitions.

Copyright © 2021 Pivotal Software, Inc.. All rights reserved.