Class 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 connection
      static java.lang.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 java.lang.String HANDLE_TEXT_FILE
      The parameter to handle as Text file
      static java.lang.String HOSTNAME
      The property for the Hostname
      static java.lang.String KEYSTORE
      The property for the Keystore
      static java.lang.String LOCAL_TO_LOCAL
      String for Local to Local file transfer
      static java.lang.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 java.lang.String[] PARAM_CONFIG_OPTIONS
      This array stores the names of the TDI GUI parameters that can be configured
      static java.lang.String PARAM_CONFIG_RXA_LOG
      Enable or disable RXA internal logging
      static java.lang.String PARAM_CONFIG_SOURCE_HOST
      The parameter for Source Hostname
      static java.lang.String PARAM_CONFIG_SOURCE_PATH
      The parameter for Source File Path
      static java.lang.String PARAM_CONFIG_SOURCE_PORT
      The parameter for Source Port
      static java.lang.String PARAM_CONFIG_SOURCE_PROTOCOL
      The parameter for Source Connection Protocol
      static java.lang.String PARAM_CONFIG_TARGET_HOST
      The parameter for Target Hostname
      static java.lang.String PARAM_CONFIG_TARGET_PATH
      The parameter for Target File Path
      static java.lang.String PARAM_CONFIG_TARGET_PORT
      The parameter for Target Port
      static java.lang.String PARAM_CONFIG_TARGET_PROTOCOL
      The parameter for Target Connection Protocol
      static java.lang.String PASSPHRASE
      The property for the Passphrase
      static java.lang.String PASSWORD
      The property for the Password
      static java.lang.String PATH
      The property for the path
      static java.lang.String PORT
      The property for the Port number
      static java.lang.String PROTOCOL
      The property key for connection protocol
      static java.lang.String RECURSIVE_SEARCH
      The property for Recursive search of the files
      static java.lang.String REMOTE_TO_LOCAL
      String for Remote to Local file transfer
      static java.lang.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 java.lang.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 java.lang.String TIME_OUT
      The parameter for file transfer operation timeout for RXA supported protocols
      static 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 machine
      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
      protected com.ibm.tivoli.remoteaccess.log.Logger getRXACompatableLogger()
      Gets an RXA compatible logger
      java.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 path
      java.lang.String[] listTarget()
      Retrieves the list of Files in the Target path
      java.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 Target
      void 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 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 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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
    • Constructor Detail

      • FileTransferFC

        public FileTransferFC()
        File Transfer FC constructor
    • 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 interface FunctionInterface
        Overrides:
        initialize in class Function
        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
      • 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 key
        params - 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 interface FunctionInterface
        Overrides:
        terminate in class Function
        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