public class IPPollRange extends Object implements Iterable<IPPollAddress>, 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 an
iterator
to traverse the range of addresses.
Constructor and Description |
---|
IPPollRange(String foreignSource,
String location,
InetAddress start,
InetAddress end,
long timeout,
int retries)
Creates an IPPollRange object that can be used to generate IPPollAddress
objects.
|
IPPollRange(String foreignSource,
String location,
String fromIP,
String toIP,
long timeout,
int retries)
Creates an IPPollRange object that can be used to generate IPPollAddress
objects.
|
Modifier and Type | Method and Description |
---|---|
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.
|
String |
getForeignSource()
Foreign source where this address should be persisted.
|
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.
|
Iterator<IPPollAddress> |
iterator()
Returns an Iterator object that can be used to cycle over the range of
pollable address information.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public IPPollRange(String foreignSource, String location, 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.
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.UnknownHostException
- if any.IPPollAddress
,
IPAddrRange
public IPPollRange(String foreignSource, String location, InetAddress start, 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.
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.IPPollAddress
,
IPAddrRange
public String getForeignSource()
public String getLocation()
public long getTimeout()
Returns the timeout set for the object. The timeout should be in 1/1000th of a second increments.
public int getRetries()
Returns the retry count for the object.
public IPAddrRange getAddressRange()
Returns the configured address ranges that are encapsulated by this object.
IPAddrRange
object.public Enumeration<IPPollAddress> elements()
Returns an Enumeration that can be used to cycle over the range of pollable addresses.
Enumeration
object.public Iterator<IPPollAddress> iterator()
Returns an Iterator object that can be used to cycle over the range of pollable address information.
iterator
in interface Iterable<IPPollAddress>
Iterator
object.Copyright © 2021. All rights reserved.