public class JniPinger extends Object implements Pinger
JniPinger class.
Constructor and Description |
---|
JniPinger() |
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)
parallelPing
|
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
|
public void initialize4() throws Exception
Pinger
initialize4
in interface Pinger
Exception
public void initialize6() throws Exception
Pinger
initialize6
in interface Pinger
Exception
public boolean isV4Available()
Pinger
isV4Available
in interface Pinger
public boolean isV6Available()
Pinger
isV6Available
in interface Pinger
public void ping(InetAddress host, long timeout, int retries, int packetsize, int sequenceId, PingResponseCallback cb) throws Exception
ping
ping
in interface Pinger
host
- 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.icmp.jni.PingResponseCallback
object.Exception
- if any.public void ping(InetAddress host, long timeout, int retries, int sequenceId, PingResponseCallback cb) throws Exception
ping
ping
in interface Pinger
host
- 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.icmp.jni.PingResponseCallback
object.Exception
- if any.public Number ping(InetAddress host, long timeout, int retries, int packetsize) throws Exception
ping
in interface Pinger
host
- 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 Pinger
host
- 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 Pinger
host
- the host to pingIOException
- if any.InterruptedException
- if any.Exception
- if any.public List<Number> parallelPing(InetAddress host, int count, long timeout, long pingInterval) throws Exception
parallelPing
parallelPing
in interface Pinger
host
- a InetAddress
object.count
- a int.timeout
- a long.pingInterval
- a long.List
object.Exception
- if any.Copyright © 2017. All rights reserved.