org.apache.commons.pipeline.validation
Class SimplePipelineValidator

java.lang.Object
  extended by org.apache.commons.pipeline.validation.SimplePipelineValidator
All Implemented Interfaces:
PipelineValidator

public class SimplePipelineValidator
extends Object
implements PipelineValidator

This is a simple default implementation of the PipelineValidator interface that checks stage and branch connectivity. It assumes that any un-annotated stage simply passes data through and can accept any type of object (as though it were annotated with @ConsumedTypes({Object.class}) and @ProducesConsumed.


Constructor Summary
SimplePipelineValidator()
          Creates a new instance of PipelineValidator
 
Method Summary
 List<ValidationFailure> validate(Pipeline pipeline)
          This method validates the entire structure of the pipeline, ensuring that the data produced by each stage can be consumed by the subsequent stage and/or relevant branch pipelines.
 List<ValidationFailure> validateAddBranch(Pipeline pipeline, String branchKey, Pipeline branch)
          Validate whether or not the specified branch pipeline can be added with the specified key.
 List<ValidationFailure> validateAddStage(Pipeline pipeline, Stage stage, StageDriverFactory driverFactory)
          Validate whether or not a stage can be added to the pipeline.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimplePipelineValidator

public SimplePipelineValidator()
Creates a new instance of PipelineValidator

Method Detail

validate

public List<ValidationFailure> validate(Pipeline pipeline)
This method validates the entire structure of the pipeline, ensuring that the data produced by each stage can be consumed by the subsequent stage and/or relevant branch pipelines.

Specified by:
validate in interface PipelineValidator
Parameters:
pipeline - The pipeline to be validated
Returns:
The list of validation errors encountered.

validateAddStage

public List<ValidationFailure> validateAddStage(Pipeline pipeline,
                                                Stage stage,
                                                StageDriverFactory driverFactory)
Validate whether or not a stage can be added to the pipeline.

Specified by:
validateAddStage in interface PipelineValidator
Parameters:
pipeline - The pipeline to which the stage is being added
stage - The stage to be added
driverFactory - the StageDriverFactory used to create a driver for the stage
Returns:
The list of validation errors encountered, or an empty list if the add passed validation.

validateAddBranch

public List<ValidationFailure> validateAddBranch(Pipeline pipeline,
                                                 String branchKey,
                                                 Pipeline branch)
Validate whether or not the specified branch pipeline can be added with the specified key.

Specified by:
validateAddBranch in interface PipelineValidator
Parameters:
pipeline - The pipeline to which the branch is being added
branchKey - The identifier for the newly added branch
branch - The branch pipeline being added
Returns:
The list of validation errors, or an empty list if no errors were found.


Copyright © 2004-2009 The Apache Software Foundation. All Rights Reserved.