| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.tools.ant.taskdefs.optional.ssh.AbstractSshMessage
public abstract class AbstractSshMessage
Abstract class for ssh upload and download
| Constructor Summary | |
|---|---|
| AbstractSshMessage(boolean verbose,
                   com.jcraft.jsch.Session session)Constructor for AbstractSshMessage | |
| AbstractSshMessage(com.jcraft.jsch.Session session)Constructor for AbstractSshMessage | |
| Method Summary | |
|---|---|
| abstract  void | execute()Carry out the transfer. | 
| protected  com.jcraft.jsch.SftpProgressMonitor | getProgressMonitor()Get the progress monitor. | 
| protected  boolean | getVerbose()Is the verbose attribute set. | 
| protected  void | log(java.lang.String message)Log a message to the log listener. | 
| protected  void | logStats(long timeStarted,
         long timeEnded,
         long totalLength)Log transfer stats to the log listener. | 
| protected  com.jcraft.jsch.Channel | openExecChannel(java.lang.String command)Open an ssh channel. | 
| protected  com.jcraft.jsch.ChannelSftp | openSftpChannel()Open an ssh sftp channel. | 
| protected  void | sendAck(java.io.OutputStream out)Send an ack. | 
|  void | setLogListener(LogListener aListener)Set a log listener. | 
| protected  int | trackProgress(long filesize,
              long totalLength,
              int percentTransmitted)Track progress every 10% if 100kb < filesize < 1mb. | 
| protected  void | waitForAck(java.io.InputStream in)Reads the response, throws a BuildException if the response indicates an error. | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
|---|
public AbstractSshMessage(com.jcraft.jsch.Session session)
session - the ssh session to use
public AbstractSshMessage(boolean verbose,
                          com.jcraft.jsch.Session session)
verbose - if true do verbose loggingsession - the ssh session to use| Method Detail | 
|---|
protected com.jcraft.jsch.Channel openExecChannel(java.lang.String command)
                                           throws com.jcraft.jsch.JSchException
command - the command to use
com.jcraft.jsch.JSchException - on error
protected com.jcraft.jsch.ChannelSftp openSftpChannel()
                                               throws com.jcraft.jsch.JSchException
com.jcraft.jsch.JSchException - on error
protected void sendAck(java.io.OutputStream out)
                throws java.io.IOException
out - the output stream to use
java.io.IOException - on error
protected void waitForAck(java.io.InputStream in)
                   throws java.io.IOException,
                          BuildException
in - the input stream to use
java.io.IOException - on I/O error
BuildException - on other errors
public abstract void execute()
                      throws java.io.IOException,
                             com.jcraft.jsch.JSchException
java.io.IOException - on I/O errors
com.jcraft.jsch.JSchException - on ssh errorspublic void setLogListener(LogListener aListener)
aListener - the log listenerprotected void log(java.lang.String message)
message - the message to log
protected void logStats(long timeStarted,
                        long timeEnded,
                        long totalLength)
timeStarted - the time startedtimeEnded - the finishing timetotalLength - the total lengthprotected final boolean getVerbose()
protected final int trackProgress(long filesize,
                                  long totalLength,
                                  int percentTransmitted)
filesize - the size of the file been transmittedtotalLength - the total transmission sizepercentTransmitted - the current percent transmitted
protected com.jcraft.jsch.SftpProgressMonitor getProgressMonitor()
| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||