Class PipelineBuilder
java.lang.Object
com.tnsai.coordination.groups.pipeline.PipelineBuilder
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 Summary
Modifier and TypeMethodDescriptionAdds a stage to the pipeline.autoStart(boolean autoStart) Sets whether to auto-start after build.build()Builds the PipelineOrganization.description(String description) Sets the pipeline description.Sets the pipeline ID.Sets the pipeline name.policy(com.tnsai.agents.groups.GroupPolicy policy) Sets the group policy.
-
Method Details
-
id
Sets the pipeline ID.- Parameters:
id- pipeline ID- Returns:
- this builder
-
name
Sets the pipeline name.- Parameters:
name- pipeline name- Returns:
- this builder
-
description
Sets the pipeline description.- Parameters:
description- pipeline description- Returns:
- this builder
-
policy
Sets the group policy.- Parameters:
policy- policy- Returns:
- this builder
-
addStage
Adds a stage to the pipeline.- Parameters:
stageName- stage nameagent- agent for this stage- Returns:
- this builder
-
autoStart
Sets whether to auto-start after build.- Parameters:
autoStart- auto-start flag- Returns:
- this builder
-
build
Builds the PipelineOrganization.- Returns:
- new PipelineOrganization instance
- Throws:
IllegalStateException- if no stages are defined
-