Package com.ibm.di.protocols.rxa
Class AS400Connection
- java.lang.Object
-
- com.ibm.di.protocols.rxa.ConnectionImpl
-
- 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
Fields Modifier and Type Field Description protected java.lang.Object[]
args
To be used in logged messagesstatic java.lang.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
Constructors Constructor Description AS400Connection(LogProxy log)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.ibm.tivoli.remoteaccess.RemoteAccess
beginSession()
Begin a session with the target machine using the SSH protocolprotected Entry
getEntryResponse(com.ibm.tivoli.remoteaccess.ProgramOutput p)
Transform the ProgramOutput into an Entry object containing the resultsjava.lang.String
getType()
Return this connection typeEntry
runAS400Program(java.lang.String c, java.lang.String[] args, java.lang.String delim)
Run the specified command on the target machinevoid
transferFile(java.lang.String localPath, java.lang.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
-
-
-
-
Field Detail
-
TYPE
public static final java.lang.String TYPE
The connection protocol being used- See Also:
- Constant Field Values
-
args
protected java.lang.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 interfaceConnection
- Specified by:
beginSession
in classConnectionImpl
- Returns:
- RemoteAccess The RXA connection object
- Throws:
RemoteConnectException
-
getType
public java.lang.String getType()
Return this connection type- Specified by:
getType
in interfaceConnection
- Specified by:
getType
in classConnectionImpl
- 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(java.lang.String c, java.lang.String[] args, java.lang.String delim) throws GeneralCLFCException
Run the specified command on the target machine- Parameters:
c
- String containing the command to be executedargs
- command argumentsdelim
- 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(java.lang.String localPath, java.lang.String remotePath) throws GeneralCLFCException
Transfer the specified file from the local machine to a specified destination on the remote target- Specified by:
transferFile
in interfaceConnection
- Overrides:
transferFile
in classConnectionImpl
- Parameters:
localPath
- Path to the source file on the local machineremotePath
- Path to where the file is to be stored on the remote machine- Throws:
GeneralCLFCException
- if the transfer fails
-
-