Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.protocol.jabber
Class JingleNodesHarvester

java.lang.Object
  extended by net.java.sip.communicator.impl.protocol.jabber.JingleNodesHarvester
All Implemented Interfaces:
org.ice4j.ice.harvest.CandidateHarvester

public class JingleNodesHarvester
extends Object
implements org.ice4j.ice.harvest.CandidateHarvester

Implements a CandidateHarvester which gathers Candidates for a specified Component using Jingle Nodes as defined in XEP 278 "Jingle Relay Nodes".

Author:
Sebastien Vincent

Constructor Summary
JingleNodesHarvester(org.xmpp.jnodes.smack.SmackServiceNode serviceNode)
          Constructor.
 
Method Summary
protected  JingleNodesCandidate createJingleNodesCandidate(org.ice4j.TransportAddress transportAddress, org.ice4j.ice.Component component, org.ice4j.TransportAddress localEndPoint)
          Creates a new JingleNodesRelayedCandidate instance which is to represent a specific TransportAddress.
 Collection<org.ice4j.ice.LocalCandidate> harvest(org.ice4j.ice.Component component)
          Gathers Jingle Nodes candidates for all host Candidates that are already present in the specified component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JingleNodesHarvester

public JingleNodesHarvester(org.xmpp.jnodes.smack.SmackServiceNode serviceNode)
Constructor.

Parameters:
serviceNode - the SmackServiceNode
Method Detail

harvest

public Collection<org.ice4j.ice.LocalCandidate> harvest(org.ice4j.ice.Component component)
Gathers Jingle Nodes 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.

Specified by:
harvest in interface org.ice4j.ice.harvest.CandidateHarvester
Parameters:
component - the Component that we'd like to gather candidate Jingle Nodes Candidates for
Returns:
the LocalCandidates gathered by this CandidateHarvester

createJingleNodesCandidate

protected JingleNodesCandidate createJingleNodesCandidate(org.ice4j.TransportAddress transportAddress,
                                                          org.ice4j.ice.Component component,
                                                          org.ice4j.TransportAddress localEndPoint)
Creates a new JingleNodesRelayedCandidate instance which is to represent a specific TransportAddress.

Parameters:
transportAddress - the TransportAddress allocated by the relay
component - the Component for which the candidate will be added
localEndPoint - TransportAddress of the Jingle Nodes relay where we will send our packet.
Returns:
a new JingleNodesRelayedCandidate instance which represents the specified TransportAddress

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.