|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.altlinux.jabbix.ZabbixClient
org.altlinux.jabbix.ResponseQueue
public class ResponseQueue
A Zabbix server client that send metric values to the server when some value
expires its refresh period. Holding an updatable queue of
JabbixActiveMetric
entries to be sent to the server and a link to an
other queue to return sent values to.
When an active metric value is added to the queue its expiration counter is reset. Because of that a value is sent to the server when its whole expiration period is passed or when that is the case for some other value.
Constructor Summary | |
---|---|
ResponseQueue(InetSocketAddress addr,
MetricTable<JabbixActiveMetric<?>> returnTable)
Create a response queue object with the specified parameters. |
Method Summary | |
---|---|
MetricTable<JabbixActiveMetric<?>> |
getReturnTable()
Returns the queue object used to return sent metric objects to. |
boolean |
isTerminated()
Indicates whether the wait-and-send loop is terminated. |
void |
run()
Starts the queue wait-and-send loop. |
void |
terminate()
Terminates this queue wait-and-send loop. |
void |
updateMetric(JabbixActiveMetric<?> freshMetric)
Adds the given metric to the queue. |
Methods inherited from class org.altlinux.jabbix.ZabbixClient |
---|
getAddress, getHostName, setAddress, setAddress, setAddress, setAddress, setHostName |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ResponseQueue(InetSocketAddress addr, MetricTable<JabbixActiveMetric<?>> returnTable)
addr
- remote server socket addressreturnTable
- a table to return sent active metrics toMethod Detail |
---|
public void run()
terminate()
method the process waits for any
active metric value in the queue to expire and then send the whole queue
contents in the "agent data" request. Then the collection of sent metric
objects is offered back to a return table.
run
in interface Runnable
JabbixJSONProtocol.sendMetricList(JabbixWriter, String, Collection)
,
getReturnTable()
public void updateMetric(JabbixActiveMetric<?> freshMetric)
JabbixActiveMetric.setActive(boolean)
) is
toggled. That action should reset the expiration counter of a metric.
updateMetric
in interface MetricTable<JabbixActiveMetric<?>>
freshMetric
- a metric to addJabbixMetric.equals(Object)
public MetricTable<JabbixActiveMetric<?>> getReturnTable()
public boolean isTerminated()
run()
public void terminate()
run()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |