Installing Upgrading Designing Configuring Deploying Monitoring Administering Troubleshooting Reference JBI Components
Close Print View
Designing: Using the BatchFTP OTD
 

Classic Java CAPS

Developing Java CAPS Projects

Using SOAP Message Handlers

Creating a Runtime Environment

Designing Business Processes in the Sun Business Process Manager

Working with TCP/IP HL7 Collaborations

Developing Sun Master Indexes (Repository)

Developing Sun Master Patient Indexes

Developing OTDs for Application Adapters

Developing OTDs for Communication Adapters

Understanding the HTTPS OTD

HTTPS Client OTD

HTTPS Server OTD

Using the Batch Adapter OTDs

Overview of the Batch OTDs

BatchFTP OTD

BatchFTP OTD Node Functions

Using the BatchFTP OTD

BatchFTPOverSSL OTD

BatchSFTP OTD

BatchSCP OTD

BatchLocalFile OTD

BatchRecord OTD

BatchInbound OTD

Using Regular Expressions With the Batch Adapter

Using Name Patterns With the Batch Adapter

Creating a New COM and DCOM OTD

To Create a COM OTD

Relaunching OTDs

To Relaunch an Existing OTD

File Adapter Components

File OTD Operations

HL7 OTD Libraries

HL7 Version 2.6 OTD Library

HL7 Version 2.5.1 OTD Library

HL7 Version 2.5 OTD Library

HL7 Version 2.4 OTD Library

HL7 Version 2.3.1 OTD Library

HL7 Version 2.3 OTD Library

HL7 Version 2.2 OTD Library

HL7 Version 2.1 OTD Library

Working With HL7 OTDs

Viewing an OTD Using the OTD Editor

Modifying an OTD Using the OTD Editor

SNA Object Type Definitions (OTDs)

To associate the standard SNA eWay OTD to a new Java Collaboration:

Developing OTDs for Database Adapters

Developing OTDs for Web Server Adapters

Designing with Application Adapters

Designing with Communication Adapters

Designing with Web Server Adapters

SWIFT Integration Projects

Java EE Based Components

Designing with Sun JCA Adapters

About the TCP/IP JCA Adapter

Defining Constants and Variables

Using Database Operations

Developing Sun Master Indexes

Using the JMS JCA Wizard

Using the JAXB Wizard and Code-Seeder Pallete

Using the BatchFTP OTD

The BatchFTP OTD nodes allow you to configure specific adapter configuration parameters for the Collaboration controlling the FTP process. Once you have set the configuration parameters, you do not have to define the same parameters in each corresponding adapter component that uses this Collaboration.

Handling Type Conversions

The Payload node in the BatchFTP OTD is predefined as a byte array (byte[]). This definition allows the adapter to handle both binary and character data.

For example, you could use another OTD (such as an OTD from another adapter or a user-defined OTD) where the “data” node has been defined as a String (java.lang.String). If you were to map that String to the BatchFTP OTD’s Payload node, the Collaboration Editor can do an automatic type conversion and create code similar to that shown in the following example.

Note - You must use care with this feature. While it works in many situations, there can be occasions when the default encoding causes errors in the translation.

Code Conversion and Generation

For example, in a string-to-byte array conversion (or vice versa), the generated Java code could be:

 getoutput().setPayload(STCTypeConverter.toByteArray
    (getinput().getBlob()));

or

 getinput().setBlob(STCTypeConverter.toString
    (getoutput().getPayload()));

If you define the blob data as a byte array, no type conversion is necessary. When there is a conversion, the Collaboration Editor uses the Java Virtual Machine (JVM) default encoding to do the conversion to code, as shown in the previous examples.

Type Conversion Troubleshooting

As explained previously, the default encoding and translation works for many situations. There are cases, however (for example, binary data such as a .zip file), when the encoding could cause errors in the translation. Depending on the data character set and JVM default encoding, you should choose the appropriate encoding. In most cases, using the encoding string “ISO-8859-1” is the best choice.

To use this encoding, you can modify the code manually by adding the encoding String. Taking the previous examples, the resulting code using “ISO-8859-1” is:

 getoutput().setPayload(STCTypeConverter.toByteArray
    (getinput().getBlob(), "ISO-8859-1"));

or

 getinput().setBlob(STCTypeConverter.toString
    (getoutput().getPayload(), "ISO-8859-1"));

Using this String solves this type conversion problem. For more information, see the appropriate JVM encoding reference manuals.

Essential BatchFTP OTD Methods

In addition to the field elements, the BatchFTP OTD’s Client node contains methods that extend the client interface functionality of the adapter. These methods are essential to the proper use of the OTD and require some additional explanation. They are:

Sequence Numbering

The sequence numbering feature allows you to set up the FTP target directory or file name to contain a sequence number. You can set the starting and maximum sequence numbers using the adapter configuration parameters for the OTD.

This parameter is used for the name pattern %#.

This feature is also available with the BatchLocalFile OTD. For more information on these configuration parameters, see Sequence Numbering (BatchFTP Connectivity Map).

Additional FTP File Transfer Commands

The BatchFTP OTD also allows you to enter commands to be executed directly before and after the file transfer operation. See the Pre/Post File Transfer Commands section for details.