org.opennms.netmgt.model.discovery
Class IPPollRange

java.lang.Object
  extended by org.opennms.netmgt.model.discovery.IPPollRange
All Implemented Interfaces:
Iterable<IPPollAddress>

public class IPPollRange
extends Object
implements Iterable<IPPollAddress>

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 enumerationor an iteratorto traverse the range of addresses.

Author:
Sowmya , Brian Weaver , OpenNMS

Constructor Summary
IPPollRange(String fromIP, String toIP, long timeout, int retries)
           Creates an IPPollRange object that can be used to generate IPPollAddress objects.
 
Method Summary
 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.
 int getRetries()
           Returns the retry count for the object.
 long getTimeout()
           Returns the timeout set for the object.
 Iterator<IPPollAddress> iterator()
           Returns an Iterator object that can be used to cycle over the range of pollable address information.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IPPollRange

public IPPollRange(String fromIP,
                   String toIP,
                   long timeout,
                   int retries)
            throws 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:
UnknownHostException
See Also:
IPPollAddress, IPAddrRange
Method Detail

getTimeout

public long getTimeout()

Returns the timeout set for the object. The timeout should be in 1/1000th of a second increments.


getRetries

public int getRetries()

Returns the retry count for the object.


getAddressRange

public IPAddrRange getAddressRange()

Returns the configured address ranges that are encapsulated by this object.


elements

public Enumeration<IPPollAddress> elements()

Returns an Enumeration that can be used to cycle over the range of pollable addresses.


iterator

public Iterator<IPPollAddress> iterator()

Returns an Iterator object that can be used to cycle over the range of pollable address information.

Specified by:
iterator in interface Iterable<IPPollAddress>


Copyright © 2009. All Rights Reserved.