Secure iNet Factory

com.jscape.inet.ssh.transport.messages
Class SshMsgDisconnect

java.lang.Object
  extended by com.jscape.inet.ssh.transport.Message
      extended by com.jscape.inet.ssh.transport.messages.SshMsgDisconnect
All Implemented Interfaces:
TransportDispatchable

public final class SshMsgDisconnect
extends Message
implements TransportDispatchable

Disconnection message: SSH_MSG_DISCONNECT. This message causes immediate termination of the connection. The sender must not send or receive any data after this message, and the recipient must not accept any data after receiving this message. The description field gives a more specific explanation in a human-readable form. The error code gives the reason in a more machine-readable format.

Version:
1.0
Author:
Alex Usun

Field Summary
static int TYPE
          Message type code.
 
Constructor Summary
SshMsgDisconnect(long reasonCode, java.lang.String description, java.lang.String languageTag)
          Creates a new message instance.
 
Method Summary
 boolean accept(TransportMessageDispatcher dispatcher)
          Calls an appropriate dispatcher method.
 java.lang.String getDescription()
          Returns the disconnect reason description.
 java.lang.String getLanguageTag()
          Returns the description language tag.
 long getReasonCode()
          Returns the disconnect reason code.
static SshMsgDisconnect readFrom(java.io.InputStream in)
           
static Message readFrom(SshReader reader)
          Reads the message from the reader.
 java.lang.String toString()
          Returns the string representation of this message.
 void writeTo(java.io.OutputStream out)
           
 void writeTo(SshWriter writer)
          Writes the message to the specified writer.
 
Methods inherited from class com.jscape.inet.ssh.transport.Message
getId, getType, readFrom, readFrom, setId
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE

public static final int TYPE
Message type code.

See Also:
Constant Field Values
Constructor Detail

SshMsgDisconnect

public SshMsgDisconnect(long reasonCode,
                        java.lang.String description,
                        java.lang.String languageTag)
Creates a new message instance.

Parameters:
reasonCode - the disconnect reason code
description - the reason description
languageTag - the description language tag
Method Detail

readFrom

public static SshMsgDisconnect readFrom(java.io.InputStream in)
                                 throws java.io.IOException
Parameters:
in -
Returns:
SshMsgDisconnect instance
Throws:
java.io.IOException

readFrom

public static Message readFrom(SshReader reader)
                        throws java.io.IOException
Reads the message from the reader.

Parameters:
reader - the SSH types reader
Returns:
the readed message
Throws:
java.io.IOException - if an I/O error occurs

getReasonCode

public long getReasonCode()
Returns the disconnect reason code.

Returns:
the disconnect reason code

getDescription

public java.lang.String getDescription()
Returns the disconnect reason description.

Returns:
the disconnect reason description

getLanguageTag

public java.lang.String getLanguageTag()
Returns the description language tag.

Returns:
the description language tag

writeTo

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

writeTo

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

Overrides:
writeTo in class Message
Parameters:
writer - the SSH types writer
Throws:
java.io.IOException - if an I/O error occurs

accept

public boolean accept(TransportMessageDispatcher dispatcher)
Calls an appropriate dispatcher method.

Specified by:
accept in interface TransportDispatchable
Parameters:
dispatcher - the message dispatcher
Returns:
true if dispatcher can dispatch this message; false otherwise

toString

public java.lang.String toString()
Returns the string representation of this message.

Overrides:
toString in class java.lang.Object
Returns:
the string representation of this message

Secure iNet Factory

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