Class IPPollRange
- java.lang.Object
-
- org.opennms.netmgt.model.discovery.IPPollRange
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Iterable<IPPollAddress>
public class IPPollRange extends java.lang.Object implements java.lang.Iterable<IPPollAddress>, java.io.Serializable
This class is designed to encapsulate the information about an address range plus the retry & timeout information. The class is designed so that it can return either an
enumeration
or aniterator
to traverse the range of addresses.- Author:
- Sowmya , Brian Weaver
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description IPPollRange(java.lang.String foreignSource, java.lang.String location, java.lang.String fromIP, java.lang.String toIP, long timeout, int retries)
Creates an IPPollRange object that can be used to generate IPPollAddress objects.IPPollRange(java.lang.String foreignSource, java.lang.String location, java.net.InetAddress start, java.net.InetAddress end, long timeout, int retries)
Creates an IPPollRange object that can be used to generate IPPollAddress objects.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Enumeration<IPPollAddress>
elements()
Returns an Enumeration that can be used to cycle over the range of pollable addresses.IPAddrRange
getAddressRange()
Returns the configured address ranges that are encapsulated by this object.java.lang.String
getForeignSource()
Foreign source where this address should be persisted.java.lang.String
getLocation()
Network location of this address.int
getRetries()
Returns the retry count for the object.long
getTimeout()
Returns the timeout set for the object.java.util.Iterator<IPPollAddress>
iterator()
Returns an Iterator object that can be used to cycle over the range of pollable address information.java.lang.String
toString()
-
-
-
Constructor Detail
-
IPPollRange
public IPPollRange(java.lang.String foreignSource, java.lang.String location, java.lang.String fromIP, java.lang.String toIP, long timeout, int retries) throws java.net.UnknownHostException
Creates an IPPollRange object that can be used to generate IPPollAddress objects. The addresses are encapsulated by the range object and the values of timeout and retry are set in each generated IPPollAddress object.
- Parameters:
fromIP
- The start of the address range to cycle over.toIP
- The end of the address range to cycle over.timeout
- The timeout for each generated IPPollAddress.retries
- The number of retries for generated addresses.- Throws:
java.net.UnknownHostException
- if any.- See Also:
IPPollAddress
,IPAddrRange
-
IPPollRange
public IPPollRange(java.lang.String foreignSource, java.lang.String location, java.net.InetAddress start, java.net.InetAddress end, long timeout, int retries)
Creates an IPPollRange object that can be used to generate IPPollAddress objects. The addresses are encapsulated by the range [start..end] and the values of timeout and retry are set in each generated IPPollAddress object.
- Parameters:
start
- The start of the address range to cycle over.end
- The end of the address range to cycle over.timeout
- The timeout for each generated IPPollAddress.retries
- The number of retries for generated addresses.- See Also:
IPPollAddress
,IPAddrRange
-
-
Method Detail
-
getForeignSource
public java.lang.String getForeignSource()
Foreign source where this address should be persisted.
-
getLocation
public java.lang.String getLocation()
Network location of this address.
-
getTimeout
public long getTimeout()
Returns the timeout set for the object. The timeout should be in 1/1000th of a second increments.
- Returns:
- a long.
-
getRetries
public int getRetries()
Returns the retry count for the object.
- Returns:
- a int.
-
getAddressRange
public IPAddrRange getAddressRange()
Returns the configured address ranges that are encapsulated by this object.
- Returns:
- a
IPAddrRange
object.
-
elements
public java.util.Enumeration<IPPollAddress> elements()
Returns an Enumeration that can be used to cycle over the range of pollable addresses.
- Returns:
- a
Enumeration
object.
-
iterator
public java.util.Iterator<IPPollAddress> iterator()
Returns an Iterator object that can be used to cycle over the range of pollable address information.
- Specified by:
iterator
in interfacejava.lang.Iterable<IPPollAddress>
- Returns:
- a
Iterator
object.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-