DataContent
chain processes data while optionally exchanging metadata (parameters) with neighboring chunks in a controlled and directional manner.
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.
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 differs from typical forward-only streaming, and enables real-time negotiation of encryption, encoding, or processing options.
During execution, each chunk:
setInput(DataContent)
However, it cannot traverse forward in the chain — only the next chunk can query its parameters.
This supports both:
applyParameters()
on the predecessor)
collectParameters()
on itself)
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:
DerivedAesParametersBuilder
collectParameters()
to expose the derived salt, IV, mode, etc.
AesBuilder
via applyParameters()
DerivedAesParametersBuilder
parses the stream to retrieve the header and exposes it again to the decryptor
@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(…); }
The ZeroEcho parameter handling system enables cooperative interaction between processing chunks in a linear stream. Each chunk:
collectParameters()
applyParameters()
from the immediate successor