Class StreamTemplate

java.lang.Object
org.springframework.cloud.dataflow.rest.client.StreamTemplate
All Implemented Interfaces:
StreamOperations

public class StreamTemplate extends Object implements StreamOperations
Implementation for StreamOperations.
Author:
Ilayaperumal Gopinathan, Mark Fisher, Eric Bottard
  • Field Details

  • Method Details

    • list

      Specified by:
      list in interface StreamOperations
      Returns:
      the list streams known to the system.
    • info

      public StreamDeploymentResource info(String name)
      Specified by:
      info in interface StreamOperations
      Parameters:
      name - the name of the stream
      Returns:
      retrieve the stream info.
    • createStream

      public StreamDefinitionResource createStream(String name, String definition, String description, boolean deploy)
      Description copied from interface: StreamOperations
      Create a new stream, optionally deploying it.
      Specified by:
      createStream in interface StreamOperations
      Parameters:
      name - the name of the stream
      definition - the stream definition DSL
      description - the description of the stream
      deploy - whether to deploy the stream after creating its definition
      Returns:
      the new stream definition
    • deploy

      public void deploy(String name, Map<String,String> properties)
      Description copied from interface: StreamOperations
      Deploy an already created stream.
      Specified by:
      deploy in interface StreamOperations
      Parameters:
      name - the name of the stream
      properties - the deployment properties
    • undeploy

      public void undeploy(String name)
      Description copied from interface: StreamOperations
      Undeploy a deployed stream, retaining its definition.
      Specified by:
      undeploy in interface StreamOperations
      Parameters:
      name - the name of the stream
    • undeployAll

      public void undeployAll()
      Description copied from interface: StreamOperations
      Undeploy all currently deployed streams.
      Specified by:
      undeployAll in interface StreamOperations
    • destroy

      public void destroy(String name)
      Description copied from interface: StreamOperations
      Destroy an existing stream.
      Specified by:
      destroy in interface StreamOperations
      Parameters:
      name - the name of the stream
    • destroyAll

      public void destroyAll()
      Description copied from interface: StreamOperations
      Destroy all streams known to the system.
      Specified by:
      destroyAll in interface StreamOperations
    • scaleApplicationInstances

      public void scaleApplicationInstances(String streamName, String appName, Integer count, Map<String,String> properties)
      Description copied from interface: StreamOperations
      Scales number of application instances in a stream.
      Specified by:
      scaleApplicationInstances in interface StreamOperations
      Parameters:
      streamName - the stream(release) name.
      appName - name of application in the stream to scale.
      count - number of instances to scale to.
      properties - scale deployment properties.
    • streamExecutionLog

      public String streamExecutionLog(String streamName)
      Description copied from interface: StreamOperations
      Retrieves all the applications' logs for the given stream name
      Specified by:
      streamExecutionLog in interface StreamOperations
      Parameters:
      streamName - name of stream for which to get logs
      Returns:
      logs of said stream
    • streamExecutionLog

      public String streamExecutionLog(String streamName, String appName)
      Description copied from interface: StreamOperations
      Retrieve the logs of a specific application from the stream
      Specified by:
      streamExecutionLog in interface StreamOperations
      Parameters:
      streamName - name of stream for which to get logs
      appName - app name for which to get logs
      Returns:
      logs for said application within said stream
    • updateStream

      public void updateStream(String streamName, String releaseName, org.springframework.cloud.skipper.domain.PackageIdentifier packageIdentifier, Map<String,String> updateProperties, boolean force, List<String> appNames)
      Description copied from interface: StreamOperations
      Update the stream given its corresponding releaseName in Skipper using the specified package and updated yaml config.
      Specified by:
      updateStream in interface StreamOperations
      Parameters:
      streamName - the name of the stream to update
      releaseName - the corresponding release name of the stream in skipper
      packageIdentifier - the package that corresponds to this stream
      updateProperties - a map of properties to use for updating the stream
      force - boolean flag to indicate if the stream update is enforced irrespective of differences from the existing stream
      appNames - app names to use for the stream update when update is enforced
    • rollbackStream

      public void rollbackStream(String streamName, int version)
      Description copied from interface: StreamOperations
      Rollback the stream to the previous or a specific release version.
      Specified by:
      rollbackStream in interface StreamOperations
      Parameters:
      streamName - the name of the stream to rollback
      version - the version to rollback to. If the version is 0, then rollback to the previous release. The version can not be less than zero.
    • getManifest

      public String getManifest(String streamName, int version)
      Description copied from interface: StreamOperations
      Get manifest for the given stream deployed via Skipper. Optionally, the version can be used to retrieve the version for a specific version of the stream.
      Specified by:
      getManifest in interface StreamOperations
      Parameters:
      streamName - the stream(release) name
      version - the version of the release
      Returns:
      the manifest for the given stream and version
    • history

      public Collection<org.springframework.cloud.skipper.domain.Release> history(String streamName)
      Description copied from interface: StreamOperations
      Get the history of releases for the given stream deployed via Skipper.
      Specified by:
      history in interface StreamOperations
      Parameters:
      streamName - the stream(release) name
      Returns:
      the history of releases for the stream
    • listPlatforms

      public Collection<org.springframework.cloud.skipper.domain.Deployer> listPlatforms()
      Specified by:
      listPlatforms in interface StreamOperations
      Returns:
      the list of all Skipper platforms
    • getStreamDefinition

      public StreamDefinitionResource getStreamDefinition(String streamName)
      Description copied from interface: StreamOperations
      Queries the server for the stream definition.
      Specified by:
      getStreamDefinition in interface StreamOperations
      Parameters:
      streamName - the name of the stream to get status
      Returns:
      The current stream definition with updated status
    • validateStreamDefinition

      public StreamAppStatusResource validateStreamDefinition(String streamDefinitionName) throws OperationNotSupportedException
      Description copied from interface: StreamOperations
      Return the validation status for the apps in an stream.
      Specified by:
      validateStreamDefinition in interface StreamOperations
      Parameters:
      streamDefinitionName - The name of the stream definition to be validated.
      Returns:
      StreamAppStatusResource containing the stream app statuses.
      Throws:
      OperationNotSupportedException - if the server does not support stream validation