Parameter Handling

The ZeroEcho processing framework is based on a modular, composable stream-processing model that extends the classic pipeline architecture. Each chunk in the DataContent chain processes data while optionally exchanging metadata (parameters) with neighboring chunks in a controlled and directional manner.

Overview

Each DataContent chunk may optionally support parameter exchange through the following methods:

void collectParameters(Map<String, Object> collector);
void applyParameters(Map<String, Object> params);

These allow a chunk to provide its own configuration and derived parameters to a successor chunk (collectParameters), or to receive external configuration from a successor (applyParameters).

This mechanism supports cases such as key derivation, encoding configuration, or header transmission across chunk boundaries.

Direction of Communication

The framework introduces a minimal but expressive parameter exchange pattern between adjacent chunks:

  • collectParameters() – allows a chunk to expose its own parameters for collection by its direct successor
  • applyParameters() – allows a chunk to receive parameters provided by its direct successor

This results in a *one-step backward flow of configuration*, enabling a successor chunk to influence its predecessor based on derived data or stream headers.

This differs from typical forward-only streaming, and enables real-time negotiation of encryption, encoding, or processing options.

Chunk Relationship and Stream Ownership

During execution, each chunk:

  • Receives a reference to its direct predecessor via setInput(DataContent)
  • Can read from the predecessor's stream
  • Can collect and pass parameters backward

However, it cannot traverse forward in the chain — only the next chunk can query its parameters.

This supports both:

  • Active sending of parameters upstream (using applyParameters() on the predecessor)
  • Passive responding to requests from downstream (using collectParameters() on itself)

Example: AES Encryption and Decryption Flow

A test case demonstrates a full processing roundtrip:

DataContent output = DataContentChainBuilder.builder()
    .add(PlainStringBuilder.builder().value(originalText))
    .add(AesBuilder.builder().encrypt())
    .add(DerivedAesParametersBuilder.builder().password(userPassword))
    // encryption is finished here, but we reclassify it as a plain file, and execute decryption
    .add(ReclassifiedPlainBuilder.builder())
    // this could be a separate decryption pipeline, the roundtrip is for demonstration purposes
    .add(DerivedAesParametersBuilder.builder().password(userPassword))
    .add(AesBuilder.builder().decrypt())
    .build();

Explanation:

  • The password-based key material is derived by DerivedAesParametersBuilder
  • It uses collectParameters() to expose the derived salt, IV, mode, etc.
  • These parameters are passed backward to the previous AesBuilder via applyParameters()
  • During decryption, DerivedAesParametersBuilder parses the stream to retrieve the header and exposes it again to the decryptor

Example Snippet from SecretDerivedAesParameters

@Override
public void collectParameters(Map<String, Object> collector) {
    collector.put("secret.salt", params.salt());
    collector.put("secret.iterations", params.iterations());
    collector.put("aes.mode", params.mode().toString());
    // … additional values
}

@Override
public void applyParameters(Map<String, Object> params) {
    // Override internal state using values from downstream
    this.params = new DerivedAesParameters(…);
}

Summary

The ZeroEcho parameter handling system enables cooperative interaction between processing chunks in a linear stream. Each chunk:

  • Gathers its internal configuration via collectParameters()
  • May receive and apply external configuration via applyParameters() from the immediate successor

This enables construction of robust, ordered chains where sensitive parameters (like cryptographic keys or derivation metadata) can flow precisely and securely — without global state or brittle assumptions.
egothor.org Copyright © 1999-2025 by the contributing authors.

Ideas, requests, problems regarding Foswiki? Send feedback

This website is using cookies. More info. That's Fine