Class PipelineBuilder

java.lang.Object
com.tnsai.coordination.groups.pipeline.PipelineBuilder

public final class PipelineBuilder extends Object
Builder for creating PipelineOrganization instances.

Usage Example


 PipelineOrganization pipeline = PipelineOrganization.builder()
     .name("ETL Pipeline")
     .addStage("extract", extractorAgent)
     .addStage("transform", transformerAgent)
     .addStage("load", loaderAgent)
     .build();
 
  • Method Details

    • id

      public PipelineBuilder id(String id)
      Sets the pipeline ID.
      Parameters:
      id - pipeline ID
      Returns:
      this builder
    • name

      public PipelineBuilder name(String name)
      Sets the pipeline name.
      Parameters:
      name - pipeline name
      Returns:
      this builder
    • description

      public PipelineBuilder description(String description)
      Sets the pipeline description.
      Parameters:
      description - pipeline description
      Returns:
      this builder
    • policy

      public PipelineBuilder policy(com.tnsai.agents.groups.GroupPolicy policy)
      Sets the group policy.
      Parameters:
      policy - policy
      Returns:
      this builder
    • addStage

      public PipelineBuilder addStage(String stageName, com.tnsai.agents.Agent agent)
      Adds a stage to the pipeline.
      Parameters:
      stageName - stage name
      agent - agent for this stage
      Returns:
      this builder
    • autoStart

      public PipelineBuilder autoStart(boolean autoStart)
      Sets whether to auto-start after build.
      Parameters:
      autoStart - auto-start flag
      Returns:
      this builder
    • build

      public PipelineOrganization build()
      Builds the PipelineOrganization.
      Returns:
      new PipelineOrganization instance
      Throws:
      IllegalStateException - if no stages are defined