-
- All Implemented Interfaces:
-
org.ice4j.ice.harvest.CandidateHarvester
public class StunCandidateHarvester extends AbstractCandidateHarvester
Implements a CandidateHarvester which gathers Candidates for a specified Component using STUN as defined in RFC 5389 "Session Traversal Utilities for NAT (STUN)" only.
-
-
Field Summary
Fields Modifier and Type Field Description public final TransportAddressstunServerprivate StunStackstunStack
-
Constructor Summary
Constructors Constructor Description StunCandidateHarvester(TransportAddress stunServer)Creates a new STUN harvester that will be running against the specified stunServer using a specific username for the purposes of the STUN short-term credential mechanism. StunCandidateHarvester(TransportAddress stunServer, String shortTermCredentialUsername)Creates a new STUN harvester that will be running against the specified stunServer using a specific username for the purposes of the STUN short-term credential mechanism.
-
Method Summary
Modifier and Type Method Description StunStackgetStunStack()Gets the StunStack used by this CandidateHarvester for the purposes of STUN communication. Collection<LocalCandidate>harvest(Component component)Gathers STUN candidates for all host Candidates that are already present in the specified component. StringtoString()Returns a String representation of this harvester containing its type and server address. -
-
Constructor Detail
-
StunCandidateHarvester
StunCandidateHarvester(TransportAddress stunServer)
Creates a new STUN harvester that will be running against the specified stunServer using a specific username for the purposes of the STUN short-term credential mechanism.- Parameters:
stunServer- the address of the STUN server that we will be querying for our public bindings
-
StunCandidateHarvester
StunCandidateHarvester(TransportAddress stunServer, String shortTermCredentialUsername)
Creates a new STUN harvester that will be running against the specified stunServer using a specific username for the purposes of the STUN short-term credential mechanism.- Parameters:
stunServer- the address of the STUN server that we will be querying for our public bindingsshortTermCredentialUsername- the username to be used by the new instance for the purposes of the STUN short-term credential mechanism or null if the use of the STUN short-term credential mechanism is not determined at the time of the construction of the new instance
-
-
Method Detail
-
getStunStack
StunStack getStunStack()
Gets the StunStack used by this CandidateHarvester for the purposes of STUN communication. It is guaranteed to be available only during the execution of harvest.
-
harvest
Collection<LocalCandidate> harvest(Component component)
Gathers STUN candidates for all host Candidates that are already present in the specified component. This method relies on the specified component to already contain all its host candidates so that it would resolve them.
- Parameters:
component- the Component that we'd like to gather candidate STUN Candidates for
-
-
-
-