java.lang.Object
org.springframework.cloud.dataflow.rest.client.dsl.Stream
All Implemented Interfaces:
AutoCloseable

public class Stream extends Object implements AutoCloseable
Represents a Stream deployed on DataFlow server. Instances of this class are created using a fluent style builder pattern. For for instance:
     
     Stream stream = Stream.builder(dataflowOperations).definition("time | log").create().deploy();
     
 
A fluent style that separates source, processor and sink parts can also be used via
     
     Stream stream = Stream.builder(dataflowOperations).source("time").sink("log").create().deploy();
     
 
Author:
Vinicius Carvalho, Christian Tzolov
  • Method Details

    • getName

      public String getName()
      Returns:
      Stream name
    • getDescription

      public String getDescription()
    • builder

      public static StreamBuilder builder(DataFlowOperations client)
      Fluent API method to create a StreamBuilder.
      Parameters:
      client - DataFlowOperations client instance
      Returns:
      A fluent style builder to create streams
    • update

      public void update(String properties)
      Unforced Stream Update with properties string definition
      Parameters:
      properties - application properties to update.
    • scaleApplicationInstances

      public void scaleApplicationInstances(StreamApplication application, int count, Map<String,String> properties)
      Scale up or down the number of application instances.
      Parameters:
      application - App in the stream to scale.
      count - Number of instance to scale to.
      properties - optional scale properties.
    • update

      public void update(Map<String,String> propertiesToUse)
      Unforced Stream Update with properties map
      Parameters:
      propertiesToUse - application properties to update.
    • rollback

      public void rollback(int streamVersion)
      Rollback the stream to the previous or a specific release version.
      Parameters:
      streamVersion - the version to rollback to. If the version is 0, then rollback to the previous release. The version can not be less than zero.
    • undeploy

      public void undeploy()
      Undeploy the current Stream. This method invokes the remote server
    • destroy

      public void destroy()
      Destroy the stream from the server. This method invokes the remote server
    • history

      public Map<Integer,String> history()
      Returns:
      list of stream versions and their statuses.
    • manifest

      public String manifest(int streamVersion)
      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.
      Parameters:
      streamVersion - the version of the release
      Returns:
      the manifest for the given stream and version
    • getStatus

      public String getStatus()
      Returns:
      Status of the deployed stream
    • logs

      public String logs()
      Gets all the applications' logs for this stream
      Returns:
      the log for said stream
    • logs

      public String logs(StreamApplication app)
      Get the logs of a specific application from the stream
      Parameters:
      app - specific application within stream
      Returns:
      the log for said application within said stream
    • runtimeApps

      public Map<StreamApplication,Map<String,String>> runtimeApps()
      Returns:
      Returns a map of the stream applications, associating every application with its applications instances and their current runtime states: (App -> (AppInstanceId -> AppInstanceState)).
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable