|
||||||||||
| 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(java.lang.String host,
java.lang.String user,
java.lang.String pass)
Constructor receives hostname, user and password |
|
SSHSession(java.lang.String hostname,
java.lang.String username,
java.lang.String password,
int port)
|
|
| Method Summary | |
|---|---|
void |
close()
Closes session |
void |
connect()
initializes the SSH session |
boolean |
detectDir(java.lang.String remoteDir)
Detect directory on the host host by using SFTP |
boolean |
detectFile(java.lang.String remoteFile)
Detect file on the host host by using SFTP |
boolean |
detectFile(java.lang.String filename,
long timeoutMillis)
Detects the existence of the remote file. |
java.lang.String |
executeAndGetResult(java.lang.String command)
|
java.lang.String |
executeAndGetResult(java.lang.String command,
long timeout)
Execute a command on the host node |
void |
executeCmd(java.lang.String command)
Execute a command on the host node |
int |
getPort()
Gets SSH port |
java.lang.String |
getRemoteHost()
Returns the server hostname |
java.lang.String |
getUsername()
Returns the username. |
com.sshtools.j2ssh.session.SessionChannelClient |
openChannel(java.lang.String type)
open a session channel for command execution |
java.lang.String[] |
resolvePaths(java.lang.String[] relativePaths,
boolean createDirs)
Resolves a set of given paths on the remote machine. |
boolean |
scpFrom(java.lang.String remoteFile,
java.lang.String localFile)
Copy a file from host node using SSH/SCP |
boolean |
scpFrom(java.lang.String remoteFile,
java.lang.String localFile,
int tries)
Copies a file from a host node by using SCP. |
boolean |
scpTo(java.io.InputStream stream,
long size,
java.lang.String localFile,
java.lang.String remoteFile)
Send a file to host node by SCP |
boolean |
scpTo(java.lang.String localFile,
java.lang.String remoteFile)
Send a file to host node by SCP |
void |
setTimeout(int milliseconds)
Sets connection timeout |
boolean |
sFtpFrom(java.lang.String remoteFile,
java.lang.String localFile)
Copies a file from a host host by using SFTP. |
boolean |
sFtpFrom(java.lang.String remoteFile,
java.lang.String localFile,
int tries)
Copies a file from a host host by using SFTP. |
boolean |
sFtpTo(java.lang.String localFile,
java.lang.String remoteFile)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SSHSession(java.lang.String host,
java.lang.String user,
java.lang.String pass)
host - user - pass -
public SSHSession(java.lang.String hostname,
java.lang.String username,
java.lang.String password,
int port)
hostname - username - password - port - | Method Detail |
|---|
public java.lang.String getUsername()
public int getPort()
public java.lang.String getRemoteHost()
public void setTimeout(int milliseconds)
milliseconds -
public void connect()
throws java.lang.Exception
java.lang.Exception
public com.sshtools.j2ssh.session.SessionChannelClient openChannel(java.lang.String type)
throws java.lang.Exception
type -
java.lang.Exception
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)
throws java.lang.Exception
remoteFile - Remote file namelocalFile - Local file nametries - Number of tries to check if the host file exist on the host host.
Each second an attempt to check the file on the host node is done.
java.lang.Exception
public boolean sFtpFrom(java.lang.String remoteFile,
java.lang.String localFile)
throws java.lang.Exception
remoteFile - Remote file namelocalFile - Local file name
java.lang.Exception
public boolean detectFile(java.lang.String remoteFile)
throws java.lang.Exception
remoteFile - Remote file name
java.lang.Exception
public java.lang.String[] resolvePaths(java.lang.String[] relativePaths,
boolean createDirs)
throws java.lang.Exception
relativePaths - createDirs -
java.lang.Exception
public boolean detectDir(java.lang.String remoteDir)
throws java.lang.Exception
remoteDir - Remote directory name
java.lang.Exception
public boolean detectFile(java.lang.String filename,
long timeoutMillis)
filename - timeoutMillis -
public java.lang.String executeAndGetResult(java.lang.String command)
throws java.lang.Exception
command -
java.lang.Exception
public java.lang.String executeAndGetResult(java.lang.String command,
long timeout)
throws java.lang.Exception
command -
java.lang.Exception
public void executeCmd(java.lang.String command)
throws java.lang.Exception
command -
java.lang.Exceptionpublic void close()
|
Copyright © The University of Melbourne. 2006 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||