org.springframework.cloud.dataflow.server.service

## Interface StreamService

- All Known Implementing Classes:
    DefaultStreamService

      public interface StreamService

  Provide deploy, undeploy, info and state operations on the stream. Uses the support for operations provided by Skipper.
  Author:
    Mark Pollack, Ilayaperumal Gopinathan, Christian Tzolov

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `StreamDefinition` | `createStream(String streamName, String dsl, String description, boolean deploy)` Create a new stream.
    `void` | `deleteAll()` Delete all streams, including undeploying.
    `void` | `deleteStream(String name)` Delete the stream, including undeloying.
    `void` | `deployStream(String name, Map<String,String> deploymentProperties)` Deploys the stream with the user provided deployment properties.
    `org.springframework.data.domain.Page<StreamDefinition>` | `findDefinitionByNameContains(org.springframework.data.domain.Pageable pageable, String search)` Find stream definitions where the findByTaskNameContains parameter
    `StreamDefinition` | `findOne(String streamDefinitionName)` Find a stream definition by name.
    `List<StreamDefinition>` | `findRelatedStreams(String name, boolean nested)` Find streams related to the given stream name.
    `Collection<org.springframework.cloud.skipper.domain.Release>` | `history(String releaseName)` Get stream's deployment history
    `StreamDeployment` | `info(String streamName)` Get stream information including the deployment properties etc.
    `String` | `manifest(String releaseName, int releaseVersion)` Return a manifest info of a release version.
    `Collection<org.springframework.cloud.skipper.domain.Deployer>` | `platformList()`
    `void` | `rollbackStream(String streamName, int releaseVersion)` Rollback the stream to the previous or a specific version of the stream.
    `void` | `scaleApplicationInstances(String streamName, String appName, int count, Map<String,String> properties)` Scale application instances in a deployed stream.
    `Map<StreamDefinition,org.springframework.cloud.deployer.spi.app.DeploymentState>` | `state(List<StreamDefinition> streamDefinitions)` Retrieve the deployment state for list of stream definitions.
    `void` | `undeployStream(String name)` Un-deploys the stream identified by the given stream name.
    `void` | `updateStream(String streamName, UpdateStreamRequest updateStreamRequest)` Update the stream using the UpdateStreamRequest.
    `ValidationStatus` | `validateStream(String name)` Verifies that all apps in the stream are valid.

- - ### Method Detail

    - #### scaleApplicationInstances

          void scaleApplicationInstances(String streamName,
                                         String appName,
                                         int count,
                                         Map<String,String> properties)

      Scale application instances in a deployed stream.
      Parameters:
        `streamName` - the name of an existing stream definition (required)
        `appName` - in stream application name to scale (required)
        `count` - number of instances for the selected stream application (required)
        `properties` - scale deployment specific properties (optional)

    - #### updateStream

          void updateStream(String streamName,
                            UpdateStreamRequest updateStreamRequest)

      Update the stream using the UpdateStreamRequest.
      Parameters:
        `streamName` - the name of the stream to update
        `updateStreamRequest` - the UpdateStreamRequest to use during the update

    - #### rollbackStream

          void rollbackStream(String streamName,
                              int releaseVersion)

      Rollback the stream to the previous or a specific version of the stream.
      Parameters:
        `streamName` - the name of the stream to rollback
        `releaseVersion` - the version to rollback to (if not specified, rollback to the previous deleted/deployed release version of the stream.

    - #### manifest

          String manifest(String releaseName,
                          int releaseVersion)

      Return a manifest info of a release version. For packages with dependencies, the manifest includes the contents of those dependencies.
      Parameters:
        `releaseName` - the release name
        `releaseVersion` - the release version
      Returns:
        the manifest info of a release

    - #### history

          Collection<org.springframework.cloud.skipper.domain.Release> history(String releaseName)

      Get stream's deployment history
      Parameters:
        `releaseName` - Stream release name
      Returns:
        List or Releases for this release name

    - #### platformList

          Collection<org.springframework.cloud.skipper.domain.Deployer> platformList()

      Returns:
        list of supported deployment platforms

    - #### createStream

          StreamDefinition createStream(String streamName,
                                        String dsl,
                                        String description,
                                        boolean deploy)

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

    - #### deployStream

          void deployStream(String name,
                            Map<String,String> deploymentProperties)

      Deploys the stream with the user provided deployment properties. Implementations are responsible for expanding deployment wildcard expressions.
      Parameters:
        `name` - the name of the stream
        `deploymentProperties` - deployment properties to use as passed in from the client.

    - #### undeployStream

          void undeployStream(String name)

      Un-deploys the stream identified by the given stream name.
      Parameters:
        `name` - the name of the stream to un-deploy

    - #### deleteStream

          void deleteStream(String name)

      Delete the stream, including undeloying.
      Parameters:
        `name` - the name of the stream to delete

    - #### deleteAll

          void deleteAll()

      Delete all streams, including undeploying.

    - #### state

          Map<StreamDefinition,org.springframework.cloud.deployer.spi.app.DeploymentState> state(List<StreamDefinition> streamDefinitions)

      Retrieve the deployment state for list of stream definitions.
      Parameters:
        `streamDefinitions` - the list of Stream definitions to calculate the deployment states.
      Returns:
        the map containing the stream definitions and their deployment states.

    - #### info

          StreamDeployment info(String streamName)

      Get stream information including the deployment properties etc.
      Parameters:
        `streamName` - the name of the stream
      Returns:
        the stream deployment information

    - #### findRelatedStreams

          List<StreamDefinition> findRelatedStreams(String name,
                                                    boolean nested)

      Find streams related to the given stream name.
      Parameters:
        `name` - name of the stream
        `nested` - if should recursively findByTaskNameContains for related stream definitions
      Returns:
        a list of related stream definitions

    - #### findDefinitionByNameContains

          org.springframework.data.domain.Page<StreamDefinition> findDefinitionByNameContains(org.springframework.data.domain.Pageable pageable,
                                                                                              String search)

      Find stream definitions where the findByTaskNameContains parameter
      Parameters:
        `pageable` - Pagination information
        `search` - the findByTaskNameContains parameter to use
      Returns:
        Page of stream definitions

    - #### findOne

          StreamDefinition findOne(String streamDefinitionName)

      Find a stream definition by name.
      Parameters:
        `streamDefinitionName` - the name of the stream definition
      Returns:
        the stream definition
      Throws:
        `NoSuchStreamDefinitionException` - if the definition can not be found.

    - #### validateStream

          ValidationStatus validateStream(String name)

      Verifies that all apps in the stream are valid.
      Parameters:
        `name` - the name of the definition
      Returns:
        `ValidationStatus` for a stream.

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