com.ibm.di.protocols.rxa
Class AS400Connection

java.lang.Object
  extended by com.ibm.di.protocols.rxa.ConnectionImpl
      extended by com.ibm.di.protocols.rxa.AS400Connection
All Implemented Interfaces:
Connection

public class AS400Connection
extends ConnectionImpl

This class encapsulates the RXA library's AS400 Connection related objects


Field Summary
protected  Object[] args
          To be used in logged messages
static String TYPE
          The connection protocol being used
 
Fields inherited from class com.ibm.di.protocols.rxa.ConnectionImpl
AS400_PROXY, AS400_RUNPROG, AS400_SSL, as400Proxy, as400RunProg, as400SSL, cmdArgsCharEncode, COMMAND_RETURN_CODE, COMMAND_STD_ERROR, COMMAND_STD_OUTPUT, EMPTYSTRING, HANDLE_TEXT_FILE, hostName, HOSTNAME, initial_timeout, INITIAL_TIMEOUT, keystore, KEYSTORE, lp, parentDirToStdin, passphrase, PASSPHRASE, password, PASSWORD, PATH, port, PORT, randomDir, RECURSIVE_SEARCH, rtnCodeAttr, SOURCEPATH, stdErrorAttr, stdOutputAttr, timeout, TIMEOUT, userName, USERNAME
 
Constructor Summary
AS400Connection(LogProxy log)
           
 
Method Summary
 com.ibm.tivoli.remoteaccess.RemoteAccess beginSession()
          Begin a session with the target machine using the SSH protocol
protected  Entry getEntryResponse(com.ibm.tivoli.remoteaccess.ProgramOutput p)
          Transform the ProgramOutput into an Entry object containing the results
 String getType()
          Return this connection type
 Entry runAS400Program(String c, String[] args, String delim)
          Run the specified command on the target machine
 void transferFile(String localPath, String remotePath)
          Transfer the specified file from the local machine to a specified destination on the remote target
 
Methods inherited from class com.ibm.di.protocols.rxa.ConnectionImpl
createDir, createRandomDir, endSession, getHost, getOSSeparator, getRXAProtocol, getUser, initializeProps, isExists, list, receiveFile, removeDir, runCommand, setCmdArgsCharEncode, setHost, setRXAProtocol, setUser
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE

public static final String TYPE
The connection protocol being used

See Also:
Constant Field Values

args

protected Object[] args
To be used in logged messages

Constructor Detail

AS400Connection

public AS400Connection(LogProxy log)
Parameters:
log -
Method Detail

beginSession

public com.ibm.tivoli.remoteaccess.RemoteAccess beginSession()
                                                      throws RemoteConnectException
Begin a session with the target machine using the SSH protocol

Specified by:
beginSession in interface Connection
Specified by:
beginSession in class ConnectionImpl
Returns:
RemoteAccess The RXA connection object
Throws:
RemoteConnectException

getType

public String getType()
Return this connection type

Specified by:
getType in interface Connection
Specified by:
getType in class ConnectionImpl
Returns:
String The connection protocol used for this connection. One of: WIN, REXEC, RSH, SSH

getEntryResponse

protected Entry getEntryResponse(com.ibm.tivoli.remoteaccess.ProgramOutput p)
Transform the ProgramOutput into an Entry object containing the results

Parameters:
p - The ProgramOutput object containing the results from executing the command
Returns:
Entry object containing three attributes: command.out, command.error, command.returnCode

runAS400Program

public Entry runAS400Program(String c,
                             String[] args,
                             String delim)
                      throws GeneralCLFCException
Run the specified command on the target machine

Parameters:
c - String containing the command to be executed
args - command arguments
delim - command argument delimiter
Returns:
Entry containing the results from executing the command. It contains three attributes: command.out, command.error and command.returnCode.
Throws:
GeneralCLFCException

transferFile

public void transferFile(String localPath,
                         String remotePath)
                  throws GeneralCLFCException
Transfer the specified file from the local machine to a specified destination on the remote target

Specified by:
transferFile in interface Connection
Overrides:
transferFile in class ConnectionImpl
Parameters:
localPath - Path to the source file on the local machine
remotePath - Path to where the file is to be stored on the remote machine
Throws:
GeneralCLFCException - if the transfer fails