|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.gridbus.broker.util.SSHSession
public class SSHSession
| Constructor Summary | |
|---|---|
SSHSession()
The SSHSession is a utility class for managing SSH sessions. |
|
SSHSession(java.lang.String host,
java.lang.String user,
java.lang.String pass)
Constructor receives hostname, user and password |
|
| Method Summary | |
|---|---|
void |
close()
Closes session |
boolean |
connect()
initializes the SSH session |
boolean |
detectFile(java.lang.String remoteFile)
Detect file on the remote host by using SFTP |
java.io.InputStream |
executeAndGetResult(java.lang.String command)
Execute a command on the remote node |
void |
executeCmd(java.lang.String command)
Execute a command on the remote node |
java.lang.String |
getPassword()
Returns SSH password |
int |
getPort()
Sets SSH port |
java.lang.String |
getRemoteHost()
Returns client hostname |
java.lang.String |
getUsername()
Returns the processor speed. |
static void |
main(java.lang.String[] args)
|
com.sshtools.j2ssh.session.SessionChannelClient |
openChannel(java.lang.String type)
open a session channel for command execution |
com.sshtools.j2ssh.SftpClient |
openSftpClient()
Creates a SftpClient for file transmission |
void |
P()
|
boolean |
scpFrom(java.lang.String remoteFile,
java.lang.String localFile)
Copy a file from remote node using SSH/SCP |
boolean |
scpFrom(java.lang.String remoteFile,
java.lang.String localFile,
int tries)
Copies a file from a remote node by using SCP. |
boolean |
scpTo(java.io.InputStream stream,
long size,
java.lang.String localFile,
java.lang.String remoteFile)
Send a file to remote node by SCP |
boolean |
scpTo(java.lang.String localFile,
java.lang.String remoteFile)
Send a file to remote node by SCP |
void |
setPassword(java.lang.String pass)
Sets the password used to establish a ssh session with a Xgrid client. |
void |
setPort(int port)
Sets SSH port |
void |
setRemoteHost(java.lang.String host)
Sets client hostname |
void |
setTimeout(int time)
Sets timeout |
void |
setUsername(java.lang.String user)
Sets the username used to establish a ssh session with a Xgrid client. |
boolean |
sFtpFrom(java.lang.String remoteFile,
java.lang.String localFile)
Copies a file from a remote host by using SFTP. |
boolean |
sFtpFrom(java.lang.String remoteFile,
java.lang.String localFile,
int tries)
Copies a file from a remote host by using SFTP. |
boolean |
sFtpTo(java.lang.String localFile,
java.lang.String remoteFile)
|
void |
V()
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SSHSession()
public SSHSession(java.lang.String host,
java.lang.String user,
java.lang.String pass)
host - user - pass - | Method Detail |
|---|
public java.lang.String getUsername()
public void setUsername(java.lang.String user)
user - public void setPassword(java.lang.String pass)
pass - public java.lang.String getPassword()
public void setPort(int port)
port - public int getPort()
public void setRemoteHost(java.lang.String host)
host - public java.lang.String getRemoteHost()
public void setTimeout(int time)
time - public void P()
public void V()
public boolean connect()
public com.sshtools.j2ssh.session.SessionChannelClient openChannel(java.lang.String type)
type -
public com.sshtools.j2ssh.SftpClient openSftpClient()
public boolean scpTo(java.lang.String localFile,
java.lang.String remoteFile)
remoteFile - localFile -
public boolean scpTo(java.io.InputStream stream,
long size,
java.lang.String localFile,
java.lang.String remoteFile)
stream - size - localFile - remoteFile -
public boolean scpFrom(java.lang.String remoteFile,
java.lang.String localFile,
int tries)
remoteFile - localFile - tries -
public boolean scpFrom(java.lang.String remoteFile,
java.lang.String localFile)
localFile - remoteFile -
public boolean sFtpTo(java.lang.String localFile,
java.lang.String remoteFile)
localFile - remoteFile -
public boolean sFtpFrom(java.lang.String remoteFile,
java.lang.String localFile,
int tries)
remoteFile - Remote file namelocalFile - Local file nametries - Number of tries to check if the remote file exist on the remote host.
Each second an attempt to check the file on the remote node is done.
public boolean sFtpFrom(java.lang.String remoteFile,
java.lang.String localFile)
remoteFile - Remote file namelocalFile - Local file name
public boolean detectFile(java.lang.String remoteFile)
remoteFile - Remote file name
public java.io.InputStream executeAndGetResult(java.lang.String command)
command -
public void executeCmd(java.lang.String command)
command - public void close()
public static final void main(java.lang.String[] args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||