com.mindbright.ssh2
Class SSH2RetryingTCPChannel

java.lang.Object
  extended bycom.mindbright.ssh2.SSH2Channel
      extended bycom.mindbright.ssh2.SSH2StreamChannel
          extended bycom.mindbright.ssh2.SSH2TCPChannel
              extended bycom.mindbright.ssh2.SSH2RetryingTCPChannel

public class SSH2RetryingTCPChannel
extends SSH2TCPChannel

A subclass of SSH2TCPChannel which retries the open if it fails.


Field Summary
 
Fields inherited from class com.mindbright.ssh2.SSH2TCPChannel
endpoint, originAddr, originPort, remoteAddr, remotePort
 
Fields inherited from class com.mindbright.ssh2.SSH2StreamChannel
in, out, receiver, rxCounter, rxQueue, transmitter, txCounter
 
Fields inherited from class com.mindbright.ssh2.SSH2Channel
channelId, channelType, closeListeners, closeReceived, closeSent, connection, creator, deleted, eofReceived, eofSent, openMonitor, openStatus, peerChanId, rxCurrWinSz, rxInitWinSz, rxMaxPktSz, STATUS_CLOSED, STATUS_FAILED, STATUS_OPEN, STATUS_UNDEFINED, txCurrWinSz, txInitWinSz, txMaxPktSz
 
Constructor Summary
SSH2RetryingTCPChannel(int channelType, SSH2Connection connection, java.lang.Object creator, java.net.Socket endpoint, java.lang.String remoteAddr, int remotePort, java.lang.String originAddr, int originPort)
          Create a new retrying tcp channel of the given type.
 
Method Summary
protected  boolean openFailureImpl(int reasonCode, java.lang.String reasonText, java.lang.String langTag)
          Channel specific handling of open failures.
protected  void setRetries(int numOfRetries)
          Set number of retries to do.
 void setRetryDelay(long retryDelayTime)
          Set delay between retries.
 
Methods inherited from class com.mindbright.ssh2.SSH2TCPChannel
getAddress, getOriginAddress, getOriginPort, getPort, getRemoteAddress, getRemotePort, outputClosed, toString
 
Methods inherited from class com.mindbright.ssh2.SSH2StreamChannel
applyFilter, checkRxWindowSize, closeImpl, createStreams, data, eofImpl, handleRequestImpl, openConfirmationImpl, startStreams, waitUntilClosed, windowAdjustImpl
 
Methods inherited from class com.mindbright.ssh2.SSH2Channel
addCloseListener, close, extData, getChannelId, getConnection, getCreator, getPeerId, getType, handleRequest, init, openConfirmation, openFailure, openStatus, recvClose, recvEOF, removeCloseListener, requestFailure, requestSuccess, sendClose, sendEOF, transmit, windowAdjust
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SSH2RetryingTCPChannel

public SSH2RetryingTCPChannel(int channelType,
                              SSH2Connection connection,
                              java.lang.Object creator,
                              java.net.Socket endpoint,
                              java.lang.String remoteAddr,
                              int remotePort,
                              java.lang.String originAddr,
                              int originPort)
                       throws java.io.IOException
Create a new retrying tcp channel of the given type. The channel is associated with an ssh connection. Channel types are defined in SSH2Connection and starts with CH_TYPE.

Parameters:
channelType - Type of channel to create.
connection - The ssh connection to associate the channel with.
creator - The object the channel is created from.
endpoint - Socket the channel is connected to at the local end.
remoteAddr - Remote server to connect to.
remotePort - Remote port to connect to.
originAddr - Originating host of local connection.
originPort - Originating port of local connection.
Method Detail

setRetries

protected void setRetries(int numOfRetries)
Set number of retries to do.

Parameters:
numOfRetries - Number of retries.

setRetryDelay

public void setRetryDelay(long retryDelayTime)
Set delay between retries.

Parameters:
retryDelayTime - Delay in seconds.

openFailureImpl

protected boolean openFailureImpl(int reasonCode,
                                  java.lang.String reasonText,
                                  java.lang.String langTag)
Description copied from class: SSH2Channel
Channel specific handling of open failures.

Overrides:
openFailureImpl in class SSH2TCPChannel