Class ZabbixClient

  • Direct Known Subclasses:
    ActiveAgent, ResponseQueue

    public abstract class ZabbixClient
    extends java.lang.Object
    The base class of all Zabbix server clients. Implement useful methods to connect to a Zabbix server.
    Author:
    Paul Wolneykien
    • Constructor Summary

      Constructors 
      Constructor Description
      ZabbixClient()
      Creates a Zabbix server client.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.net.InetSocketAddress getAddress()
      Returns the configured Zabbix server socket address.
      java.lang.String getHostName()
      Return the configured local host name.
      void setAddress​(byte[] ipBytes)
      Configures a server socket address using the given IP address and a default Zabbix server port.
      void setAddress​(java.lang.String serverHostName)
      Configures a server socket address using the given host name and a default Zabbix server port.
      void setAddress​(java.net.InetAddress serverAddress)
      Configures a server socket address using the given host address and a default Zabbix server port.
      void setAddress​(java.net.InetSocketAddress addr)
      Sets the Zabbix server socket address.
      void setHostName​(java.lang.String hostName)
      Sets the local host name to be used in sent messages.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ZabbixClient

        public ZabbixClient()
        Creates a Zabbix server client.
    • Method Detail

      • setAddress

        public void setAddress​(java.net.InetSocketAddress addr)
        Sets the Zabbix server socket address.
        Parameters:
        addr - a server socket address
      • getAddress

        public java.net.InetSocketAddress getAddress()
        Returns the configured Zabbix server socket address.
        Returns:
        a server socket address
      • getHostName

        public java.lang.String getHostName()
        Return the configured local host name. A Zabbix server normally accepts messages marked as sent from a certain hosts only.
        Returns:
        the configured local host name
      • setHostName

        public void setHostName​(java.lang.String hostName)
        Sets the local host name to be used in sent messages.
        Parameters:
        hostName - a host name
      • setAddress

        public void setAddress​(java.lang.String serverHostName)
        Configures a server socket address using the given host name and a default Zabbix server port.
        Parameters:
        serverHostName - a host name to configure a connection to
        See Also:
        JabbixProtocol.SERVER_PORT
      • setAddress

        public void setAddress​(java.net.InetAddress serverAddress)
        Configures a server socket address using the given host address and a default Zabbix server port.
        Parameters:
        serverAddress - a host address to configure a connection to
        See Also:
        JabbixProtocol.SERVER_PORT
      • setAddress

        public void setAddress​(byte[] ipBytes)
                        throws java.net.UnknownHostException
        Configures a server socket address using the given IP address and a default Zabbix server port.
        Parameters:
        ipBytes - a set of host IP address bytes to configure a connection to
        Throws:
        java.net.UnknownHostException - if IP address is of illegal length
        See Also:
        JabbixProtocol.SERVER_PORT