org.jboss.soa.esb.nagios.transport
Class NagiosNSCAPacket
java.lang.Object
org.jboss.soa.esb.nagios.transport.NagiosNSCAPacket
public class NagiosNSCAPacket
- extends java.lang.Object
Representation of a Nagios NSCA data packet. The C implementation of Nagios NSCA uses a struct to represent this data. This class
constructs a byte array that mirrors that struct. There are some tricky bits here that may need adjustment for new versions of
Java, new versions of GCC, or different versions of the Nagios NSCA daemon process compiled on different hardware architectures.
Constructor Summary |
NagiosNSCAPacket(long timestamp,
int returncode,
java.lang.String host,
java.lang.String servicename,
java.lang.String message)
Construct a new packet with the provided information |
NagiosNSCAPacket(java.lang.String host,
java.lang.String servicename,
ServiceResponse response)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NagiosNSCAPacket
public NagiosNSCAPacket(long timestamp,
int returncode,
java.lang.String host,
java.lang.String servicename,
java.lang.String message)
- Construct a new packet with the provided information
- Parameters:
timestamp
- use the one provided upon first connection unless time on server and client are accurately synchronizedreturncode
- the returncode of the checkhost
- the Nagios host name we are reporting forservicename
- the Nagios service name we are reporting formessage
- a message to Nagios from the monitor
NagiosNSCAPacket
public NagiosNSCAPacket(java.lang.String host,
java.lang.String servicename,
ServiceResponse response)
getHost
public java.lang.String getHost()
setHost
public void setHost(java.lang.String host)
getMessage
public java.lang.String getMessage()
setMessage
public void setMessage(java.lang.String message)
getReturncode
public int getReturncode()
setReturncode
public void setReturncode(int returncode)
getServicename
public java.lang.String getServicename()
setServicename
public void setServicename(java.lang.String servicename)
getTimestamp
public long getTimestamp()
setTimestamp
public void setTimestamp(long timestamp)
getData
public byte[] getData()
clearChecksumInPacket
public static void clearChecksumInPacket(byte[] packet)