Interface IStreamController

All Known Implementing Classes:
AbstractStreamController, CsvProcessingController, JsonProcessingController, PmdAnalysisController

public interface IStreamController
Controller interface for stream processing operations.

This interface defines the contract for controllers that manage the complete lifecycle of stream processing operations. Controllers are responsible for:

  • Configuring and creating appropriate command pipelines based on use cases
  • Managing external I/O connections and stream lifecycle
  • Orchestrating StreamConverter execution
  • Handling errors and providing feedback

The Controller layer sits between external systems and the StreamConverter core, implementing the ideal architecture:

 External Systems → Controller → StreamConverter → Commands
 

This separation ensures that:

  • External systems don't need to know about StreamConverter internals
  • Complex command configuration logic is centralized in controllers
  • StreamConverter focuses purely on command orchestration
  • Commands remain focused on stream transformation logic
Since:
1.0
Version:
1.0
Author:
StreamConverter Team
  • Method Details

    • process

      List<CommandResult> process(InputStream inputStream, OutputStream outputStream) throws IOException
      Processes data from the input stream and writes results to the output stream.

      This method represents the main entry point for stream processing. The controller is responsible for:

      • Analyzing the processing requirements
      • Configuring appropriate command pipelines
      • Managing StreamConverter lifecycle
      • Handling any processing errors
      Parameters:
      inputStream - the input stream to read data from
      outputStream - the output stream to write results to
      Returns:
      list of command execution results for monitoring and debugging
      Throws:
      IOException - if an I/O error occurs during processing
      IllegalArgumentException - if input parameters are invalid
      IllegalStateException - if the controller is not properly configured
    • isConfigured

      boolean isConfigured()
      Validates that the controller is properly configured and ready for processing.

      This method should be called before attempting to process streams to ensure all required configuration is in place.

      Returns:
      true if the controller is ready for processing, false otherwise
    • getConfigurationDescription

      Gets a human-readable description of the controller's configuration.

      This method provides information about the controller's current state, configured commands, and processing capabilities. Useful for debugging and monitoring.

      Returns:
      description of the controller configuration
    • getInputDataType

      Gets the expected input data type that this controller can handle.

      This information can be used by external systems to route data to appropriate controllers.

      Returns:
      the expected input data type (e.g., "CSV", "JSON", "XML", "BINARY")
    • getOutputDataType

      Gets the output data type that this controller produces.

      This information helps external systems understand what type of data to expect from the processing.

      Returns:
      the output data type (e.g., "CSV", "JSON", "XML", "BINARY")