|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.di.fc.remotecmdlnfc.RemoteCmdLineExecutor
public class RemoteCmdLineExecutor
The CmdLineExecutor that connects to and executes commands on a remote machine
Constructor Summary | |
---|---|
RemoteCmdLineExecutor(Properties p,
LogProxy lp)
Constructor for the RemoteCmdLineExecutor |
Method Summary | |
---|---|
String |
buildSingleCommand(String cmdToExecute,
String[] args,
String argDelimiter)
Constructs a single String that represents the command and all its arguments seperated with the specified delimiter. |
void |
close()
Close the connection to the target |
Entry |
executeCommand(String cmdToExecute)
Execute the command on the target machine. |
Entry |
executeCommand(String cmdToExecute,
String[] args,
String argDelimiter)
Execute the command on the target machine. |
char |
getOSSeparator()
Return the correct path separator for the target system. |
String |
getRandomDir(String path)
Create a random directory on the target machine. |
com.ibm.tivoli.remoteaccess.RemoteAccess |
getRXAProtocol()
Return the connection object accessing the target machine |
boolean |
prepareConnection()
Create a connection with the target machine |
void |
removeDir(String dir)
Remove a file/directory from the target |
void |
setExecutorCmdArgsEncoding(String enc)
Sets encoding for the command arguments before executing the actual command |
void |
transferFile(String local,
String remote)
Transfer file localStdin to remoteStdin. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RemoteCmdLineExecutor(Properties p, LogProxy lp)
p
- The properties for the executor connectionlp
- The LogProxy for loggingMethod Detail |
---|
public boolean prepareConnection() throws RemoteConnectException, ParamException
prepareConnection
in interface CmdLineExecutor
RemoteConnectException
ParamException
public Entry executeCommand(String cmdToExecute) throws RemoteConnectException, GeneralCLFCException
executeCommand
in interface CmdLineExecutor
cmdToExecute
- The command to be executed
RemoteConnectException
GeneralCLFCException
public Entry executeCommand(String cmdToExecute, String[] args, String argDelimiter) throws RemoteConnectException, GeneralCLFCException
executeCommand
in interface CmdLineExecutor
cmdToExecute
- The command to be executedargs
- The command arguments as a String ArrayargDelimiter
- The command argument delimiter
RemoteConnectException
GeneralCLFCException
public String getRandomDir(String path) throws GeneralCLFCException
getRandomDir
in interface CmdLineExecutor
path
- The path to the directory under which the random directory is
to be created
GeneralCLFCException
- If random directory creation failspublic void transferFile(String local, String remote) throws GeneralCLFCException
transferFile
in interface CmdLineExecutor
local
- Path to standard input source file on local machineremote
- Path to standard input destination file on target machine
GeneralCLFCException
- If file transfer is unsuccessfulpublic void removeDir(String dir) throws GeneralCLFCException
removeDir
in interface CmdLineExecutor
dir
- Path to the file/folder to be removed on target machine
GeneralCLFCException
- If delete operation is unsuccessfulpublic char getOSSeparator() throws RemoteConnectException
getOSSeparator
in interface CmdLineExecutor
RemoteConnectException
- If problems encountered obtaining the OS Separator.public void close()
close
in interface CmdLineExecutor
public String buildSingleCommand(String cmdToExecute, String[] args, String argDelimiter)
cmdToExecute
- The command to be executedargs
- The command arguments as a String ArrayargDelimiter
- The command argument delimiter Return the connection object
accessing the target machine
public com.ibm.tivoli.remoteaccess.RemoteAccess getRXAProtocol()
public void setExecutorCmdArgsEncoding(String enc)
setExecutorCmdArgsEncoding
in interface CmdLineExecutor
enc
- encoding to be used
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |