Package 

Class StunCandidateHarvester

  • 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.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • 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.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      StunStack getStunStack() 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.
      String toString() Returns a String representation of this harvester containing its type and server address.
      • Methods inherited from class org.ice4j.ice.harvest.AbstractCandidateHarvester

        getHarvestStatistics, isHostHarvester
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 bindings
        shortTermCredentialUsername - 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
      • toString

         String toString()

        Returns a String representation of this harvester containing its type and server address.