|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectit.jnrpe.net.JNRPEResponse
public final class JNRPEResponse
This object represent a generic response packet.
| Constructor Summary | |
|---|---|
JNRPEResponse()
Default constructor. |
|
| Method Summary | |
|---|---|
protected void |
_setMessage(String sMessage)
Sets the packet message. |
protected void |
fromInputStream(InputStream in)
Initialize the object reading the data from the input stream. |
int |
getCRC()
Returns the packet CRC value. |
PacketType |
getPacketType()
Returns the packet type. |
PacketVersion |
getPacketVersion()
Returns the packet version. |
int |
getResultCode()
Returns the result code. |
String |
getStringMessage()
Returns the string message. |
protected void |
initRandomBuffer()
Initializes the arrays with random data. |
void |
setCRC(int iCRC)
Sets the CRC value. |
void |
setMessage(String sMessage)
Sets the message to be included in the response. |
protected void |
setPacketType(PacketType packetType)
Sets the packet type. |
void |
setPacketVersion(PacketVersion version)
Sets the packet version. |
void |
setResultCode(int status)
Sets the result code. |
byte[] |
toByteArray()
Converts the packet object to its byte array representation. |
void |
updateCRC()
Updates the CRC value. |
void |
validate()
Validates the packet CRC. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JNRPEResponse()
| Method Detail |
|---|
public void updateCRC()
public void setMessage(String sMessage)
sMessage - public int getCRC()
public PacketType getPacketType()
public PacketVersion getPacketVersion()
public void setCRC(int iCRC)
iCRC - The new CRC valueprotected void setPacketType(PacketType packetType)
packetType - The new packet typepublic void setPacketVersion(PacketVersion version)
version - The packet versionpublic int getResultCode()
public void setResultCode(int status)
status - The new result code
protected void fromInputStream(InputStream in)
throws IOException
in - The stream to be read
IOException - On any I/O error
public void validate()
throws BadCRCException
BadCRCException - If the CRC can't be validatedpublic byte[] toByteArray()
public String getStringMessage()
protected void _setMessage(String sMessage)
IJNRPEConstants#MAX_PACKETBUFFER_LENGTH than it gets truncated to
IJNRPEConstants#MAX_PACKETBUFFER_LENGTH bytes.
sMessage - The messageprotected void initRandomBuffer()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||