Class Jni6Pinger

    • Constructor Detail

      • Jni6Pinger

        public Jni6Pinger()
    • Method Detail

      • initialize4

        public void initialize4()
                         throws Exception
        Description copied from interface: Pinger
        Initialize IPv4 in this Pinger implementation. If unable to do so, implementations should throw an exception.
        Specified by:
        initialize4 in interface Pinger
        Throws:
        Exception
      • initialize6

        public void initialize6()
                         throws Exception
        Description copied from interface: Pinger
        Initialize IPv6 in this Pinger implementation. If unable to do so, implementations should throw an exception.
        Specified by:
        initialize6 in interface Pinger
        Throws:
        Exception
      • isV4Available

        public boolean isV4Available()
        Description copied from interface: Pinger
        Whether or not IPv4 is initialized and available for this implementation.
        Specified by:
        isV4Available in interface Pinger
      • isV6Available

        public boolean isV6Available()
        Description copied from interface: Pinger
        Whether or not IPv6 is initialized and available for this implementation.
        Specified by:
        isV6Available in interface Pinger
        Returns:
      • ping

        public void ping​(InetAddress host,
                         long timeout,
                         int retries,
                         int packetsize,
                         int sequenceId,
                         PingResponseCallback cb)
                  throws Exception

        ping

        Specified by:
        ping in interface Pinger
        Parameters:
        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.
        Throws:
        Exception - if any.
      • ping

        public void ping​(InetAddress host,
                         long timeout,
                         int retries,
                         int sequenceId,
                         PingResponseCallback cb)
                  throws Exception

        ping

        Specified by:
        ping in interface Pinger
        Parameters:
        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.
        Throws:
        Exception - if any.
      • ping

        public Number ping​(InetAddress host,
                           long timeout,
                           int retries,
                           int packetsize)
                    throws Exception
        This method is used to ping a remote host to test for ICMP support. If the remote host responds within the specified period, defined by retries and timeouts, then the response time is returned.
        Specified by:
        ping in interface Pinger
        Parameters:
        host - The address to poll.
        timeout - The time to wait between each retry.
        retries - The number of times to retry
        packetsize - The size in byte of the ICMP packet.
        Returns:
        The response time in microseconds if the host is reachable and has responded with an echo reply, otherwise a null value.
        Throws:
        InterruptedException - if any.
        IOException - if any.
        Exception - if any.
      • ping

        public Number ping​(InetAddress host,
                           long timeout,
                           int retries)
                    throws Exception
        This method is used to ping a remote host to test for ICMP support. If the remote host responds within the specified period, defined by retries and timeouts, then the response time is returned.
        Specified by:
        ping in interface Pinger
        Parameters:
        host - The address to poll.
        timeout - The time to wait between each retry.
        retries - The number of times to retry
        Returns:
        The response time in microseconds if the host is reachable and has responded with an echo reply, otherwise a null value.
        Throws:
        InterruptedException - if any.
        IOException - if any.
        Exception - if any.
      • parallelPing

        public List<Number> parallelPing​(InetAddress host,
                                         int count,
                                         long timeout,
                                         long pingInterval,
                                         int size)
                                  throws Exception
        Ping a remote host, sending 1 or more packets at the given interval, and then return the response times as a list.
        Specified by:
        parallelPing in interface Pinger
        Parameters:
        host - 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.
        Returns:
        a 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.
        Throws:
        Exception
      • parallelPing

        public List<Number> parallelPing​(InetAddress host,
                                         int count,
                                         long timeout,
                                         long pingInterval)
                                  throws Exception
        Ping a remote host, sending 1 or more packets at the given interval, and then return the response times as a list.
        Specified by:
        parallelPing in interface Pinger
        Parameters:
        host - 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.
        Returns:
        a 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.
        Throws:
        Exception