Class FileTransferFC
- java.lang.Object
-
- com.ibm.di.fc.Function
-
- 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:
- FTP
- RSH
- REXEC
- SSH
- A windows connection protocol such as SMB,CIFS,DCE-RPC
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
Fields Modifier and Type Field Description static java.lang.String
AS400_PROXY
The parameter for the Proxy to be used if required for AS400 connectionstatic java.lang.String
AS400_SSL
The parameter for Enable or disable SSL over an AS400 connectioncom.ibm.di.fc.filetransferfc.FileTransferFC.Direction
direction
Transfer Directionstatic java.lang.String
HANDLE_TEXT_FILE
The parameter to handle as Text filestatic java.lang.String
HOSTNAME
The property for the Hostnamestatic java.lang.String
KEYSTORE
The property for the Keystorestatic java.lang.String
LOCAL_TO_LOCAL
String for Local to Local file transferstatic java.lang.String
LOCAL_TO_REMOTE
String for Local to Remote file transferprotected LogProxy
logProxy
The way to perform RXA connection related loggingprotected FileTransferOperator
operator
The operator object that connects to the appropriate machine to transfer the file.protected java.lang.String[]
PARAM_CONFIG_OPTIONS
This array stores the names of the TDI GUI parameters that can be configuredstatic java.lang.String
PARAM_CONFIG_RXA_LOG
Enable or disable RXA internal loggingstatic java.lang.String
PARAM_CONFIG_SOURCE_HOST
The parameter for Source Hostnamestatic java.lang.String
PARAM_CONFIG_SOURCE_PATH
The parameter for Source File Pathstatic java.lang.String
PARAM_CONFIG_SOURCE_PORT
The parameter for Source Portstatic java.lang.String
PARAM_CONFIG_SOURCE_PROTOCOL
The parameter for Source Connection Protocolstatic java.lang.String
PARAM_CONFIG_TARGET_HOST
The parameter for Target Hostnamestatic java.lang.String
PARAM_CONFIG_TARGET_PATH
The parameter for Target File Pathstatic java.lang.String
PARAM_CONFIG_TARGET_PORT
The parameter for Target Portstatic java.lang.String
PARAM_CONFIG_TARGET_PROTOCOL
The parameter for Target Connection Protocolstatic java.lang.String
PASSPHRASE
The property for the Passphrasestatic java.lang.String
PASSWORD
The property for the Passwordstatic java.lang.String
PATH
The property for the pathstatic java.lang.String
PORT
The property for the Port numberstatic java.lang.String
PROTOCOL
The property key for connection protocolstatic java.lang.String
RECURSIVE_SEARCH
The property for Recursive search of the filesstatic java.lang.String
REMOTE_TO_LOCAL
String for Remote to Local file transferstatic java.lang.String
REMOTE_TO_REMOTE
String for Remote to Remote file transferprotected TDIRXALogAdapter
RXAlogger
The way to perform RXA loggingprotected FileTransferOperator
sourceOperator
The operator object that connects to source machine to transfer the file.static java.lang.String
SOURCEPATH
The property for the Source file pathprotected FileTransferOperator
targetOperator
The operator object that connects to target machine to transfer the file.static java.lang.String
TIME_OUT
The parameter for file transfer operation timeout for RXA supported protocolsstatic java.lang.String
USERNAME
The property key for the Username
-
Constructor Summary
Constructors Constructor Description FileTransferFC()
File Transfer FC constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
getFile()
Receives the file from Source to Local machinejava.util.Vector<java.lang.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 parametersprotected com.ibm.tivoli.remoteaccess.log.Logger
getRXACompatableLogger()
Gets an RXA compatible loggerjava.lang.String
getVersion()
Gets the version of this FC.void
initConnection()
Initializes connection to target machine(s)void
initialize(java.lang.Object o)
This function is called once after the components configuration file has been provided by the caller.java.lang.String[]
listSource()
Retrieves the list of Files in the Source pathjava.lang.String[]
listTarget()
Retrieves the list of Files in the Target pathjava.lang.Object
perform(java.lang.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 Targetvoid
printDebugMessage(java.lang.String msgKey, java.lang.Object[] params)
Prints a debug message if debug mode for the Components is enabled.void
putFile()
Send the file from Local to Target machinevoid
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
-
-
-
-
Field Detail
-
PARAM_CONFIG_SOURCE_PROTOCOL
public static final java.lang.String PARAM_CONFIG_SOURCE_PROTOCOL
The parameter for Source Connection Protocol- See Also:
- Constant Field Values
-
PARAM_CONFIG_SOURCE_PATH
public static final java.lang.String PARAM_CONFIG_SOURCE_PATH
The parameter for Source File Path- See Also:
- Constant Field Values
-
PARAM_CONFIG_SOURCE_HOST
public static final java.lang.String PARAM_CONFIG_SOURCE_HOST
The parameter for Source Hostname- See Also:
- Constant Field Values
-
PARAM_CONFIG_SOURCE_PORT
public static final java.lang.String PARAM_CONFIG_SOURCE_PORT
The parameter for Source Port- See Also:
- Constant Field Values
-
PARAM_CONFIG_TARGET_PROTOCOL
public static final java.lang.String PARAM_CONFIG_TARGET_PROTOCOL
The parameter for Target Connection Protocol- See Also:
- Constant Field Values
-
PARAM_CONFIG_TARGET_PATH
public static final java.lang.String PARAM_CONFIG_TARGET_PATH
The parameter for Target File Path- See Also:
- Constant Field Values
-
PARAM_CONFIG_TARGET_HOST
public static final java.lang.String PARAM_CONFIG_TARGET_HOST
The parameter for Target Hostname- See Also:
- Constant Field Values
-
PARAM_CONFIG_TARGET_PORT
public static final java.lang.String PARAM_CONFIG_TARGET_PORT
The parameter for Target Port- See Also:
- Constant Field Values
-
PROTOCOL
public static final java.lang.String PROTOCOL
The property key for connection protocol- See Also:
- Constant Field Values
-
USERNAME
public static final java.lang.String USERNAME
The property key for the Username- See Also:
- Constant Field Values
-
PASSWORD
public static final java.lang.String PASSWORD
The property for the Password- See Also:
- Constant Field Values
-
KEYSTORE
public static final java.lang.String KEYSTORE
The property for the Keystore- See Also:
- Constant Field Values
-
PASSPHRASE
public static final java.lang.String PASSPHRASE
The property for the Passphrase- See Also:
- Constant Field Values
-
HOSTNAME
public static final java.lang.String HOSTNAME
The property for the Hostname- See Also:
- Constant Field Values
-
PORT
public static final java.lang.String PORT
The property for the Port number- See Also:
- Constant Field Values
-
PATH
public static final java.lang.String PATH
The property for the path- See Also:
- Constant Field Values
-
SOURCEPATH
public static final java.lang.String SOURCEPATH
The property for the Source file path- See Also:
- Constant Field Values
-
RECURSIVE_SEARCH
public static final java.lang.String RECURSIVE_SEARCH
The property for Recursive search of the files- See Also:
- Constant Field Values
-
TIME_OUT
public static final java.lang.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 java.lang.String HANDLE_TEXT_FILE
The parameter to handle as Text file- See Also:
- Constant Field Values
-
AS400_SSL
public static final java.lang.String AS400_SSL
The parameter for Enable or disable SSL over an AS400 connection- See Also:
- Constant Field Values
-
AS400_PROXY
public static final java.lang.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 java.lang.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 java.lang.String LOCAL_TO_LOCAL
String for Local to Local file transfer- See Also:
- Constant Field Values
-
LOCAL_TO_REMOTE
public static final java.lang.String LOCAL_TO_REMOTE
String for Local to Remote file transfer- See Also:
- Constant Field Values
-
REMOTE_TO_LOCAL
public static final java.lang.String REMOTE_TO_LOCAL
String for Remote to Local file transfer- See Also:
- Constant Field Values
-
REMOTE_TO_REMOTE
public static final java.lang.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 java.lang.String PARAM_CONFIG_RXA_LOG
Enable or disable RXA internal logging- See Also:
- Constant Field Values
-
-
Method Detail
-
perform
public java.lang.Object perform(java.lang.Object arg0) throws java.lang.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:
java.lang.Exception
- if a problem occurs.
-
initialize
public void initialize(java.lang.Object o) throws java.lang.Exception
This function is called once after the components configuration file has been provided by the caller.- Specified by:
initialize
in interfaceFunctionInterface
- Overrides:
initialize
in classFunction
- Parameters:
o
- The custom log object from TDI.- Throws:
java.lang.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, java.lang.Exception
Initializes connection to target machine(s)- Throws:
java.lang.Exception
ParamException
RemoteConnectException
-
getVersion
public java.lang.String getVersion()
Gets the version of this FC.- Returns:
- version string
-
printDebugMessage
public void printDebugMessage(java.lang.String msgKey, java.lang.Object[] params)
Prints a debug message if debug mode for the Components is enabled.- Parameters:
msgKey
- message keyparams
- place holder for debug messages
-
terminate
public void terminate() throws java.lang.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 interfaceFunctionInterface
- Overrides:
terminate
in classFunction
- Throws:
java.lang.Exception
-
getProtocols
public java.util.Vector<java.lang.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, java.lang.Exception
Receives the file from Source to Local machine- Throws:
java.lang.Exception
ParamException
RemoteConnectException
-
putFile
public void putFile() throws RemoteConnectException, ParamException, java.lang.Exception
Send the file from Local to Target machine- Throws:
java.lang.Exception
ParamException
RemoteConnectException
-
listSource
public java.lang.String[] listSource() throws RemoteConnectException, ParamException, java.lang.Exception
Retrieves the list of Files in the Source path- Throws:
java.lang.Exception
ParamException
RemoteConnectException
-
listTarget
public java.lang.String[] listTarget() throws RemoteConnectException, ParamException, java.lang.Exception
Retrieves the list of Files in the Target path- Throws:
java.lang.Exception
ParamException
RemoteConnectException
-
-