-
- All Implemented Interfaces:
public class HostCandidateHarvesterA HostCandidateHarvester gathers host Candidates for a specified org.ice4j.ice.Component. Most CandidateHarvesters would rely on the output of the host harvester, that is all host addresses, to be already present and bound in a Component before being able to harvest the type of addresses that they are responsible for.
-
-
Field Summary
Fields Modifier and Type Field Description private HarvestStatisticsharvestStatisticsprivate static Array<String>allowedInterfacesprivate static Array<String>blockedInterfacesprivate static List<InetAddress>allowedAddressesprivate static List<InetAddress>blockedAddresses
-
Method Summary
Modifier and Type Method Description HarvestStatisticsgetHarvestStatistics()Returns the statistics describing how well the various harvests of this harvester went. static Array<String>getAllowedInterfaces()Gets the array of allowed interfaces. static Array<String>getBlockedInterfaces()Gets the array of blocked interfaces. static synchronized List<InetAddress>getAllowedAddresses()Gets the list of addresses which have been explicitly allowed via configuration properties. static synchronized List<InetAddress>getBlockedAddresses()Gets the list of blocked addresses. static List<InetAddress>getAllAllowedAddresses()voidharvest(Component component, int preferredPort, int minPort, int maxPort, Transport transport)Gathers all candidate addresses on the local machine, binds sockets on them and creates HostCandidates. static booleanisInterfaceAllowed(NetworkInterface iface)Returns a boolean value indicating whether ice4j should allocate a host candidate for the specified interface. static synchronized voidinitializeInterfaceFilters()Initializes the host candidate interface filters stored in the org.ice4j.ice.harvest. -
-
Method Detail
-
getHarvestStatistics
HarvestStatistics getHarvestStatistics()
Returns the statistics describing how well the various harvests of this harvester went.
-
getAllowedInterfaces
static Array<String> getAllowedInterfaces()
Gets the array of allowed interfaces.
-
getBlockedInterfaces
static Array<String> getBlockedInterfaces()
Gets the array of blocked interfaces.
-
getAllowedAddresses
static synchronized List<InetAddress> getAllowedAddresses()
Gets the list of addresses which have been explicitly allowed via configuration properties. To get the list of all allowed addresses, use getAllAllowedAddresses.
-
getBlockedAddresses
static synchronized List<InetAddress> getBlockedAddresses()
Gets the list of blocked addresses.
-
getAllAllowedAddresses
static List<InetAddress> getAllAllowedAddresses()
-
harvest
void harvest(Component component, int preferredPort, int minPort, int maxPort, Transport transport)
Gathers all candidate addresses on the local machine, binds sockets on them and creates HostCandidates. The harvester would always try to bind the sockets on the specified preferredPort first. If that fails we will move through all ports between minPort and maxPort and give up if still can't find a free port. If 0, 0, 0 are specified for preferred, min and max port, an ephemeral port will be used instead.
- Parameters:
component- the Component that we'd like to gather candidate addresses for.preferredPort- the port number that should be tried first when binding local Candidate sockets for this Component.minPort- the port number where we should first try to bind before moving to the next one (i.e.maxPort- the maximum port number where we should try binding before giving up and throwing an exception.transport- transport protocol used
-
isInterfaceAllowed
static boolean isInterfaceAllowed(NetworkInterface iface)
Returns a boolean value indicating whether ice4j should allocate a host candidate for the specified interface.
- Parameters:
iface- The NetworkInterface.
-
initializeInterfaceFilters
static synchronized void initializeInterfaceFilters()
Initializes the host candidate interface filters stored in the org.ice4j.ice.harvest.ALLOWED_INTERFACES and org.ice4j.ice.harvest.BLOCKED_INTERFACES properties.
-
-
-
-