public class NonBlockingNagiosCheckSender extends Object implements NagiosCheckSender
| Constructor and Description |
|---|
NonBlockingNagiosCheckSender(NRDPServerConnectionSettings server,
int maxQueueSize,
double maxRequestsPerSeconds,
ThreadPoolExecutor executor)
Bean that knows how to send nagios alerts in a non blocking way, has configurable concurrency level and supports throttling
|
NonBlockingNagiosCheckSender(NRDPServerConnectionSettings server,
int nbThreads,
int maxQueueSize)
Bean that knows how to send nagios alerts in a non blocking way, has configurable concurrency level and supports throttling
|
NonBlockingNagiosCheckSender(NRDPServerConnectionSettings server,
int nbThreads,
int maxQueueSize,
double maxRequestsPerSeconds)
Bean that knows how to send nagios alerts in a non blocking way, has configurable concurrency level and supports throttling
|
| Modifier and Type | Method and Description |
|---|---|
void |
send(Collection<NagiosCheckResult> checkResults)
attempt to send a check result to Nagios
|
Future |
sendAsync(Collection<NagiosCheckResult> checkResults)
Send the check results asynchronously, and return a future.
|
void |
shutdown()
Shuts down the underlying executor.
|
public NonBlockingNagiosCheckSender(NRDPServerConnectionSettings server, int nbThreads, int maxQueueSize)
server - is the nrdp server connection settingsnbThreads - is the number of worker threads for sending nagios alerts (concurrency level)maxQueueSize - is the maximum number of queued jobs before starting rejecting new job requests (IOException) (0 means go on until
OutOfMemory) jobs currently in execution are not taken into account when computing queue size.
Note that this version does not throttle job executions.public NonBlockingNagiosCheckSender(NRDPServerConnectionSettings server, int nbThreads, int maxQueueSize, double maxRequestsPerSeconds)
server - is the nrdp server connection settingsnbThreads - is the number of worker threads for sending nagios alerts (concurrency level)maxQueueSize - is the maximum number of queued jobs before starting rejecting new job requests (IOException) (0 means queue jobs until
OutOfMemory, please don't...) jobs currently in execution are not taken into account when computing queue size.maxRequestsPerSeconds - throttling of requests sent to the server, it's the maximum number of requests send to the server per second (0 means
unlimited). The jobs currently in execution will block in order to respect this rate.public NonBlockingNagiosCheckSender(NRDPServerConnectionSettings server, int maxQueueSize, double maxRequestsPerSeconds, ThreadPoolExecutor executor)
server - is the nrdp server connection settingsmaxQueueSize - is the maximum number of queued jobs before starting rejecting new job requests (IOException) (0 means queue jobs until
OutOfMemory, please don't...) jobs currently in execution are not taken into account when computing queue size.maxRequestsPerSeconds - throttling of requests sent to the server, it's the maximum number of requests send to the server per second (0 means
unlimited). The jobs currently in execution will block in order to respect this rate.executor - executor to use for sending the checkspublic Future sendAsync(Collection<NagiosCheckResult> checkResults) throws NRDPException, IOException
send() method will also send the results asynchronously,
but doesn't return a Future object that can be used to manipulate or
query the execution of the actual sending processNRDPExceptionIOExceptionpublic void send(Collection<NagiosCheckResult> checkResults) throws NRDPException, IOException
NagiosCheckSendersend in interface NagiosCheckSendercheckResults - is a list of results to sendNRDPException - thrown if an error occurs while sending the passive checkIOException - thrown if I/O error occurs while trying to establish connection with nagios hostpublic void shutdown()
Copyright © 2015. All Rights Reserved.