|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.altlinux.jabbix.AgentServer
public class AgentServer
The agent server for Zabbix monitoring system. Holds the mapping between a
set of MetricAgent
objects and corresponding set of metric
keys. A running agent server is a passive component of the
monitoring system and is used to serve metric value queries over a
network using Zabbix protocol (i.e. JabbixProtocol
).
Each metric key is a textual string value that can be used in bijection with
a MetricAgent
. However, for a projection of multiple metric keys to a
single MetricAgent component be also possible, the assumption is made that
the '.' (dot) symbol of a key is a component separator. For a given
multicomponent key the longest leftmost mapping is selected if any.
The incoming requests are processed using a thread pool (i.e.
ThreadPoolExecutor
).
Constructor Summary | |
---|---|
AgentServer(ThreadPoolExecutor pool)
Creates a new agent server instance with a given thread pool set to process incoming requests. |
Method Summary | |
---|---|
MetricAgent |
getMetricAgent(String key)
Returns a metric agent registered for a given metric key. |
Map<String,MetricAgent> |
getMetricAgentMap()
Returns the metric key -> metric agent map. |
ThreadPoolExecutor |
getPool()
Returns the thread pool being used to process incoming requests. |
int |
getPort()
Returns a port number of a server socket. |
void |
run()
Starts a serving cycle. |
void |
setMetricAgentMap(Map<String,MetricAgent> map)
Sets the metric key -> metric agent map. |
void |
setPool(ThreadPoolExecutor pool)
Sets the thread pool to be used to process incoming requests. |
void |
setPort(int port)
Sets a port number for a server socket. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AgentServer(ThreadPoolExecutor pool)
pool
- a thread pool executor objectMethod Detail |
---|
public int getPort()
public void setPort(int port)
port
- port number to listen atpublic void run()
SecurityManager
doesn't prevent it, then
enqueues a new JabbixRequest
task to the thread pool (see
getPool()
) and starts a new iteration.
If the thread pool is built upon a blocking queue the next iteration may be blocked until some previous tasks are done.
run
in interface Runnable
public Map<String,MetricAgent> getMetricAgentMap()
public void setMetricAgentMap(Map<String,MetricAgent> map)
map
- the map of (metric key, metric agent) pairspublic MetricAgent getMetricAgent(String key)
MetricAgent
. However, for a projection of multiple metric
keys to a single MetricAgent component be also possible, the assumption
is made that the '.' (dot) symbol of a key is a component separator. For
a given multicomponent key the longest leftmost mapping is selected if
any.
key
- the name of a metric
public void setPool(ThreadPoolExecutor pool)
pool
- a thread pool executor objectpublic ThreadPoolExecutor getPool()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |