SSF.OS.BGP4.Comm
Class NotificationMessage

java.lang.Object
  |
  +--SSF.OS.ProtocolMessage
        |
        +--SSF.OS.BGP4.Comm.Message
              |
              +--SSF.OS.BGP4.Comm.NotificationMessage
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable

public class NotificationMessage
extends Message

Contains all of the fields that one would find in a BGP Notification message.

See Also:
Serialized Form

Field Summary
 int error_code
          Indicates the type of error which occurred.
 int error_subcode
          Provides more specific information about the nature of the error.
 
Fields inherited from class SSF.OS.BGP4.Comm.Message
KEEPALIVE, nh, NOTICEUPDATE, NOTIFICATION, OCTETS_IN_HEADER, OPEN, RUN, STARTSTOP, TIMEOUT, TRANSPORT, typ, typeNames, UPDATE, version
 
Constructor Summary
NotificationMessage()
          Empty constructor.
NotificationMessage(java.lang.String nh, int ec, int esc)
          Initializes member data.
 
Method Summary
 int body_bytecount()
          Returns the number of octets (bytes) in the message body.
 void readExternal(java.io.ObjectInput in)
          Reads the contents of this object from a serialization stream.
 void writeExternal(java.io.ObjectOutput out)
          Writes the contents of this object to a serialization stream.
 
Methods inherited from class SSF.OS.BGP4.Comm.Message
bytecount, header_bytecount, toString, type2str, version
 
Methods inherited from class SSF.OS.ProtocolMessage
carryPayload, copy, dropHeader, dropPayload, frombytes, fromVersion, payload, previous, size, tobytes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

error_code

public int error_code
Indicates the type of error which occurred.


error_subcode

public int error_subcode
Provides more specific information about the nature of the error. Interpretation varies depending on the type of error.

Constructor Detail

NotificationMessage

public NotificationMessage()
Empty constructor. Used to deserialize this object.


NotificationMessage

public NotificationMessage(java.lang.String nh,
                           int ec,
                           int esc)
Initializes member data.

Parameters:
nh - The NH part of the NHI address of the sender of this message.
ec - The error code that this message will indicate.
Method Detail

body_bytecount

public int body_bytecount()
Returns the number of octets (bytes) in the message body. It is the sum of one octet for the error code, one octet for the error subcode, and a variable number of octets for the data field.

Overrides:
body_bytecount in class Message
Returns:
the number of octets (bytes) in the message

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Writes the contents of this object to a serialization stream.

Specified by:
writeExternal in interface java.io.Externalizable
Overrides:
writeExternal in class Message
Throws:
java.io.IOException - if there's an error writing the data

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Reads the contents of this object from a serialization stream.

Specified by:
readExternal in interface java.io.Externalizable
Overrides:
readExternal in class Message
Throws:
java.io.IOException - if there's an error reading in the data
java.lang.ClassNotFoundException - if a class name is unrecognized