|
||||||||||
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. |
|
JNRPEResponse(InputStream in)
Builds a JNRPE response reading the content from an InputStream. |
Method Summary | |
---|---|
String |
getMessage()
Returns the response message. |
PacketVersion |
getPacketVersion()
Returns the packet version. |
int |
getResultCode()
Returns the result code. |
void |
setCharset(Charset newCharset)
Changes the default charset. |
void |
setMessage(String message)
Sets the message to be included in the response. |
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. |
String |
toString()
|
void |
validate()
Validates the packet CRC. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public JNRPEResponse()
public JNRPEResponse(InputStream in) throws IOException
in
- The InputStream to read from
IOException
- on any io exceptionMethod Detail |
---|
public void setMessage(String message)
message
- the response messagepublic String getMessage()
public String toString()
toString
in class Object
public PacketVersion getPacketVersion()
public void setPacketVersion(PacketVersion version)
version
- The packet versionpublic void setCharset(Charset newCharset)
newCharset
- the new charset,public int getResultCode()
public void setResultCode(int status)
status
- The new result codepublic void validate() throws BadCRCException
BadCRCException
- If the CRC can't be validatedpublic byte[] toByteArray()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |