org.opennms.netmgt.model.discovery
Class IPPollAddress

java.lang.Object
  extended by org.opennms.netmgt.model.discovery.IPPollAddress

public class IPPollAddress
extends Object

This class is used to represent the polling information needed by the discovery process. Each instance encapsulates an internet address, timeout in milliseconds, and a retry count.

Author:
Sowmya , Brian Weaver , OpenNMS

Constructor Summary
IPPollAddress(String ipAddress, long timeout, int retries)
           Constructs an IPPollAddress object with the specified parameters.
 
Method Summary
 boolean equals(IPPollAddress pollAddr)
           Returns true if the passed object is equal to self.
 InetAddress getAddress()
          Returns the internet address encapsulated in the object.
 int getRetries()
           Returns the current number of retries set for this address.
 long getTimeout()
           Returns the timeout in 1/1000th of a second increments.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IPPollAddress

public IPPollAddress(String ipAddress,
                     long timeout,
                     int retries)
              throws UnknownHostException

Constructs an IPPollAddress object with the specified parameters.

Parameters:
ipAddress - The Dotted Decimal IPv4 Address.
timeout - The timeout between retries in 1/1000th of a second.
retries - The number of times to attempt to contact the address.
Throws:
UnknownHostException - Thrown by the InetAddress class if the hostname cannot be resolved.
Method Detail

getTimeout

public long getTimeout()

Returns the timeout in 1/1000th of a second increments.

Returns:
The timeout associated with the host in 1/1000th of a second.

getRetries

public int getRetries()

Returns the current number of retries set for this address.

Returns:
The retry count for the instance.

getAddress

public InetAddress getAddress()
Returns the internet address encapsulated in the object.

Returns:
The encapsulated internet address.

equals

public boolean equals(IPPollAddress pollAddr)

Returns true if the passed object is equal to self. The objects must be equal in address, timeout, and the number of retries.

Returns:
True if the objects are logically equal. False is returned otherwise.


Copyright © 2009. All Rights Reserved.