public class MachineList extends Object
Modifier and Type | Class and Description |
---|---|
static class |
MachineList.InetAddressFactory
InetAddressFactory is used to obtain InetAddress from host.
|
Modifier and Type | Field and Description |
---|---|
static org.slf4j.Logger |
LOG |
static String |
WILDCARD_VALUE |
Constructor and Description |
---|
MachineList(Collection<String> hostEntries) |
MachineList(Collection<String> hostEntries,
MachineList.InetAddressFactory addressFactory)
Accepts a collection of ip/cidr/host addresses
|
MachineList(String hostEntries) |
MachineList(String hostEntries,
MachineList.InetAddressFactory addressFactory) |
Modifier and Type | Method and Description |
---|---|
Collection<String> |
getCollection()
returns the contents of the MachineList as a Collection<String> .
|
boolean |
includes(InetAddress address)
Accepts an inet address and return true if address is in the list.
|
boolean |
includes(String ipAddress)
Accepts an ip address and return true if ipAddress is in the list.
|
public static final org.slf4j.Logger LOG
public static final String WILDCARD_VALUE
public MachineList(String hostEntries)
hostEntries
- comma separated ip/cidr/host addressespublic MachineList(String hostEntries, MachineList.InetAddressFactory addressFactory)
public MachineList(Collection<String> hostEntries)
hostEntries
- collection of separated ip/cidr/host addressespublic MachineList(Collection<String> hostEntries, MachineList.InetAddressFactory addressFactory)
hostEntries
- addressFactory
- addressFactory to convert host to InetAddresspublic boolean includes(String ipAddress)
includes(InetAddress)
should be preferred
to avoid possibly re-resolving the ip address.ipAddress
- public boolean includes(InetAddress address)
address
- public Collection<String> getCollection()
Copyright © 2008–2022 Apache Software Foundation. All rights reserved.