com.ibm.di.fc.filetransferfc
Class FileTransferFC

java.lang.Object
  extended by com.ibm.di.fc.Function
      extended by com.ibm.di.fc.filetransferfc.FileTransferFC
All Implemented Interfaces:
FunctionInterface, VersionInfoInterface

public class FileTransferFC
extends Function

TDI File Transfer Function Component.

This function component (FC) provides the ability to transfer a specified file to a target machine.

This FC establishes connections and transfers file to target machines using the IBM Remote Execution and Access toolkit or existing FTPClient APIs (com.ibm.di.protocols.FTPClient). To use this function component you must have the File Transfer FC (with its included jar files) installed correctly on your local machine. The target machine you wish to connect and transfer file to must have at least one of the following connection protocols configured and running:

Configuration is accomplished by setting logon parameters for client connections to the specified machine (target) where the file needs to be transferred. See initialize(java.lang.Object) for more details on how to initialize.

initialize(java.lang.Object) must be the first operation called in this class.
perform(java.lang.Object) can then be called one or more times.
terminate() must be called to allow connection cleanup before the class is destroyed.


Field Summary
static String AS400_PROXY
          The parameter for the Proxy to be used if required for AS400 connection
static String AS400_SSL
          The parameter for Enable or disable SSL over an AS400 connection
 com.ibm.di.fc.filetransferfc.FileTransferFC.Direction direction
          Transfer Direction
static String HANDLE_TEXT_FILE
          The parameter to handle as Text file
static String HOSTNAME
          The property for the Hostname
static String KEYSTORE
          The property for the Keystore
static String LOCAL_TO_LOCAL
          String for Local to Local file transfer
static String LOCAL_TO_REMOTE
          String for Local to Remote file transfer
protected  LogProxy logProxy
          The way to perform RXA connection related logging
protected  FileTransferOperator operator
          The operator object that connects to the appropriate machine to transfer the file.
protected  String[] PARAM_CONFIG_OPTIONS
          This array stores the names of the TDI GUI parameters that can be configured
static String PARAM_CONFIG_RXA_LOG
          Enable or disable RXA internal logging
static String PARAM_CONFIG_SOURCE_HOST
          The parameter for Source Hostname
static String PARAM_CONFIG_SOURCE_PATH
          The parameter for Source File Path
static String PARAM_CONFIG_SOURCE_PORT
          The parameter for Source Port
static String PARAM_CONFIG_SOURCE_PROTOCOL
          The parameter for Source Connection Protocol
static String PARAM_CONFIG_TARGET_HOST
          The parameter for Target Hostname
static String PARAM_CONFIG_TARGET_PATH
          The parameter for Target File Path
static String PARAM_CONFIG_TARGET_PORT
          The parameter for Target Port
static String PARAM_CONFIG_TARGET_PROTOCOL
          The parameter for Target Connection Protocol
static String PASSPHRASE
          The property for the Passphrase
static String PASSWORD
          The property for the Password
static String PATH
          The property for the path
static String PORT
          The property for the Port number
static String PROTOCOL
          The property key for connection protocol
static String RECURSIVE_SEARCH
          The property for Recursive search of the files
static String REMOTE_TO_LOCAL
          String for Remote to Local file transfer
static String REMOTE_TO_REMOTE
          String for Remote to Remote file transfer
protected  TDIRXALogAdapter RXAlogger
          The way to perform RXA logging
protected  FileTransferOperator sourceOperator
          The operator object that connects to source machine to transfer the file.
static String SOURCEPATH
          The property for the Source file path
protected  FileTransferOperator targetOperator
          The operator object that connects to target machine to transfer the file.
static String TIME_OUT
          The parameter for file transfer operation timeout for RXA supported protocols
static String USERNAME
          The property key for the Username
 
Fields inherited from class com.ibm.di.fc.Function
logger
 
Constructor Summary
FileTransferFC()
          File Transfer FC constructor
 
Method Summary
 void getFile()
          Receives the file from Source to Local machine
 Vector<String> getProtocols(boolean isSource)
          This function makes a list of protocols which can be used to make a successful connection to the specified machine with the specified connection parameters
protected  com.ibm.tivoli.remoteaccess.log.Logger getRXACompatableLogger()
          Gets an RXA compatible logger
 String getVersion()
          Gets the version of this FC.
 void initConnection()
          Initializes connection to target machine(s)
 void initialize(Object o)
          This function is called once after the components configuration file has been provided by the caller.
 String[] listSource()
          Retrieves the list of Files in the Source path
 String[] listTarget()
          Retrieves the list of Files in the Target path
 Object perform(Object arg0)
          The FC receives the information about connection parameters from configuration panel or from its Output Map and transfers a file from given Source to Target
 void printDebugMessage(String msgKey, Object[] params)
          Prints a debug message if debug mode for the Components is enabled.
 void putFile()
          Send the file from Local to Target machine
 void terminate()
          This function is called when the connector is no longer needed by the user in the Assembly Line or script.
 
Methods inherited from class com.ibm.di.fc.Function
debug, getConfiguration, getContext, getDebug, getLog, getParam, getRSInterface, getUI, initialize, logmsg, querySchema, setConfiguration, setContext, setDebug, setLog, setParam, setRSInterface, updateSchema, verifyInitialized
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARAM_CONFIG_SOURCE_PROTOCOL

public static final String PARAM_CONFIG_SOURCE_PROTOCOL
The parameter for Source Connection Protocol

See Also:
Constant Field Values

PARAM_CONFIG_SOURCE_PATH

public static final String PARAM_CONFIG_SOURCE_PATH
The parameter for Source File Path

See Also:
Constant Field Values

PARAM_CONFIG_SOURCE_HOST

public static final String PARAM_CONFIG_SOURCE_HOST
The parameter for Source Hostname

See Also:
Constant Field Values

PARAM_CONFIG_SOURCE_PORT

public static final String PARAM_CONFIG_SOURCE_PORT
The parameter for Source Port

See Also:
Constant Field Values

PARAM_CONFIG_TARGET_PROTOCOL

public static final String PARAM_CONFIG_TARGET_PROTOCOL
The parameter for Target Connection Protocol

See Also:
Constant Field Values

PARAM_CONFIG_TARGET_PATH

public static final String PARAM_CONFIG_TARGET_PATH
The parameter for Target File Path

See Also:
Constant Field Values

PARAM_CONFIG_TARGET_HOST

public static final String PARAM_CONFIG_TARGET_HOST
The parameter for Target Hostname

See Also:
Constant Field Values

PARAM_CONFIG_TARGET_PORT

public static final String PARAM_CONFIG_TARGET_PORT
The parameter for Target Port

See Also:
Constant Field Values

PROTOCOL

public static final String PROTOCOL
The property key for connection protocol

See Also:
Constant Field Values

USERNAME

public static final String USERNAME
The property key for the Username

See Also:
Constant Field Values

PASSWORD

public static final String PASSWORD
The property for the Password

See Also:
Constant Field Values

KEYSTORE

public static final String KEYSTORE
The property for the Keystore

See Also:
Constant Field Values

PASSPHRASE

public static final String PASSPHRASE
The property for the Passphrase

See Also:
Constant Field Values

HOSTNAME

public static final String HOSTNAME
The property for the Hostname

See Also:
Constant Field Values

PORT

public static final String PORT
The property for the Port number

See Also:
Constant Field Values

PATH

public static final String PATH
The property for the path

See Also:
Constant Field Values

SOURCEPATH

public static final String SOURCEPATH
The property for the Source file path

See Also:
Constant Field Values

RECURSIVE_SEARCH

public static final String RECURSIVE_SEARCH
The property for Recursive search of the files

See Also:
Constant Field Values

TIME_OUT

public static final String TIME_OUT
The parameter for file transfer operation timeout for RXA supported protocols

See Also:
Constant Field Values

HANDLE_TEXT_FILE

public static final String HANDLE_TEXT_FILE
The parameter to handle as Text file

See Also:
Constant Field Values

AS400_SSL

public static final String AS400_SSL
The parameter for Enable or disable SSL over an AS400 connection

See Also:
Constant Field Values

AS400_PROXY

public static final String AS400_PROXY
The parameter for the Proxy to be used if required for AS400 connection

See Also:
Constant Field Values

PARAM_CONFIG_OPTIONS

protected final String[] PARAM_CONFIG_OPTIONS
This array stores the names of the TDI GUI parameters that can be configured


operator

protected FileTransferOperator operator
The operator object that connects to the appropriate machine to transfer the file.


sourceOperator

protected FileTransferOperator sourceOperator
The operator object that connects to source machine to transfer the file.


targetOperator

protected FileTransferOperator targetOperator
The operator object that connects to target machine to transfer the file.


LOCAL_TO_LOCAL

public static final String LOCAL_TO_LOCAL
String for Local to Local file transfer

See Also:
Constant Field Values

LOCAL_TO_REMOTE

public static final String LOCAL_TO_REMOTE
String for Local to Remote file transfer

See Also:
Constant Field Values

REMOTE_TO_LOCAL

public static final String REMOTE_TO_LOCAL
String for Remote to Local file transfer

See Also:
Constant Field Values

REMOTE_TO_REMOTE

public static final String REMOTE_TO_REMOTE
String for Remote to Remote file transfer

See Also:
Constant Field Values

direction

public com.ibm.di.fc.filetransferfc.FileTransferFC.Direction direction
Transfer Direction


logProxy

protected LogProxy logProxy
The way to perform RXA connection related logging


RXAlogger

protected TDIRXALogAdapter RXAlogger
The way to perform RXA logging


PARAM_CONFIG_RXA_LOG

public static final String PARAM_CONFIG_RXA_LOG
Enable or disable RXA internal logging

See Also:
Constant Field Values
Constructor Detail

FileTransferFC

public FileTransferFC()
File Transfer FC constructor

Method Detail

perform

public Object perform(Object arg0)
               throws Exception
The FC receives the information about connection parameters from configuration panel or from its Output Map and transfers a file from given Source to Target

Parameters:
arg0 - the work entry passed to the FC.
Returns:
an Entry object containing $tempFilePath attribute with the status of file transfer operation
Throws:
Exception - if a problem occurs.

initialize

public void initialize(Object o)
                throws Exception
This function is called once after the components configuration file has been provided by the caller.

Specified by:
initialize in interface FunctionInterface
Overrides:
initialize in class Function
Parameters:
o - The custom log object from TDI.
Throws:
Exception - If super class initialize fails.

getRXACompatableLogger

protected com.ibm.tivoli.remoteaccess.log.Logger getRXACompatableLogger()
Gets an RXA compatible logger

Returns:
the logger

initConnection

public void initConnection()
                    throws RemoteConnectException,
                           ParamException,
                           Exception
Initializes connection to target machine(s)

Throws:
Exception
ParamException
RemoteConnectException

getVersion

public String getVersion()
Gets the version of this FC.

Returns:
version string

printDebugMessage

public void printDebugMessage(String msgKey,
                              Object[] params)
Prints a debug message if debug mode for the Components is enabled.

Parameters:
msgKey - message key
params - place holder for debug messages

terminate

public void terminate()
               throws Exception
This function is called when the connector is no longer needed by the user in the Assembly Line or script. Always calls the superclass terminate method which will take care of releasing resources, closing parsers etc.

Specified by:
terminate in interface FunctionInterface
Overrides:
terminate in class Function
Throws:
Exception

getProtocols

public Vector<String> getProtocols(boolean isSource)
This function makes a list of protocols which can be used to make a successful connection to the specified machine with the specified connection parameters

Parameters:
isSource - Checks if protocols need to be retrieved for Source end point
Returns:
List of protocols which can be used to make a successful connection to the specified machine with the specified connection parameters

getFile

public void getFile()
             throws RemoteConnectException,
                    ParamException,
                    Exception
Receives the file from Source to Local machine

Throws:
Exception
ParamException
RemoteConnectException

putFile

public void putFile()
             throws RemoteConnectException,
                    ParamException,
                    Exception
Send the file from Local to Target machine

Throws:
Exception
ParamException
RemoteConnectException

listSource

public String[] listSource()
                    throws RemoteConnectException,
                           ParamException,
                           Exception
Retrieves the list of Files in the Source path

Throws:
Exception
ParamException
RemoteConnectException

listTarget

public String[] listTarget()
                    throws RemoteConnectException,
                           ParamException,
                           Exception
Retrieves the list of Files in the Target path

Throws:
Exception
ParamException
RemoteConnectException