Each data-streaming transfer involves two OTDs in a Collaboration as follows:
One provides the stream adapter.
The other consumes the stream adapter to perform the data transfer.
Implementing InputStream must support skip() with negative numbers as an argument.
This section explains how the two data-streaming OTDs operate to effect the transfer of data.
Each of the OTDs in the Batch Adapter exposes stream adapter nodes that enable any OTD to participate in data-streaming transfers. The nodes are named InputStreamAdapter and OutputStreamAdapter. You can associate the stream adapters by using the drag-and-drop features of the Java CAPS IDE.
The InputStreamAdapter (highlighted) and OutputStreamAdapter nodes in the OTD are used for data streaming. This feature operates as follows:
Stream-adapter consumers: The FTP and the record-processing OTDs can only consume stream adapters. Therefore, their stream-adapter nodes are write-only. Their node values can be set (modified).
Stream-adapter provider: The local file OTD can only provide stream adapters, so its stream-adapter nodes are read-only. Its node value can only be retrieved.
The local file OTD is always the stream provider, and the FTP and record-processing OTDs are the consumers.
Use of the InputStreamAdapter and OutputStreamAdapter nodes is an alternative to using the Payload node as follows:
Use these stream adapter nodes to transfer data if you want data streaming.
Use the Payload node for a data transfer without data streaming (payload data transfer).
All operations that, in payload data transfer, read from the Payload node require the InputStreamAdapter node when you are setting up data streaming. Using the same logic, all operations that, in payload data transfer, write to the Payload node require OutputStreamAdapter node for data streaming.
Do not confuse the stream adapter nodes with the get() and put() methods on the OTDs. For example, the BatchFTP OTD’s client interface get() method writes to the Payload node during a payload transfer, so it requires an OutputStreamAdapter node to write to for data streaming. In contrast, the record-processing OTD’s get() method reads from the Payload node during a payload transfer, so for data streaming, get() requires an inputStreamAdapter node to read from.
The four typical data-streaming scenarios are:
Transfer data from a local file system (BatchLocalFile) to a record-processing (BatchRecord) setup. This scenario uses the InputStreamAdapter OTD node (see Data Streaming Scenarios).
Transfer data from a record-processing (BatchRecord) setup to a local file system (BatchLocalFile) using the OutputStreamAdapter OTD node (see Data Streaming Scenarios).
Transfer data from a local file system (BatchLocalFile) to a remote FTP (BatchFTP) setup. This scenario uses the InputStreamAdapter OTD node (see Data Streaming Scenarios).
Transfer data from a remote FTP server (BatchFTP) to a local file system (BatchLocalFile) using the OutputStreamAdapter OTD node (see Data Streaming Scenarios).
This section explains how to use consuming-stream adapters.