| Constructor and Description |
|---|
JnaPinger() |
| Modifier and Type | Method and Description |
|---|---|
void |
initialize4()
Initialize IPv4 in this Pinger implementation.
|
void |
initialize6()
Initialize IPv6 in this Pinger implementation.
|
boolean |
isV4Available()
Whether or not IPv4 is initialized and available for this implementation.
|
boolean |
isV6Available()
Whether or not IPv6 is initialized and available for this implementation.
|
List<Number> |
parallelPing(InetAddress host,
int count,
long timeout,
long pingInterval)
Ping a remote host, sending 1 or more packets at the given interval, and then
return the response times as a list.
|
List<Number> |
parallelPing(InetAddress host,
int count,
long timeout,
long pingInterval,
int size)
Ping a remote host, sending 1 or more packets at the given interval, and then
return the response times as a list.
|
Number |
ping(InetAddress host)
Ping a remote host, using the default number of retries and timeouts.
|
Number |
ping(InetAddress host,
long timeout,
int retries)
This method is used to ping a remote host to test for ICMP support.
|
Number |
ping(InetAddress host,
long timeout,
int retries,
int packetsize)
This method is used to ping a remote host to test for ICMP support.
|
void |
ping(InetAddress host,
long timeout,
int retries,
int packetsize,
int sequenceId,
PingResponseCallback cb)
ping
|
void |
ping(InetAddress host,
long timeout,
int retries,
int sequenceId,
PingResponseCallback cb)
ping
|
void |
setAllowFragmentation(boolean allow) |
void |
setTrafficClass(int tc) |
public void initialize4()
throws Exception
Pingerinitialize4 in interface PingerExceptionpublic void initialize6()
throws Exception
Pingerinitialize6 in interface PingerExceptionpublic boolean isV4Available()
PingerisV4Available in interface Pingerpublic boolean isV6Available()
PingerisV6Available in interface Pingerpublic void ping(InetAddress host, long timeout, int retries, int packetsize, int sequenceId, PingResponseCallback cb) throws Exception
ping
ping in interface Pingerhost - a InetAddress object.timeout - a long.retries - a int.packetsize - The size in byte of the ICMP packet.sequenceId - a short.cb - a org.opennms.netmgt.ping.PingResponseCallback object.Exception - if any.public void ping(InetAddress host, long timeout, int retries, int sequenceId, PingResponseCallback cb) throws Exception
ping
ping in interface Pingerhost - a InetAddress object.timeout - a long.retries - a int.sequenceId - a short.cb - a org.opennms.netmgt.ping.PingResponseCallback object.Exception - if any.public Number ping(InetAddress host, long timeout, int retries, int packetsize) throws Exception
ping in interface Pingerhost - The address to poll.timeout - The time to wait between each retry.retries - The number of times to retrypacketsize - The size in byte of the ICMP packet.InterruptedException - if any.IOException - if any.Exception - if any.public Number ping(InetAddress host, long timeout, int retries) throws Exception
ping in interface Pingerhost - The address to poll.timeout - The time to wait between each retry.retries - The number of times to retryInterruptedException - if any.IOException - if any.Exception - if any.public Number ping(InetAddress host) throws Exception
ping in interface Pingerhost - the host to pingIOException - if any.InterruptedException - if any.Exception - if any.public List<Number> parallelPing(InetAddress host, int count, long timeout, long pingInterval, int size) throws Exception
parallelPing in interface Pingerhost - The InetAddress address to poll.count - The number of packets to send.timeout - The time to wait between each retry.pingInterval - The interval at which packets will be sent.size - The size of the packet to send.List of response times in microseconds.
If, for a given ping request, the host is reachable and has responded with an
echo reply, it will contain a number, otherwise a null value.Exceptionpublic List<Number> parallelPing(InetAddress host, int count, long timeout, long pingInterval) throws Exception
parallelPing in interface Pingerhost - The InetAddress address to poll.count - The number of packets to send.timeout - The time to wait between each retry.pingInterval - The interval at which packets will be sent.List of response times in microseconds.
If, for a given ping request, the host is reachable and has responded with an
echo reply, it will contain a number, otherwise a null value.Exceptionpublic void setAllowFragmentation(boolean allow)
throws Exception
setAllowFragmentation in interface PingerExceptionpublic void setTrafficClass(int tc)
throws Exception
setTrafficClass in interface PingerExceptionCopyright © 2022. All rights reserved.