The BatchFTP, BatchFTPOverSSL, BatchSCP and BatchSFTP OTDs support automatic connection during initialization. Each of these OTDs require a number of properties to be set with valid values when Connection Mode is set to Automatic. This includes, but is not limited to the following:
This topic describes the configuration properties for the Batch Adapter Dynamic Configuration.
The Batch Adapter Dynamic Configuration include the following section: Dynamic Configurable Parameters for Secure FTP OTDs.
Environment Properties
Host Name
Server Port
User Name
Password
Any additional properties that are required for a successful connection.
These parameters must be set to valid values prior to using the BatchFTP OTD to allow the Adapter to initialize successfully. After the initialization is successful, the parameters can be reconfigured from within the Collaboration Rule.
Dynamic configuration allows you to change configuration settings (based on the data input or Collaboration Rule logic) on the fly. Changes are made to the Collaboration using the Collaboration Editor. Make any necessary changes to the configuration settings and perform the put or get. The Project disconnects, reconnects with the new configuration settings, and performs the transfer.
The following sample code demonstrates how to dynamically configure the Adapter and perform a simple file transfer.
From BatchLocalFile, set the TargetDirectoryName.
//@map:Copy "InDir" to TargetDirectoryName BatchLocalFile_1.getConfiguration().setTargetDirectoryName( "InDir" ); |
From BatchFTP, Disconnect the Adapter.
//@map:Client.disconnect BatchFTP_1.getClient().disconnect(); |
Set the TargetDirectoryName.
//@map:Copy "OutDir" to TargetDirectoryName BatchFTP_1.getConfiguration().setTargetDirectoryName( "OutDir" ); |
Set the HostName
//@map:Copy "myftphostname" to HostName BatchFTP_1.getConfiguration().setHostName( "myftphostname" ); |
Connect the Adapter.
//@map:Client.connect BatchFTP_1.getClient().connect(); |
Perform a simple file transfer:
Get a local file
//@map: BatchLocalFile_1.getClient().get(); |
Assign the Payload.
//@map:Copy Payload to Payload BatchFTP_1.getClient().setPayload(BatchLocalFile_1.getClient().getPay load() ); |
Put a file on the FTP server.
//@map:Client.put BatchFTP_1.getClient().put(); |
To view the Collaboration Editor’s Java Source Editor, click the Advance mode or Source Code mode icon, available on the Collaboration Editor toolbar.
Where to Go Next
Dynamic Configurable Parameters for Secure FTP OTDs.
Related Topics
The secure Batch FTP OTDs contain several dynamic configurable parameters , which include (but are not limited to) the following:
Table 40 CM Link Configuration ⇒ BatchFTPOverSSL⇒ Value
Name |
Description |
Required Value |
---|---|---|
Remote Directory |
Specifies the virtual directory server where data is published or subscribed. |
The remote directory name |
Remote Directory Name Is Pattern |
Specifies the meaning of the remote directory name. Yes: Indicates that the remote directory name represents a pattern to be used as a regular expression for pattern matching. No: Indicates that the remote directory name represents the exact name to be used, without pattern matching |
Select Yes or No. |
Remote File |
Specifies the name of a file on the remote server used to receive or hold data for retrieval. |
The remote file name. |
Remote File Name Is Pattern |
Specifies the meaning of the remote file name: Yes Indicates that the remote file name represents a pattern to be used as a regular expression for pattern matching. Noindicates that the remote file name represents the exact name to be used, without pattern matching |
Select Yes or No. |
Local Directory |
Specifies the local directory for files to be sent to or received from, the remote server. |
The local directory name |
Local Directory Name Is Pattern |
Specifies the meaning of the local directory name: Yes: Indicates that the local directory name represents a pattern to be used as a regular expression for pattern matching. No: Indicates that the local directory name represents the exact name to be used, without pattern matching. |
Select Yes or No. |
Local File |
Specifies the local file name for files to be sent to or received from, the remote server. |
The local file name |
Local File Name Is Pattern |
Specifies the meaning of the local file name: Yes: Indicates that the local file name represents a pattern to be used as a regular expression for pattern matching. No: Indicates that the local file name represents the exact name to be used, without pattern matching |
Select Yes or No. |
Transfer Mode |
Specifies whether the transfer is binary code or ASCII |
Select Binary or ASCII. |
Append |
Specifies whether to overwrite or append the data to the existing file. Yes: Means the data will be appended to an existing file. No: Overwrites the existing file on the remote system. If a file with the same name does not exist, both Yes and No create a new file on the external host. |
Select Yes or No. |
Local File Overwrite |
Specifies whether new data downloaded from the remote server will overwrite existing data. |
Select Yes or No. |
Table 41 CM Link Configuration ⇒BatchSCP⇒ Value
Name |
Description |
Required Value |
---|---|---|
Remote Directory |
Specifies the virtual directory server where data is published or subscribed. |
The remote directory name |
Remote File |
Specifies the name of a file on the remote server used to receive or hold data for retrieval. |
The remote file name. |
Local Directory |
Specifies the local directory for files to be sent to or received from, the remote server. |
The local directory name |
Local File |
Specifies the local file name for files to be sent to or received from, the remote server. |
The local file name |
Transfer Mode |
Specifies whether the transfer is binary code or ASCII |
Select Binary or ASCII. |
Copy Recursive |
Specifies whether the copy is recursive (copied to all subdirectories) |
Select Yes or No. |
Table 42 CM Link Configuration ⇒ BatchSFTP ⇒ Value
Name |
Description |
Required Value |
---|---|---|
Remote Directory |
Specifies the virtual directory server where data is published or subscribed. |
The remote directory name |
Remote Directory Name Is Pattern |
Specifies the meaning of the remote directory name. Yes: Indicates that the remote directory name represents a pattern to be used as a regular expression for pattern matching. No: Indicates that the remote directory name represents the exact name to be used, without pattern matching |
Select Yes or No. |
Remote File |
Specifies the name of a file on the remote server used to receive or hold data for retrieval. |
The remote file name. |
Remote File Name Is Pattern |
Specifies the meaning of the remote file name: Yes: Indicates that the remote file name represents a pattern to be used as a regular expression for pattern matching. No: Indicates that the remote file name represents the exact name to be used, without pattern matching |
Select Yes or No. |
Local Directory |
Specifies the local directory for files to be sent to or received from, the remote server. |
The local directory name. |
Local Directory Name Is Pattern |
Specifies the meaning of the local directory name: Yes: Indicates that the local directory name represents a pattern to be used as a regular expression for pattern matching. No: Indicates that the local directory name represents the exact name to be used, without pattern matching. |
Select Yes or No. |
Local File |
Specifies the local file name for files to be sent to or received from, the remote server. |
The local file name. |
Local File Name Is Pattern |
Specifies the meaning of the local file name: Yes: Indicates that the local file name represents a pattern to be used as a regular expression for pattern matching. No: Indicates that the local file name represents the exact name to be used, without pattern matching |
Select Yes or No. |
Transfer Mode |
Specifies whether the transfer is binary code or ASCII. |
Select Binary or ASCII. |
The configuration parameters listed below can be configured from the Collaboration Editor by entering the specified integer values in the method parameters. The classes, com.stc.connect.ssl.FTPSSLConstants and com.stc.connect.ssh.SSHConstants, do not allow incremental completion, that is, you must enter the value using the fully qualified name to access the constant.
For example, to set the BatchFTPOverSSL Secure Mode to Explicit SSL, from the Collaboration Editor, do the following:
From the Collaboration Editor toolbar, click Source Code Mode. The Collaboration Editor’s Java Source Editor opens.
From the Business Rules tree (Business Rules pane) select the rule that contains the parameter or method that you want to configure. Selecting the rule highlights the corresponding code in the Java Source Editor. Find the code you wish to modify.
From the Java Source Editor, enter the value for the setting you require. For example, to set the BatchFTPOverSSL SecureType method to Explicit SSL, type com.stc.connector.ssl.FTPSSLConstants.FTP_SECURE_TYPE_SSL_EXPLICIT as the parameter value (see example below):
public void receive( com.stc.connector.appconn.file.FileTextMessage input, com.stc.connector.batchadapter.appconn.ftps.FTPOverSSL BatchFTPOverSSL_1 ) throws Throwable { if (!BatchFTPOverSSL_1.getClient().isConnected()) { logger.error( "Collab Start NOT CONNECTED ============ DO CONNECT" ); BatchFTPOverSSL_1.getClient().connect(); BatchFTPOverSSL_1.getConfiguration().setSecureType( com.stc.connector.ssl.FTPSSLConstants.FTP_SECURE_TYPE_SSL_EXPLICIT ); } BatchFTPOverSSL_1.getClient().get(); if (BatchFTPOverSSL_1.getClient().isConnected()) { logger.error( "Collab End IS CONNECTED ============ DO DISCONNECT" ); BatchFTPOverSSL_1.getClient().disconnect(); } } |
Once you have made your changes to the Collaboration, click the Commit Changes icon (from the Java Source Editor toolbar).
The OTD parameters listed below accept the following specified values:
BatchFTPOverSSL
CM Link configuration ⇒ FTP and SSL Settings ⇒ SecureType
None: com.stc.connector.ssl.FTPSSLConstants.FTP_SECURE_TYPE_NONE
Implicit SSL:com.stc.connector.ssl.FTPSSLConstants.FTP_SECURE_TYPE_IMPLICIT
Explicit SSL:com.stc.connector.ssl.FTPSSLConstants.FTP_SECURE_TYPE_SSL_EXPLICIT
Environment Link configuration ⇒ FTP and SSL Settings ⇒ KeyStoreType
JKS:com.stc.connector.ssl.FTPSSLConstants.KEY_STORE_TYPE_JKS (only one valid choice)
Other: (this is a place holder - reserved for future enhancement)
CM Link configuration ⇒ FTP and SSL Settings ⇒ TransferMode
ASCII:com.stc.connector.ssl.FTPSSLConstants.FTP_TRANS_MODE_ASCII
BINARY:com.stc.connector.ssl.FTPSSLConstants.FTP_TRANS_MODE_BINARY
BatchSFTP
Where to Go Next
Configuring Batch Adapter Heuristic Properties.
Related Topics