Secure iNet Factory

com.jscape.inet.ssh.transport
Class Message

java.lang.Object
  extended by com.jscape.inet.ssh.transport.Message
Direct Known Subclasses:
SshMsgKexDhInit, SshMsgKexDhReply, SshMsgUserauthBanner, SshMsgUserauthFailure, SshMsgUserauthSuccess

public abstract class Message
extends java.lang.Object

The SSH message.

Author:
Alex Usun

Method Summary
 long getId()
          Returns the message id.
 int getType()
          Returns the message type code.
static Message readFrom(java.io.InputStream in, java.lang.Class messageClass)
           
static Message readFrom(SshReader reader, java.lang.Class messageClass)
          Reads the message from the reader.
 void setId(long id)
          Setups the message id.
 void writeTo(java.io.OutputStream out)
           
 void writeTo(SshWriter writer)
          Writes the message to the specified writer.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

readFrom

public static Message readFrom(java.io.InputStream in,
                               java.lang.Class messageClass)
                        throws TransportException
Parameters:
in -
messageClass -
Returns:
Message instance
Throws:
TransportException

readFrom

public static Message readFrom(SshReader reader,
                               java.lang.Class messageClass)
                        throws TransportException
Reads the message from the reader.

Parameters:
reader - the SSH types reader
messageClass - the target message class
Returns:
the readed message
Throws:
TransportException - if an I/O error occurs

getType

public int getType()
Returns the message type code.

Returns:
int the message type code.

getId

public long getId()
Returns the message id.

Returns:
long the message id

setId

public void setId(long id)
Setups the message id.

Parameters:
id - the message id

writeTo

public void writeTo(java.io.OutputStream out)
             throws java.io.IOException
Parameters:
out -
Throws:
java.io.IOException

writeTo

public void writeTo(SshWriter writer)
             throws java.io.IOException
Writes the message to the specified writer.

Parameters:
writer - the SSH types writer
Throws:
java.io.IOException - if an I/O error occurs

Secure iNet Factory

Copyright © JSCAPE LLC. 1999-2011. All Rights Reserved