org.altlinux.jabbix
Class ZabbixClient

java.lang.Object
  extended by org.altlinux.jabbix.ZabbixClient
Direct Known Subclasses:
ActiveAgent, ResponseQueue

public abstract class ZabbixClient
extends Object

The base class of all Zabbix server clients. Implement useful methods to connect to a Zabbix server.

Author:
Paul Wolneykien

Constructor Summary
ZabbixClient()
          Creates a Zabbix server client.
 
Method Summary
 InetSocketAddress getAddress()
          Returns the configured Zabbix server socket address.
 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(InetAddress serverAddress)
          Configures a server socket address using the given host address and a default Zabbix server port.
 void setAddress(InetSocketAddress addr)
          Sets the Zabbix server socket address.
 void setAddress(String serverHostName)
          Configures a server socket address using the given host name and a default Zabbix server port.
 void setHostName(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(InetSocketAddress addr)
Sets the Zabbix server socket address.

Parameters:
addr - a server socket address

getAddress

public InetSocketAddress getAddress()
Returns the configured Zabbix server socket address.

Returns:
a server socket address

getHostName

public 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(String hostName)
Sets the local host name to be used in sent messages.

Parameters:
hostName - a host name

setAddress

public void setAddress(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(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 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:
UnknownHostException - if IP address is of illegal length
See Also:
JabbixProtocol.SERVER_PORT