org.opennms.netmgt.poller.nrpe
Class NrpePacket

java.lang.Object
  extended by org.opennms.netmgt.poller.nrpe.NrpePacket

public class NrpePacket
extends Object


Field Summary
static int DEFAULT_PADDING
           
static String HELLO_COMMAND
           
static int MAX_PACKETBUFFER_LENGTH
           
static int PACKET_SIZE
           
static short PACKET_VERSION_2
           
static short QUERY_PACKET
           
static short RESPONSE_PACKET
           
 
Constructor Summary
NrpePacket()
           
NrpePacket(short type, short resultCode, String buffer)
           
 
Method Summary
 byte[] buildPacket(int padding)
           
 byte[] buildPacket(int padding, SecureRandom random)
           
 String getBuffer()
           
 short getResultCode()
           
 short getType()
           
 short getVersion()
           
static int positive(byte b)
           
static NrpePacket receivePacket(InputStream i, int padding)
           
 void setBuffer(String buffer)
           
 void setResultCode(short resultCode)
           
 void setType(short type)
           
 void setVersion(short version)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

QUERY_PACKET

public static final short QUERY_PACKET
See Also:
Constant Field Values

RESPONSE_PACKET

public static final short RESPONSE_PACKET
See Also:
Constant Field Values

HELLO_COMMAND

public static final String HELLO_COMMAND
See Also:
Constant Field Values

PACKET_VERSION_2

public static final short PACKET_VERSION_2
See Also:
Constant Field Values

MAX_PACKETBUFFER_LENGTH

public static final int MAX_PACKETBUFFER_LENGTH
See Also:
Constant Field Values

PACKET_SIZE

public static final int PACKET_SIZE
See Also:
Constant Field Values

DEFAULT_PADDING

public static final int DEFAULT_PADDING
See Also:
Constant Field Values
Constructor Detail

NrpePacket

public NrpePacket()

NrpePacket

public NrpePacket(short type,
                  short resultCode,
                  String buffer)
Method Detail

getVersion

public short getVersion()

setVersion

public void setVersion(short version)

getType

public short getType()

setType

public void setType(short type)

getResultCode

public short getResultCode()

setResultCode

public void setResultCode(short resultCode)

getBuffer

public String getBuffer()

setBuffer

public void setBuffer(String buffer)

receivePacket

public static NrpePacket receivePacket(InputStream i,
                                       int padding)
                                throws NrpeException,
                                       IOException
Throws:
NrpeException
IOException

positive

public static int positive(byte b)

toString

public String toString()
Overrides:
toString in class Object

buildPacket

public byte[] buildPacket(int padding)

buildPacket

public byte[] buildPacket(int padding,
                          SecureRandom random)


Copyright © 2009. All Rights Reserved.