#include <molequeue/sshcommand.h>
|
void | setSshCommand (const QString &command) |
|
void | setScpCommand (const QString &command) |
|
virtual bool | execute (const QString &command) |
|
virtual bool | copyTo (const QString &localFile, const QString &remoteFile) |
|
virtual bool | copyFrom (const QString &remoteFile, const QString &localFile) |
|
virtual bool | copyDirTo (const QString &localDir, const QString &remoteDir) |
|
virtual bool | copyDirFrom (const QString &remoteDir, const QString &localDir) |
|
void | setPersistent (bool persist) |
|
void | setUserName (const QString &newUserName) |
|
void | setHostName (const QString &newHostName) |
|
void | setIdentityFile (const QString &newIdentityFile) |
|
void | setPortNumber (int newPortNumber) |
|
virtual bool | execute (const QString &command) |
|
virtual bool | copyTo (const QString &localFile, const QString &remoteFile) |
|
virtual bool | copyFrom (const QString &remoteFile, const QString &localFile) |
|
virtual bool | copyDirTo (const QString &localDir, const QString &remoteDir) |
|
virtual bool | copyDirFrom (const QString &remoteDir, const QString &localDir) |
|
|
QString | m_sshCommand |
|
QString | m_scpCommand |
|
QString | m_output |
|
int | m_exitCode |
|
TerminalProcess * | m_process |
|
bool | m_isComplete |
|
bool | m_persistent |
|
QVariant | m_data |
|
QString | m_userName |
|
QString | m_hostName |
|
QString | m_identityFile |
|
int | m_portNumber |
|
Abstract subclass of SshConnection providing base implementaton using commandline ssh/scp.
- Author
- Marcus D. Hanwell, David C. Lonie, Chris Harris
The SshCommand provides an base implementation of the SshConnection interface that calls the commandline ssh and scp executables in a TerminalProcess.
When writing code that needs ssh functionality, the code should use the SshConnection interface instead.
- Returns
- The SSH command that will be run.
- Returns
- The SCP command that will be run.
- Returns
- The merged stdout and stderr of the remote command
Reimplemented from SshConnection.
- Returns
- The exit code returned from the remote command.
Reimplemented from SshConnection.
bool waitForCompletion |
( |
int |
msecs = 30000 | ) |
|
|
virtual |
Wait until the request has been completed.
- Parameters
-
msecs | Timeout in milliseconds. Default is 30 seconds. |
- Returns
- True if request finished, false on timeout.
Reimplemented from SshConnection.
bool isComplete |
( |
| ) |
const |
|
virtual |
- Returns
- True if the request has completed. False otherwise.
Reimplemented from SshConnection.
void setSshCommand |
( |
const QString & |
command | ) |
|
|
slot |
Set the SSH command for the class. Defaults to 'ssh', and would execute the SSH commnand in the user's path.
void setScpCommand |
( |
const QString & |
command | ) |
|
|
slot |
Set the SCP command for the class. Defaults to 'scp', and would execute the SCP commnand in the user's path.
virtual bool execute |
( |
const QString & |
command | ) |
|
|
virtualslot |
Execute the supplied command on the remote host.
- Note
- The command is executed asynchronously, see requestComplete() or waitForCompletion() for results.
- See Also
- requestSent() requestCompleted() waitForCompeletion()
- Parameters
-
command | The command to execute. |
- Returns
- True on success, false on failure.
virtual bool copyTo |
( |
const QString & |
localFile, |
|
|
const QString & |
remoteFile |
|
) |
| |
|
virtualslot |
Copy a local file to the remote system.
- Note
- The command is executed asynchronously, see requestComplete() or waitForCompletion() for results.
- See Also
- requestSent() requestCompleted() waitForCompeletion()
- Parameters
-
localFile | The path of the local file. |
remoteFile | The path of the file on the remote system. |
- Returns
- True on success, false on failure.
virtual bool copyFrom |
( |
const QString & |
remoteFile, |
|
|
const QString & |
localFile |
|
) |
| |
|
virtualslot |
Copy a remote file to the local system.
- Note
- The command is executed asynchronously, see requestComplete() or waitForCompletion() for results.
- See Also
- requestSent() requestCompleted() waitForCompeletion()
- Parameters
-
remoteFile | The path of the file on the remote system. |
localFile | The path of the local file. |
- Returns
- True on success, false on failure.
virtual bool copyDirTo |
( |
const QString & |
localDir, |
|
|
const QString & |
remoteDir |
|
) |
| |
|
virtualslot |
Copy a local directory recursively to the remote system.
- Note
- The command is executed asynchronously, see requestComplete() or waitForCompletion() for results.
- See Also
- requestSent() requestCompleted() waitForCompeletion()
- Parameters
-
localDir | The path of the local directory. |
remoteDir | The path of the directory on the remote system. |
- Returns
- True on success, false on failure.
virtual bool copyDirFrom |
( |
const QString & |
remoteDir, |
|
|
const QString & |
localDir |
|
) |
| |
|
virtualslot |
Copy a remote directory recursively to the local system.
- Note
- The command is executed asynchronously, see requestComplete() or waitForCompletion() for results.
- See Also
- requestSent() requestCompleted() waitForCompeletion()
- Parameters
-
remoteDir | The path of the directory on the remote system. |
localFile | The path of the local directory. |
- Returns
- True on success, false on failure.
virtual void sendRequest |
( |
const QString & |
command, |
|
|
const QStringList & |
args |
|
) |
| |
|
protectedvirtual |
Send a request. This launches the process and connects the completion signals
void initializeProcess |
( |
| ) |
|
|
protected |
virtual QStringList sshArgs |
( |
| ) |
|
|
protectedpure virtual |
virtual QStringList scpArgs |
( |
| ) |
|
|
protectedpure virtual |
- Returns
- the remote specification, e.g. "user@host" or "host"
The documentation for this class was generated from the following file: