Class TransportProtocolClient

java.lang.Object
com.sshtools.common.ssh.ExecutorOperationSupport<com.sshtools.synergy.ssh.SshContext>
com.sshtools.synergy.ssh.TransportProtocol<SshClientContext>
com.sshtools.client.TransportProtocolClient
All Implemented Interfaces:
com.sshtools.common.nio.IdleStateListener, com.sshtools.synergy.nio.ProtocolEngine, com.sshtools.synergy.ssh.SshTransport<SshClientContext>

public class TransportProtocolClient extends com.sshtools.synergy.ssh.TransportProtocol<SshClientContext>
The implementation of the client side of the SSH transport protocol.
  • Field Summary

    Fields inherited from class com.sshtools.synergy.ssh.TransportProtocol

    activeService, AUTH_CANCELLED_BY_USER, BY_APPLICATION, CHARSET_ENCODING, cipherCS, cipherSC, completedFirstKeyExchange, COMPRESSION_ERROR, compressionCS, compressionSC, con, CONNECTED, CONNECTION_LOST, DISCONNECTED, disconnectStarted, enableExtensionCapability, hasExtensionCapability, HOST_KEY_NOT_VERIFIABLE, HOST_NOT_ALLOWED, hostKey, ILLEGAL_USER_NAME, KEY_EXCHANGE_FAILED, keyExchangeAlgorithm, localIdentification, localkex, lock, MAC_ERROR, macCS, macSC, NEGOTIATING_PROTOCOL, NO_MORE_AUTH_METHODS_AVAILABLE, PERFORMING_KEYEXCHANGE, PROTOCOL_ERROR, PROTOCOL_VERSION_NOT_SUPPORTED, publicKey, receivedRemoteIdentification, remoteIdentification, remotekex, RESERVED, sentLocalIdentification, SERVICE_NOT_AVAILABLE, sessionIdentifier, socketConnection, SSH_MSG_EXT_INFO, SSH_MSG_SERVICE_ACCEPT, SSH_MSG_SERVICE_REQUEST, sshContext, TOO_MANY_CONNECTIONS, uuid

    Fields inherited from class com.sshtools.common.ssh.ExecutorOperationSupport

    CALLBACKS, EVENTS, MESSAGES_INCOMING, MESSAGES_OUTGOING
  • Constructor Summary

    Constructors
    Constructor
    Description
    TransportProtocolClient(SshClientContext sshContext, com.sshtools.synergy.nio.ConnectRequestFuture connectFuture)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected boolean
    canConnect(com.sshtools.synergy.nio.SocketConnection connection)
     
    protected void
    completeKeyExchange(com.sshtools.synergy.ssh.components.SshKeyExchange<SshClientContext> keyExchange)
     
    protected void
     
    com.sshtools.synergy.ssh.Service
     
    protected String
     
     
    protected void
    initializeKeyExchange(com.sshtools.synergy.ssh.components.SshKeyExchange<SshClientContext> keyExchange, boolean firstPacketFollows, boolean useFirstPacket)
     
    protected boolean
     
    protected void
     
    protected void
     
    protected void
     
    protected void
     
    protected void
     
    boolean
    onSocketRead(ByteBuffer incomingData)
     
    protected boolean
    processTransportMessage(int msgid, byte[] msg)
     
    protected String
    selectNegotiatedComponent(String remotelist, String locallist)
     
    void
    setActiveService(com.sshtools.synergy.ssh.Service service)
     
    void
    startService(com.sshtools.synergy.ssh.Service service)
     

    Methods inherited from class com.sshtools.synergy.ssh.TransportProtocol

    addEventListener, canSendKeyExchangeInit, disconnect, generateNewKeysClientIn, generateNewKeysClientOut, generateNewKeysServerIn, generateNewKeysServerOut, getAuthenticatedFuture, getBytes, getCipherCS, getCipherSC, getCompressionCS, getCompressionSC, getConnectFuture, getConnection, getContext, getDisconnectFuture, getExecutor, getHostKey, getHostKeyAlgorithm, getHostKeyInUse, getKeyExchangeAlgorithm, getKeyExchangeInUse, getLocalAddress, getLocalIdentification, getLocalPort, getMacCS, getMacSC, getQueueSizes, getRemoteAddress, getRemoteCiphersCS, getRemoteCiphersSC, getRemoteCompressionsCS, getRemoteCompressionsSC, getRemoteIdentification, getRemoteKeyExchanges, getRemoteMacsCS, getRemoteMacsSC, getRemotePort, getRemotePublicKeys, getRND, getSessionKey, getSocketConnection, getSshContext, getState, getUUID, hasCompletedKeyExchange, idle, isConnected, isDisonnecting, isSelectorThread, keyExchangeInitialized, kill, onKeyExchangeComplete, onRemoteIdentificationReceived, onSocketClose, onSocketConnect, onSocketWrite, postMessage, postMessage, processMessage, processNegotiationString, registerIdleStateListener, removeIdleStateListener, resetIdleState, sendNewKeys, startBinaryProtocol, transferState, wantsToWrite

    Methods inherited from class com.sshtools.common.ssh.ExecutorOperationSupport

    addIncomingTask, addOutgoingTask, addTask, cleanupOperations

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TransportProtocolClient

      public TransportProtocolClient(SshClientContext sshContext, com.sshtools.synergy.nio.ConnectRequestFuture connectFuture) throws com.sshtools.synergy.nio.LicenseException
      Throws:
      com.sshtools.synergy.nio.LicenseException
  • Method Details

    • canConnect

      protected boolean canConnect(com.sshtools.synergy.nio.SocketConnection connection)
      Specified by:
      canConnect in class com.sshtools.synergy.ssh.TransportProtocol<SshClientContext>
    • onSocketRead

      public boolean onSocketRead(ByteBuffer incomingData)
      Specified by:
      onSocketRead in interface com.sshtools.synergy.nio.ProtocolEngine
      Overrides:
      onSocketRead in class com.sshtools.synergy.ssh.TransportProtocol<SshClientContext>
    • initializeKeyExchange

      protected void initializeKeyExchange(com.sshtools.synergy.ssh.components.SshKeyExchange<SshClientContext> keyExchange, boolean firstPacketFollows, boolean useFirstPacket) throws IOException, com.sshtools.common.ssh.SshException
      Specified by:
      initializeKeyExchange in class com.sshtools.synergy.ssh.TransportProtocol<SshClientContext>
      Throws:
      IOException
      com.sshtools.common.ssh.SshException
    • onKeyExchangeInit

      protected void onKeyExchangeInit()
      Specified by:
      onKeyExchangeInit in class com.sshtools.synergy.ssh.TransportProtocol<SshClientContext>
    • completeKeyExchange

      protected void completeKeyExchange(com.sshtools.synergy.ssh.components.SshKeyExchange<SshClientContext> keyExchange)
      Overrides:
      completeKeyExchange in class com.sshtools.synergy.ssh.TransportProtocol<SshClientContext>
    • onNewKeysReceived

      protected void onNewKeysReceived()
      Specified by:
      onNewKeysReceived in class com.sshtools.synergy.ssh.TransportProtocol<SshClientContext>
    • onNewKeysSent

      protected void onNewKeysSent()
      Specified by:
      onNewKeysSent in class com.sshtools.synergy.ssh.TransportProtocol<SshClientContext>
    • selectNegotiatedComponent

      protected String selectNegotiatedComponent(String remotelist, String locallist) throws IOException
      Overrides:
      selectNegotiatedComponent in class com.sshtools.synergy.ssh.TransportProtocol<SshClientContext>
      Throws:
      IOException
    • processTransportMessage

      protected boolean processTransportMessage(int msgid, byte[] msg) throws IOException, com.sshtools.common.ssh.SshException
      Specified by:
      processTransportMessage in class com.sshtools.synergy.ssh.TransportProtocol<SshClientContext>
      Throws:
      IOException
      com.sshtools.common.ssh.SshException
    • setActiveService

      public void setActiveService(com.sshtools.synergy.ssh.Service service)
    • getActiveService

      public com.sshtools.synergy.ssh.Service getActiveService()
    • startService

      public void startService(com.sshtools.synergy.ssh.Service service)
    • disconnected

      protected void disconnected()
      Specified by:
      disconnected in class com.sshtools.synergy.ssh.TransportProtocol<SshClientContext>
    • onConnected

      protected void onConnected()
      Specified by:
      onConnected in class com.sshtools.synergy.ssh.TransportProtocol<SshClientContext>
    • onDisconnected

      protected void onDisconnected()
      Specified by:
      onDisconnected in class com.sshtools.synergy.ssh.TransportProtocol<SshClientContext>
    • getName

      public String getName()
    • getExtensionNegotiationString

      protected String getExtensionNegotiationString()
      Specified by:
      getExtensionNegotiationString in class com.sshtools.synergy.ssh.TransportProtocol<SshClientContext>
    • isExtensionNegotiationSupported

      protected boolean isExtensionNegotiationSupported()
      Specified by:
      isExtensionNegotiationSupported in class com.sshtools.synergy.ssh.TransportProtocol<SshClientContext>