Package com.sshtools.client
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
ConstructorsConstructorDescriptionTransportProtocolClient
(SshClientContext sshContext, com.sshtools.synergy.nio.ConnectRequestFuture connectFuture) -
Method Summary
Modifier and TypeMethodDescriptionprotected 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
getName()
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
-
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 classcom.sshtools.synergy.ssh.TransportProtocol<SshClientContext>
-
onSocketRead
- Specified by:
onSocketRead
in interfacecom.sshtools.synergy.nio.ProtocolEngine
- Overrides:
onSocketRead
in classcom.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 classcom.sshtools.synergy.ssh.TransportProtocol<SshClientContext>
- Throws:
IOException
com.sshtools.common.ssh.SshException
-
onKeyExchangeInit
protected void onKeyExchangeInit()- Specified by:
onKeyExchangeInit
in classcom.sshtools.synergy.ssh.TransportProtocol<SshClientContext>
-
completeKeyExchange
protected void completeKeyExchange(com.sshtools.synergy.ssh.components.SshKeyExchange<SshClientContext> keyExchange) - Overrides:
completeKeyExchange
in classcom.sshtools.synergy.ssh.TransportProtocol<SshClientContext>
-
onNewKeysReceived
protected void onNewKeysReceived()- Specified by:
onNewKeysReceived
in classcom.sshtools.synergy.ssh.TransportProtocol<SshClientContext>
-
onNewKeysSent
protected void onNewKeysSent()- Specified by:
onNewKeysSent
in classcom.sshtools.synergy.ssh.TransportProtocol<SshClientContext>
-
selectNegotiatedComponent
- Overrides:
selectNegotiatedComponent
in classcom.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 classcom.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 classcom.sshtools.synergy.ssh.TransportProtocol<SshClientContext>
-
onConnected
protected void onConnected()- Specified by:
onConnected
in classcom.sshtools.synergy.ssh.TransportProtocol<SshClientContext>
-
onDisconnected
protected void onDisconnected()- Specified by:
onDisconnected
in classcom.sshtools.synergy.ssh.TransportProtocol<SshClientContext>
-
getName
-
getExtensionNegotiationString
- Specified by:
getExtensionNegotiationString
in classcom.sshtools.synergy.ssh.TransportProtocol<SshClientContext>
-
isExtensionNegotiationSupported
protected boolean isExtensionNegotiationSupported()- Specified by:
isExtensionNegotiationSupported
in classcom.sshtools.synergy.ssh.TransportProtocol<SshClientContext>
-