org.opennms.protocols.icmpd
Class CtrlResponseMessage

java.lang.Object
  |
  +--org.opennms.protocols.icmpd.MessageHeader
        |
        +--org.opennms.protocols.icmpd.CtrlResponseMessage

public final class CtrlResponseMessage
extends MessageHeader

Defines the control message for an acknowldgement of the communications channel with the icmpd server. This message is generated by the server to inform the application of a requests success or failure. The format of the message is as follows:

 +--------+--------+----------------+
 |  TYPE  |  CODE  |   SEQUENCE     |
 +--------+--------+----------------+
 |     LENGTH      |   ERROR CODE   |
 +-----------------+----------------+
 

Version:
0.1
Author:
Brian Weaver

Field Summary
static byte CODE
          The message code
static byte TYPE
          The message type
 
Fields inherited from class org.opennms.protocols.icmpd.MessageHeader
m_code, m_length, m_reserved, m_sequence, m_type, sm_seq, TYPE_CONTROL, TYPE_DATA
 
Constructor Summary
  CtrlResponseMessage()
          Creates a default message
(package private) CtrlResponseMessage(MessageHeader hdr)
          creates a default message based upon the header
 
Method Summary
 int getErrorCode()
          Returns the error code of the acknowledgement
 void setErrorCode(int code)
          sets the error code
 
Methods inherited from class org.opennms.protocols.icmpd.MessageHeader
align4, getCode, getLength, getSequence, getType, makeInt, makeShort, nextSequenceId, read, setSequence, write
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

TYPE

public static final byte TYPE
The message type

CODE

public static final byte CODE
The message code
Constructor Detail

CtrlResponseMessage

public CtrlResponseMessage()
Creates a default message

CtrlResponseMessage

CtrlResponseMessage(MessageHeader hdr)
creates a default message based upon the header
Throws:
IllegalArgumentException - Thrown if the header does not have the correct type or code.
Method Detail

getErrorCode

public int getErrorCode()
Returns the error code of the acknowledgement

setErrorCode

public void setErrorCode(int code)
sets the error code
Parameters:
code - The new error code.