Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sshtools.j2ssh.transport
Class TransportProtocolCommon

    java.lang.Object
      com.sshtools.j2ssh.transport.TransportProtocolCommon

All Implemented Interfaces:
  java.lang.Runnable, TransportProtocol

Direct Known Subclasses:
  TransportProtocolClient, TransportProtocolServer

public abstract class TransportProtocolCommon
extends java.lang.Object
implements TransportProtocol, java.lang.Runnable

DOCUMENT ME!

Field Summary
`protected TransportProtocolAlgorithmSync` | `algorithmsIn` DOCUMENT ME!
`protected TransportProtocolAlgorithmSync` | `algorithmsOut` DOCUMENT ME!
`protected java.lang.String` | `clientIdent` DOCUMENT ME!
`protected SshMsgKexInit` | `clientKexInit` DOCUMENT ME!
`protected java.lang.Boolean` | `completeOnNewKeys` DOCUMENT ME!
`static int` | `EOL_CRLF` DOCUMENT ME!
`static int` | `EOL_LF` DOCUMENT ME!
`protected byte[]` | `hostKey` DOCUMENT ME!
`protected HostKeyVerification` | `hosts` DOCUMENT ME!
`protected java.math.BigInteger` | `k` DOCUMENT ME!
`protected java.util.Map` | `kexs` DOCUMENT ME!
`protected static org.apache.commons.logging.Log` | `log` DOCUMENT ME!
`protected SshMessageStore` | `messageStore` DOCUMENT ME!
`protected SshConnectionProperties` | `properties` DOCUMENT ME!
`static java.lang.String` | `PROTOCOL_VERSION` DOCUMENT ME!
`protected java.lang.String` | `serverIdent` DOCUMENT ME!
`protected SshMsgKexInit` | `serverKexInit` DOCUMENT ME!
`protected byte[]` | `sessionIdentifier` DOCUMENT ME!
`protected byte[]` | `signature` DOCUMENT ME!
`static java.lang.String` | `SOFTWARE_VERSION_COMMENTS` DOCUMENT ME!
`protected com.sshtools.j2ssh.transport.TransportProtocolInputStream` | `sshIn` DOCUMENT ME!
`protected com.sshtools.j2ssh.transport.TransportProtocolOutputStream` | `sshOut` DOCUMENT ME!
`protected TransportProtocolState` | `state` DOCUMENT ME!

Constructor Summary
`TransportProtocolCommon()` Creates a new TransportProtocolCommon object.

Method Summary
`void` | `addEventHandler(TransportProtocolEventHandler eventHandler)` DOCUMENT ME!
`void` | `addMessageStore(SshMessageStore store)` DOCUMENT ME!
`protected void` | `beginKeyExchange()` DOCUMENT ME!
`protected void` | `completeKeyExchange()` DOCUMENT ME!
`protected SshMsgKexInit` | `createLocalKexInit()` DOCUMENT ME!
`protected java.lang.String` | `determineAlgorithm(java.util.List clientAlgorithms, java.util.List serverAlgorithms)` DOCUMENT ME!
`void` | `disconnect(java.lang.String description)` DOCUMENT ME!
`int` | `getConnectionId()` DOCUMENT ME!
`protected abstract java.lang.String` | `getDecryptionAlgorithm()` DOCUMENT ME!
`protected abstract java.lang.String` | `getEncryptionAlgorithm()` DOCUMENT ME!
`protected java.util.List` | `getEventHandlers()` DOCUMENT ME!
`long` | `getIncomingByteCount()` DOCUMENT ME!
`protected abstract java.lang.String` | `getInputStreamCompAlgortihm()` DOCUMENT ME!
`protected abstract java.lang.String` | `getInputStreamMacAlgorithm()` DOCUMENT ME!
`protected java.lang.String` | `getKexAlgorithm()` DOCUMENT ME!
`abstract java.lang.String` | `getLocalId()` DOCUMENT ME!
`protected abstract SshMsgKexInit` | `getLocalKexInit()` DOCUMENT ME!
`long` | `getOutgoingByteCount()`
`protected abstract java.lang.String` | `getOutputStreamCompAlgorithm()` DOCUMENT ME!
`protected abstract java.lang.String` | `getOutputStreamMacAlgorithm()` DOCUMENT ME!
`SshConnectionProperties` | `getProperties()` DOCUMENT ME!
`int` | `getRemoteEOL()` DOCUMENT ME!
`abstract java.lang.String` | `getRemoteId()` DOCUMENT ME!
`protected abstract SshMsgKexInit` | `getRemoteKexInit()` DOCUMENT ME!
`byte[]` | `getSessionIdentifier()` DOCUMENT ME!
`TransportProtocolState` | `getState()` DOCUMENT ME!
`java.lang.String` | `getUnderlyingProviderDetail()` DOCUMENT ME!
`protected void` | `onCorruptMac()` DOCUMENT ME!
`protected abstract void` | `onDisconnect()` DOCUMENT ME!
`protected abstract void` | `onMessageReceived(SshMessage msg)` DOCUMENT ME!
`protected abstract void` | `onStartTransportProtocol()` DOCUMENT ME!
`protected abstract void` | `performKeyExchange(SshKeyExchange kex)` DOCUMENT ME!
`protected SshMessage` | `processMessages()` DOCUMENT ME!
`SshMessage` | `readMessage(int[] filter)` DOCUMENT ME!
`abstract void` | `registerTransportMessages()` DOCUMENT ME!
`void` | `removeMessageStore(SshMessageStore ms)` DOCUMENT ME!
`void` | `run()` DOCUMENT ME!
`protected void` | `sendDisconnect(int reason, java.lang.String description)` DOCUMENT ME!
`protected void` | `sendDisconnect(int reason, java.lang.String description, java.io.IOException error)` DOCUMENT ME!
`protected void` | `sendKeyExchangeInit()` DOCUMENT ME!
`void` | `sendMessage(SshMessage msg, java.lang.Object sender)` DOCUMENT ME!
`protected void` | `sendNewKeys()` DOCUMENT ME!
`void` | `setKexTimeout(long seconds)` DOCUMENT ME!
`void` | `setKexTransferLimit(long kilobytes)` DOCUMENT ME!
`protected abstract void` | `setLocalIdent()` DOCUMENT ME!
`protected abstract void` | `setLocalKexInit(SshMsgKexInit msg)` DOCUMENT ME!
`protected abstract void` | `setRemoteIdent(java.lang.String ident)` DOCUMENT ME!
`protected abstract void` | `setRemoteKexInit(SshMsgKexInit msg)` DOCUMENT ME!
`void` | `setSendIgnore(boolean sendIgnore)` DOCUMENT ME!
`protected abstract void` | `setupNewKeys(byte[] encryptCSKey, byte[] encryptCSIV, byte[] encryptSCKey, byte[] encryptSCIV, byte[] macCSKey, byte[] macSCKey)` DOCUMENT ME!
`protected void` | `startBinaryPacketProtocol()` DOCUMENT ME!
`void` | `startTransportProtocol(TransportProvider provider, SshConnectionProperties properties)` DOCUMENT ME!
`protected void` | `stop()` DOCUMENT ME!
`void` | `unregisterMessage(java.lang.Integer messageId, SshMessageStore store)` DOCUMENT ME!

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### log

    protected static org.apache.commons.logging.Log log

  DOCUMENT ME!

### EOL_CRLF

    public static final int EOL_CRLF

  DOCUMENT ME!

  See Also:
    Constant Field Values

### EOL_LF

    public static final int EOL_LF

  DOCUMENT ME!

  See Also:
    Constant Field Values

### PROTOCOL_VERSION

    public static final java.lang.String PROTOCOL_VERSION

  DOCUMENT ME!

  See Also:
    Constant Field Values

### SOFTWARE_VERSION_COMMENTS

    public static java.lang.String SOFTWARE_VERSION_COMMENTS

  DOCUMENT ME!

### k

    protected java.math.BigInteger k

  DOCUMENT ME!

### completeOnNewKeys

    protected java.lang.Boolean completeOnNewKeys

  DOCUMENT ME!

### hosts

    protected HostKeyVerification hosts

  DOCUMENT ME!

### kexs

    protected java.util.Map kexs

  DOCUMENT ME!

### properties

    protected SshConnectionProperties properties

  DOCUMENT ME!

### messageStore

    protected SshMessageStore messageStore

  DOCUMENT ME!

### clientKexInit

    protected SshMsgKexInit clientKexInit

  DOCUMENT ME!

### serverKexInit

    protected SshMsgKexInit serverKexInit

  DOCUMENT ME!

### clientIdent

    protected java.lang.String clientIdent

  DOCUMENT ME!

### serverIdent

    protected java.lang.String serverIdent

  DOCUMENT ME!

### algorithmsIn

    protected TransportProtocolAlgorithmSync algorithmsIn

  DOCUMENT ME!

### algorithmsOut

    protected TransportProtocolAlgorithmSync algorithmsOut

  DOCUMENT ME!

### state

    protected TransportProtocolState state

  DOCUMENT ME!

### sessionIdentifier

    protected byte[] sessionIdentifier

  DOCUMENT ME!

### hostKey

    protected byte[] hostKey

  DOCUMENT ME!

### signature

    protected byte[] signature

  DOCUMENT ME!

### sshIn

    protected com.sshtools.j2ssh.transport.TransportProtocolInputStream sshIn

  DOCUMENT ME!

### sshOut

    protected com.sshtools.j2ssh.transport.TransportProtocolOutputStream sshOut

  DOCUMENT ME!

Constructor Detail

### TransportProtocolCommon

    public TransportProtocolCommon()

  Creates a new TransportProtocolCommon object.

Method Detail

### getConnectionId

    public int getConnectionId()

  DOCUMENT ME!

  Specified by:
    `getConnectionId` in interface `TransportProtocol`
  Returns:
    DOCUMENT ME!

### getRemoteEOL

    public int getRemoteEOL()

  DOCUMENT ME!

  Returns:
    DOCUMENT ME!

### getState

    public TransportProtocolState getState()

  DOCUMENT ME!

  Specified by:
    `getState` in interface `TransportProtocol`
  Returns:
    DOCUMENT ME!

### getProperties

    public SshConnectionProperties getProperties()

  DOCUMENT ME!

  Returns:
    DOCUMENT ME!

### onDisconnect

    protected abstract void onDisconnect()

  DOCUMENT ME!

### disconnect

    public void disconnect(java.lang.String description)

  DOCUMENT ME!

  Specified by:
    `disconnect` in interface `TransportProtocol`
  Parameters:
    `description` - DOCUMENT ME!

### setSendIgnore

    public void setSendIgnore(boolean sendIgnore)

  DOCUMENT ME!

  Parameters:
    `sendIgnore` - DOCUMENT ME!

### setKexTimeout

    public void setKexTimeout(long seconds)
                       throws TransportProtocolException

  DOCUMENT ME!

  Parameters:
    `seconds` - DOCUMENT ME!
  Throws:
    `TransportProtocolException` - DOCUMENT ME!

### setKexTransferLimit

    public void setKexTransferLimit(long kilobytes)
                             throws TransportProtocolException

  DOCUMENT ME!

  Parameters:
    `kilobytes` - DOCUMENT ME!
  Throws:
    `TransportProtocolException` - DOCUMENT ME!

### getOutgoingByteCount

    public long getOutgoingByteCount()

### getIncomingByteCount

    public long getIncomingByteCount()

  DOCUMENT ME!

  Returns:
    DOCUMENT ME!

### addEventHandler

    public void addEventHandler(TransportProtocolEventHandler eventHandler)

  DOCUMENT ME!

  Parameters:
    `eventHandler` - DOCUMENT ME!

### registerTransportMessages

    public abstract void registerTransportMessages()
                                            throws MessageAlreadyRegisteredException

  DOCUMENT ME!

  Throws:
    `MessageAlreadyRegisteredException` - DOCUMENT ME!

### getSessionIdentifier

    public byte[] getSessionIdentifier()

  DOCUMENT ME!

  Specified by:
    `getSessionIdentifier` in interface `TransportProtocol`
  Returns:
    DOCUMENT ME!

### run

    public void run()

  DOCUMENT ME!

  Specified by:
    `run` in interface `java.lang.Runnable`

### sendMessage

    public void sendMessage(SshMessage msg,
                            java.lang.Object sender)
                     throws java.io.IOException

  DOCUMENT ME!

  Specified by:
    `sendMessage` in interface `TransportProtocol`
  Parameters:
    `msg` - DOCUMENT ME!
    `sender` - DOCUMENT ME!
  Throws:
    `java.io.IOException` - DOCUMENT ME!
    `TransportProtocolException` - DOCUMENT ME!

### onStartTransportProtocol

    protected abstract void onStartTransportProtocol()
                                              throws java.io.IOException

  DOCUMENT ME!

  Throws:
    `java.io.IOException` - DOCUMENT ME!

### startTransportProtocol

    public void startTransportProtocol(TransportProvider provider,
                                       SshConnectionProperties properties)
                                throws java.io.IOException

  DOCUMENT ME!

  Parameters:
    `provider` - DOCUMENT ME!
    `properties` - DOCUMENT ME!
  Throws:
    `java.io.IOException` - DOCUMENT ME!

### getUnderlyingProviderDetail

    public java.lang.String getUnderlyingProviderDetail()

  DOCUMENT ME!

  Specified by:
    `getUnderlyingProviderDetail` in interface `TransportProtocol`
  Returns:
    DOCUMENT ME!

### unregisterMessage

    public void unregisterMessage(java.lang.Integer messageId,
                                  SshMessageStore store)
                           throws MessageNotRegisteredException

  DOCUMENT ME!

  Parameters:
    `messageId` - DOCUMENT ME!
    `store` - DOCUMENT ME!
  Throws:
    `MessageNotRegisteredException` - DOCUMENT ME!

### getDecryptionAlgorithm

    protected abstract java.lang.String getDecryptionAlgorithm()
                                                        throws AlgorithmNotAgreedException

  DOCUMENT ME!

  Returns:
    DOCUMENT ME!
  Throws:
    `AlgorithmNotAgreedException` - DOCUMENT ME!

### getEncryptionAlgorithm

    protected abstract java.lang.String getEncryptionAlgorithm()
                                                        throws AlgorithmNotAgreedException

  DOCUMENT ME!

  Returns:
    DOCUMENT ME!
  Throws:
    `AlgorithmNotAgreedException` - DOCUMENT ME!

### getInputStreamCompAlgortihm

    protected abstract java.lang.String getInputStreamCompAlgortihm()
                                                             throws AlgorithmNotAgreedException

  DOCUMENT ME!

  Returns:
    DOCUMENT ME!
  Throws:
    `AlgorithmNotAgreedException` - DOCUMENT ME!

### getInputStreamMacAlgorithm

    protected abstract java.lang.String getInputStreamMacAlgorithm()
                                                            throws AlgorithmNotAgreedException

  DOCUMENT ME!

  Returns:
    DOCUMENT ME!
  Throws:
    `AlgorithmNotAgreedException` - DOCUMENT ME!

### setLocalIdent

    protected abstract void setLocalIdent()

  DOCUMENT ME!

### getLocalId

    public abstract java.lang.String getLocalId()

  DOCUMENT ME!

  Returns:
    DOCUMENT ME!

### setLocalKexInit

    protected abstract void setLocalKexInit(SshMsgKexInit msg)

  DOCUMENT ME!

  Parameters:
    `msg` - DOCUMENT ME!

### getLocalKexInit

    protected abstract SshMsgKexInit getLocalKexInit()

  DOCUMENT ME!

  Returns:
    DOCUMENT ME!

### getOutputStreamCompAlgorithm

    protected abstract java.lang.String getOutputStreamCompAlgorithm()
                                                              throws AlgorithmNotAgreedException

  DOCUMENT ME!

  Returns:
    DOCUMENT ME!
  Throws:
    `AlgorithmNotAgreedException` - DOCUMENT ME!

### getOutputStreamMacAlgorithm

    protected abstract java.lang.String getOutputStreamMacAlgorithm()
                                                             throws AlgorithmNotAgreedException

  DOCUMENT ME!

  Returns:
    DOCUMENT ME!
  Throws:
    `AlgorithmNotAgreedException` - DOCUMENT ME!

### setRemoteIdent

    protected abstract void setRemoteIdent(java.lang.String ident)

  DOCUMENT ME!

  Parameters:
    `ident` - DOCUMENT ME!

### getRemoteId

    public abstract java.lang.String getRemoteId()

  DOCUMENT ME!

  Returns:
    DOCUMENT ME!

### setRemoteKexInit

    protected abstract void setRemoteKexInit(SshMsgKexInit msg)

  DOCUMENT ME!

  Parameters:
    `msg` - DOCUMENT ME!

### getRemoteKexInit

    protected abstract SshMsgKexInit getRemoteKexInit()

  DOCUMENT ME!

  Returns:
    DOCUMENT ME!

### performKeyExchange

    protected abstract void performKeyExchange(SshKeyExchange kex)
                                        throws java.io.IOException,
                                               KeyExchangeException

  DOCUMENT ME!

  Parameters:
    `kex` - DOCUMENT ME!
  Throws:
    `java.io.IOException` - DOCUMENT ME!
    `KeyExchangeException` - DOCUMENT ME!

### getKexAlgorithm

    protected java.lang.String getKexAlgorithm()
                                        throws AlgorithmNotAgreedException

  DOCUMENT ME!

  Returns:
    DOCUMENT ME!
  Throws:
    `AlgorithmNotAgreedException` - DOCUMENT ME!

### beginKeyExchange

    protected void beginKeyExchange()
                             throws java.io.IOException,
                                    KeyExchangeException

  DOCUMENT ME!

  Throws:
    `java.io.IOException` - DOCUMENT ME!
    `KeyExchangeException` - DOCUMENT ME!

### createLocalKexInit

    protected SshMsgKexInit createLocalKexInit()
                                        throws java.io.IOException

  DOCUMENT ME!

  Returns:
    DOCUMENT ME!
  Throws:
    `java.io.IOException` - DOCUMENT ME!

### onCorruptMac

    protected void onCorruptMac()

  DOCUMENT ME!

### onMessageReceived

    protected abstract void onMessageReceived(SshMessage msg)
                                       throws java.io.IOException

  DOCUMENT ME!

  Parameters:
    `msg` - DOCUMENT ME!
  Throws:
    `java.io.IOException` - DOCUMENT ME!

### sendDisconnect

    protected void sendDisconnect(int reason,
                                  java.lang.String description)

  DOCUMENT ME!

  Parameters:
    `reason` - DOCUMENT ME!
    `description` - DOCUMENT ME!

### sendDisconnect

    protected void sendDisconnect(int reason,
                                  java.lang.String description,
                                  java.io.IOException error)

  DOCUMENT ME!

  Parameters:
    `reason` - DOCUMENT ME!
    `description` - DOCUMENT ME!
    `error` - DOCUMENT ME!

### sendKeyExchangeInit

    protected void sendKeyExchangeInit()
                                throws java.io.IOException

  DOCUMENT ME!

  Throws:
    `java.io.IOException` - DOCUMENT ME!

### sendNewKeys

    protected void sendNewKeys()
                        throws java.io.IOException

  DOCUMENT ME!

  Throws:
    `java.io.IOException` - DOCUMENT ME!

### setupNewKeys

    protected abstract void setupNewKeys(byte[] encryptCSKey,
                                         byte[] encryptCSIV,
                                         byte[] encryptSCKey,
                                         byte[] encryptSCIV,
                                         byte[] macCSKey,
                                         byte[] macSCKey)
                                  throws AlgorithmNotAgreedException,
                                         AlgorithmOperationException,
                                         AlgorithmNotSupportedException,
                                         AlgorithmInitializationException

  DOCUMENT ME!

  Parameters:
    `encryptCSKey` - DOCUMENT ME!
    `encryptCSIV` - DOCUMENT ME!
    `encryptSCKey` - DOCUMENT ME!
    `encryptSCIV` - DOCUMENT ME!
    `macCSKey` - DOCUMENT ME!
    `macSCKey` - DOCUMENT ME!
  Throws:
    `AlgorithmNotAgreedException` - DOCUMENT ME!
    `AlgorithmOperationException` - DOCUMENT ME!
    `AlgorithmNotSupportedException` - DOCUMENT ME!
    `AlgorithmInitializationException` - DOCUMENT ME!

### completeKeyExchange

    protected void completeKeyExchange()
                                throws java.io.IOException

  DOCUMENT ME!

  Throws:
    `java.io.IOException` - DOCUMENT ME!
    `TransportProtocolException` - DOCUMENT ME!

### getEventHandlers

    protected java.util.List getEventHandlers()

  DOCUMENT ME!

  Returns:
    DOCUMENT ME!

### determineAlgorithm

    protected java.lang.String determineAlgorithm(java.util.List clientAlgorithms,
                                                  java.util.List serverAlgorithms)
                                           throws AlgorithmNotAgreedException

  DOCUMENT ME!

  Parameters:
    `clientAlgorithms` - DOCUMENT ME!
    `serverAlgorithms` - DOCUMENT ME!
  Returns:
    DOCUMENT ME!
  Throws:
    `AlgorithmNotAgreedException` - DOCUMENT ME!

### startBinaryPacketProtocol

    protected void startBinaryPacketProtocol()
                                      throws java.io.IOException

  DOCUMENT ME!

  Throws:
    `java.io.IOException` - DOCUMENT ME!

### stop

    protected final void stop()

  DOCUMENT ME!

### readMessage

    public SshMessage readMessage(int[] filter)
                           throws java.io.IOException

  DOCUMENT ME!

  Specified by:
    `readMessage` in interface `TransportProtocol`
  Parameters:
    `filter` - DOCUMENT ME!
  Returns:
    DOCUMENT ME!
  Throws:
    `java.io.IOException` - DOCUMENT ME!

### processMessages

    protected SshMessage processMessages()
                                  throws java.io.IOException

  DOCUMENT ME!

  Returns:
    DOCUMENT ME!
  Throws:
    `java.io.IOException` - DOCUMENT ME!

### addMessageStore

    public void addMessageStore(SshMessageStore store)
                         throws MessageAlreadyRegisteredException

  DOCUMENT ME!

  Specified by:
    `addMessageStore` in interface `TransportProtocol`
  Parameters:
    `store` - DOCUMENT ME!
  Throws:
    `MessageAlreadyRegisteredException` - DOCUMENT ME!

### removeMessageStore

    public void removeMessageStore(SshMessageStore ms)

  DOCUMENT ME!

  Parameters:
    `ms` - DOCUMENT ME!

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD