Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.protocol.jabber.extensions.jingle
Class IceUdpTransportPacketExtension

java.lang.Object
  extended by net.java.sip.communicator.impl.protocol.jabber.extensions.AbstractPacketExtension
      extended by net.java.sip.communicator.impl.protocol.jabber.extensions.jingle.IceUdpTransportPacketExtension
All Implemented Interfaces:
org.jivesoftware.smack.packet.PacketExtension
Direct Known Subclasses:
GTalkTransportPacketExtension, RawUdpTransportPacketExtension

public class IceUdpTransportPacketExtension
extends AbstractPacketExtension

An AbstractPacketExtension implementation for transport elements.

Author:
Emil Ivov, Lyubomir Marinov

Field Summary
static String ELEMENT_NAME
          The name of the "transport" element.
static String NAMESPACE
          The name of the "transport" element.
static String PWD_ATTR_NAME
          The name of the pwd ICE attribute.
static String UFRAG_ATTR_NAME
          The name of the ufrag ICE attribute.
 
Fields inherited from class net.java.sip.communicator.impl.protocol.jabber.extensions.AbstractPacketExtension
attributes
 
Constructor Summary
  IceUdpTransportPacketExtension()
          Creates a new IceUdpTransportPacketExtension instance.
protected IceUdpTransportPacketExtension(String namespace, String elementName)
          Creates a new IceUdpTransportPacketExtension instance with the specified namespace and elementName.
 
Method Summary
 void addCandidate(CandidatePacketExtension candidate)
          Adds candidate to the list of CandidatePacketExtensions registered with this transport.
 void addChildExtension(org.jivesoftware.smack.packet.PacketExtension childExtension)
          Tries to determine whether childExtension is a CandidatePacketExtension, a RemoteCandidatePacketExtension or something else and then adds it as such.
 List<CandidatePacketExtension> getCandidateList()
          Returns the list of CandidatePacketExtensions currently registered with this transport.
 List<? extends org.jivesoftware.smack.packet.PacketExtension> getChildExtensions()
          Returns this element's child (local or remote) candidate elements.
 String getPassword()
          Returns the ICE defined password attribute.
 RemoteCandidatePacketExtension getRemoteCandidate()
          Returns the in-use candidate for this session.
 String getUfrag()
          Returns the ICE defined user fragment attribute.
 boolean removeCandidate(CandidatePacketExtension candidate)
          Removes candidate from the list of CandidatePacketExtensions registered with this transport.
 void setPassword(String pwd)
          Sets the ICE defined password attribute.
 void setRemoteCandidate(RemoteCandidatePacketExtension candidate)
          Sets candidate as the in-use candidate after ICE has terminated.
 void setUfrag(String ufrag)
          Sets the ICE defined user fragment attribute.
 
Methods inherited from class net.java.sip.communicator.impl.protocol.jabber.extensions.AbstractPacketExtension
getAttribute, getAttributeAsInt, getAttributeAsInt, getAttributeAsString, getAttributeAsURI, getAttributeNames, getChildExtensionsOfType, getElementName, getFirstChildOfType, getNamespace, getText, removeAttribute, setAttribute, setNamespace, setText, toXML
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAMESPACE

public static final String NAMESPACE
The name of the "transport" element.

See Also:
Constant Field Values

ELEMENT_NAME

public static final String ELEMENT_NAME
The name of the "transport" element.

See Also:
Constant Field Values

PWD_ATTR_NAME

public static final String PWD_ATTR_NAME
The name of the pwd ICE attribute.

See Also:
Constant Field Values

UFRAG_ATTR_NAME

public static final String UFRAG_ATTR_NAME
The name of the ufrag ICE attribute.

See Also:
Constant Field Values
Constructor Detail

IceUdpTransportPacketExtension

public IceUdpTransportPacketExtension()
Creates a new IceUdpTransportPacketExtension instance.


IceUdpTransportPacketExtension

protected IceUdpTransportPacketExtension(String namespace,
                                         String elementName)
Creates a new IceUdpTransportPacketExtension instance with the specified namespace and elementName. The purpose of this method is to allow RawUdpTransportPacketExtension to extend this class.

Parameters:
namespace - the XML namespace that the instance should belong to.
elementName - the name of the element that we would be representing.
Method Detail

setPassword

public void setPassword(String pwd)
Sets the ICE defined password attribute.

Parameters:
pwd - a password String as defined in RFC 5245

getPassword

public String getPassword()
Returns the ICE defined password attribute.

Returns:
a password String as defined in RFC 5245

setUfrag

public void setUfrag(String ufrag)
Sets the ICE defined user fragment attribute.

Parameters:
ufrag - a user fragment String as defined in RFC 5245

getUfrag

public String getUfrag()
Returns the ICE defined user fragment attribute.

Returns:
a user fragment String as defined in RFC 5245

getChildExtensions

public List<? extends org.jivesoftware.smack.packet.PacketExtension> getChildExtensions()
Returns this element's child (local or remote) candidate elements.

Overrides:
getChildExtensions in class AbstractPacketExtension
Returns:
this element's child (local or remote) candidate elements.

addCandidate

public void addCandidate(CandidatePacketExtension candidate)
Adds candidate to the list of CandidatePacketExtensions registered with this transport.

Parameters:
candidate - the new CandidatePacketExtension to add to this transport element.

removeCandidate

public boolean removeCandidate(CandidatePacketExtension candidate)
Removes candidate from the list of CandidatePacketExtensions registered with this transport.

Parameters:
candidate - the CandidatePacketExtension to remove from this transport element
Returns:
true if the list of CandidatePacketExtensions registered with this transport contained the specified candidate

getCandidateList

public List<CandidatePacketExtension> getCandidateList()
Returns the list of CandidatePacketExtensions currently registered with this transport.

Returns:
the list of CandidatePacketExtensions currently registered with this transport.

setRemoteCandidate

public void setRemoteCandidate(RemoteCandidatePacketExtension candidate)
Sets candidate as the in-use candidate after ICE has terminated.

Parameters:
candidate - the new CandidatePacketExtension to set as an in-use candidate for this session.

getRemoteCandidate

public RemoteCandidatePacketExtension getRemoteCandidate()
Returns the in-use candidate for this session.

Returns:
Returns the in-use candidate for this session.

addChildExtension

public void addChildExtension(org.jivesoftware.smack.packet.PacketExtension childExtension)
Tries to determine whether childExtension is a CandidatePacketExtension, a RemoteCandidatePacketExtension or something else and then adds it as such.

Overrides:
addChildExtension in class AbstractPacketExtension
Parameters:
childExtension - the extension we'd like to add here.

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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