Skip to main content
Version: 5.2.0.1

Input filter

Concept

When dealing with binary data, Orchestra must transfer the binary content (e.g., a file) to its internal format. In this context, two concepts are important: de-serializers and filters. A de-serializer is a parser that receives a sequence of bytes and converts it to the internal message format. Before the parsing step is applied, a set of filters can be used to transform the binary content before it is passed to the de-serializer. Internally, this works based on a concept known as a filter stream. The idea is to nest different filter streams around the original data in order to perform the necessary pre-processing of the input. In this chapter, we describe the creation of such a user-defined filter.

Creation

Step 1 : Create a new Java Source.

Step 2 : Select "Input Filter" as Class template.

Output filter

After the creation of the java source the following screen appears:

Output filter example

The generated template is based on the concept of a filter stream. The de-serializer reads data byte-by-byte from the underlying filter stream by invoking the read method. Depending on the configuration, a user-defined filter within the filter chain may also be invoked. Another filter, or the de-serializer itself, can invoke the read method from the filter stream. Within the read method, a character from the underlying stream is read (in.read()). In the example above, this character is returned immediately, unless it is a semicolon. In that case, the semicolon is replaced with a '/' sign.