Class NsclientPacket


  • public class NsclientPacket
    extends java.lang.Object
    This object implements the packets created by the NsclientManager system.
    Version:
    $Id: $
    Author:
    Matt Raykowski
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static short RES_STATE_CRIT
      This value is used to state the the service check was validated and needs immediate attention, an outage has occurred.
      static short RES_STATE_OK
      This value is used to state that the service check was validated OK.
      static short RES_STATE_UNKNOWN
      This value is used when a service check validation has unknown results.
      static short RES_STATE_WARNING
      This value is used to state that the service check was validated, but needs attention.
      static java.util.Map<java.lang.String,​java.lang.Short> STATE_STRINGS
      This member is used to convert result codes to strings and vice versa.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String convertStateToString​(short type)
      This method converts a result code to a string.
      static short convertStringToType​(java.lang.String type)
      This method returns the result code for a corresponding string.
      java.lang.String getResponse()
      Returns the value of the server response.
      short getResultCode()
      Returns the result code for the validation.
      void setResultCode​(short res)
      This method sets the result code for the check validation.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • RES_STATE_OK

        public static final short RES_STATE_OK
        This value is used to state that the service check was validated OK.
        See Also:
        Constant Field Values
      • RES_STATE_WARNING

        public static final short RES_STATE_WARNING
        This value is used to state that the service check was validated, but needs attention.
        See Also:
        Constant Field Values
      • RES_STATE_CRIT

        public static final short RES_STATE_CRIT
        This value is used to state the the service check was validated and needs immediate attention, an outage has occurred.
        See Also:
        Constant Field Values
      • RES_STATE_UNKNOWN

        public static final short RES_STATE_UNKNOWN
        This value is used when a service check validation has unknown results.
        See Also:
        Constant Field Values
      • STATE_STRINGS

        public static final java.util.Map<java.lang.String,​java.lang.Short> STATE_STRINGS
        This member is used to convert result codes to strings and vice versa.
    • Method Detail

      • convertStateToString

        public static java.lang.String convertStateToString​(short type)
        This method converts a result code to a string.
        Parameters:
        type - the result code to convert
        Returns:
        the string name of the result code passed, default "UNKNOWN" if no correspond code found.
      • convertStringToType

        public static short convertStringToType​(java.lang.String type)
        This method returns the result code for a corresponding string.
        Parameters:
        type - the string name of the result code.
        Returns:
        the short ID for the result code.
      • getResponse

        public java.lang.String getResponse()
        Returns the value of the server response.
        Returns:
        the value of the server response.
      • getResultCode

        public short getResultCode()
        Returns the result code for the validation.
        Returns:
        the result code for the validation.
      • setResultCode

        public void setResultCode​(short res)
        This method sets the result code for the check validation.
        Parameters:
        res - the result code.