Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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

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.CandidatePacketExtension
All Implemented Interfaces:
org.jivesoftware.smack.packet.PacketExtension
Direct Known Subclasses:
GTalkCandidatePacketExtension, RemoteCandidatePacketExtension

public class CandidatePacketExtension
extends AbstractPacketExtension

Author:
Emil Ivov

Field Summary
static String COMPONENT_ATTR_NAME
          The name of the "component" element.
static String ELEMENT_NAME
          The name of the "candidate" element.
static String FOUNDATION_ATTR_NAME
          The name of the "foundation" element.
static String GENERATION_ATTR_NAME
          The name of the "generation" element.
static String ID_ATTR_NAME
          The name of the "id" element.
static String IP_ATTR_NAME
          The name of the "ip" element.
static String NETWORK_ATTR_NAME
          The name of the "network" element.
static String PORT_ATTR_NAME
          The name of the "port" element.
static String PRIORITY_ATTR_NAME
          The name of the "priority" element.
static String PROTOCOL_ATTR_NAME
          The name of the "protocol" element.
static String REL_ADDR_ATTR_NAME
          The name of the "rel-addr" element.
static String REL_PORT_ATTR_NAME
          The name of the "rel-port" element.
static int RTCP_COMPONENT_ID
          The "component" ID for RTP components.
static int RTP_COMPONENT_ID
          The "component" ID for RTP components.
static String TYPE_ATTR_NAME
          The name of the "type" element.
 
Fields inherited from class net.java.sip.communicator.impl.protocol.jabber.extensions.AbstractPacketExtension
attributes
 
Constructor Summary
  CandidatePacketExtension()
          Creates a new CandidatePacketExtension
protected CandidatePacketExtension(String elementName)
          Creates a new CandidatePacketExtension with the specified elementName so that this class would be usable as a RemoteCandidatePacketExtension parent.
 
Method Summary
 int getComponent()
          Returns a component ID as defined in ICE-CORE.
 int getFoundation()
          Returns the candidate foundation as defined in ICE-CORE.
 int getGeneration()
          Returns this canditate's generation.
 String getID()
          Returns this candidates's unique identifier String.
 String getIP()
          Returns this candidate's Internet Protocol (IP) address; this can be either an IPv4 address or an IPv6 address.
 int getNetwork()
          Returns the network index indicating the interface that the candidate belongs to.
 int getPort()
          Returns this candidate's port number.
 int getPriority()
          This candidate's priority as defined in ICE's RFC 5245
 String getProtocol()
          Sets this candidate's transport protocol.
 String getRelAddr()
          Returns this candidate's related address as described by ICE's RFC 5245.
 int getRelPort()
          Returns this candidate's related port as described by ICE's RFC 5245.
 CandidateType getType()
          Returns a Candidate Type as defined in ICE-CORE.
 void setComponent(int component)
          Sets a component ID as defined in ICE-CORE.
 void setFoundation(int foundation)
          Sets the candidate foundation as defined in ICE-CORE.
 void setGeneration(int generation)
          Sets this canditate's generation index.
 void setID(String id)
          Sets this candidates's unique identifier String.
 void setIP(String ip)
          Sets this candidate's Internet Protocol (IP) address; this can be either an IPv4 address or an IPv6 address.
 void setNetwork(int network)
          The network index indicating the interface that the candidate belongs to.
 void setPort(int port)
          Sets this candidate's port number.
 void setPriority(long priority)
          This candidate's priority as defined in ICE's RFC 5245
 void setProtocol(String protocol)
          Sets this candidate's transport protocol.
 void setRelAddr(String relAddr)
          Sets this candidate's related address as described by ICE's RFC 5245.
 void setRelPort(int relPort)
          Sets this candidate's related port as described by ICE's RFC 5245.
 void setType(CandidateType type)
          Sets a Candidate Type as defined in ICE-CORE.
 
Methods inherited from class net.java.sip.communicator.impl.protocol.jabber.extensions.AbstractPacketExtension
addChildExtension, getAttribute, getAttributeAsInt, getAttributeAsInt, getAttributeAsString, getAttributeAsURI, getAttributeNames, getChildExtensions, 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

ELEMENT_NAME

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

See Also:
Constant Field Values

COMPONENT_ATTR_NAME

public static final String COMPONENT_ATTR_NAME
The name of the "component" element.

See Also:
Constant Field Values

RTP_COMPONENT_ID

public static final int RTP_COMPONENT_ID
The "component" ID for RTP components.

See Also:
Constant Field Values

RTCP_COMPONENT_ID

public static final int RTCP_COMPONENT_ID
The "component" ID for RTP components.

See Also:
Constant Field Values

FOUNDATION_ATTR_NAME

public static final String FOUNDATION_ATTR_NAME
The name of the "foundation" element.

See Also:
Constant Field Values

GENERATION_ATTR_NAME

public static final String GENERATION_ATTR_NAME
The name of the "generation" element.

See Also:
Constant Field Values

ID_ATTR_NAME

public static final String ID_ATTR_NAME
The name of the "id" element.

See Also:
Constant Field Values

IP_ATTR_NAME

public static final String IP_ATTR_NAME
The name of the "ip" element.

See Also:
Constant Field Values

NETWORK_ATTR_NAME

public static final String NETWORK_ATTR_NAME
The name of the "network" element.

See Also:
Constant Field Values

PORT_ATTR_NAME

public static final String PORT_ATTR_NAME
The name of the "port" element.

See Also:
Constant Field Values

PRIORITY_ATTR_NAME

public static final String PRIORITY_ATTR_NAME
The name of the "priority" element.

See Also:
Constant Field Values

PROTOCOL_ATTR_NAME

public static final String PROTOCOL_ATTR_NAME
The name of the "protocol" element.

See Also:
Constant Field Values

REL_ADDR_ATTR_NAME

public static final String REL_ADDR_ATTR_NAME
The name of the "rel-addr" element.

See Also:
Constant Field Values

REL_PORT_ATTR_NAME

public static final String REL_PORT_ATTR_NAME
The name of the "rel-port" element.

See Also:
Constant Field Values

TYPE_ATTR_NAME

public static final String TYPE_ATTR_NAME
The name of the "type" element.

See Also:
Constant Field Values
Constructor Detail

CandidatePacketExtension

public CandidatePacketExtension()
Creates a new CandidatePacketExtension


CandidatePacketExtension

protected CandidatePacketExtension(String elementName)
Creates a new CandidatePacketExtension with the specified elementName so that this class would be usable as a RemoteCandidatePacketExtension parent.

Parameters:
elementName - the element name that this instance should be using.
Method Detail

setComponent

public void setComponent(int component)
Sets a component ID as defined in ICE-CORE.

Parameters:
component - a component ID as defined in ICE-CORE.

getComponent

public int getComponent()
Returns a component ID as defined in ICE-CORE.

Returns:
a component ID as defined in ICE-CORE.

setFoundation

public void setFoundation(int foundation)
Sets the candidate foundation as defined in ICE-CORE.

Parameters:
foundation - the candidate foundation as defined in ICE-CORE.

getFoundation

public int getFoundation()
Returns the candidate foundation as defined in ICE-CORE.

Returns:
the candidate foundation as defined in ICE-CORE.

setGeneration

public void setGeneration(int generation)
Sets this canditate's generation index. A generation is an index, starting at 0, that enables the parties to keep track of updates to the candidate throughout the life of the session. For details, see the ICE Restarts section of XEP-0176.

Parameters:
generation - this canditate's generation index.

getGeneration

public int getGeneration()
Returns this canditate's generation. A generation is an index, starting at 0, that enables the parties to keep track of updates to the candidate throughout the life of the session. For details, see the ICE Restarts section of XEP-0176.

Returns:
this canditate's generation index.

setID

public void setID(String id)
Sets this candidates's unique identifier String.

Parameters:
id - this candidates's unique identifier String

getID

public String getID()
Returns this candidates's unique identifier String.

Returns:
this candidates's unique identifier String

setIP

public void setIP(String ip)
Sets this candidate's Internet Protocol (IP) address; this can be either an IPv4 address or an IPv6 address.

Parameters:
ip - this candidate's IPv4 or IPv6 address.

getIP

public String getIP()
Returns this candidate's Internet Protocol (IP) address; this can be either an IPv4 address or an IPv6 address.

Returns:
this candidate's IPv4 or IPv6 address.

setNetwork

public void setNetwork(int network)
The network index indicating the interface that the candidate belongs to. The network ID is used for diagnostic purposes only in cases where the calling hardware has more than one Network Interface Card.

Parameters:
network - the network index indicating the interface that the candidate belongs to.

getNetwork

public int getNetwork()
Returns the network index indicating the interface that the candidate belongs to. The network ID is used for diagnostic purposes only in cases where the calling hardware has more than one Network Interface Card.

Returns:
the network index indicating the interface that the candidate belongs to.

setPort

public void setPort(int port)
Sets this candidate's port number.

Parameters:
port - this candidate's port number.

getPort

public int getPort()
Returns this candidate's port number.

Returns:
this candidate's port number.

setPriority

public void setPriority(long priority)
This candidate's priority as defined in ICE's RFC 5245

Parameters:
priority - this candidate's priority

getPriority

public int getPriority()
This candidate's priority as defined in ICE's RFC 5245

Returns:
this candidate's priority

setProtocol

public void setProtocol(String protocol)
Sets this candidate's transport protocol.

Parameters:
protocol - this candidate's transport protocol.

getProtocol

public String getProtocol()
Sets this candidate's transport protocol.

Returns:
this candidate's transport protocol.

setRelAddr

public void setRelAddr(String relAddr)
Sets this candidate's related address as described by ICE's RFC 5245.

Parameters:
relAddr - this candidate's related address as described by ICE's RFC 5245.

getRelAddr

public String getRelAddr()
Returns this candidate's related address as described by ICE's RFC 5245.

Returns:
this candidate's related address as described by ICE's RFC 5245.

setRelPort

public void setRelPort(int relPort)
Sets this candidate's related port as described by ICE's RFC 5245.

Parameters:
relPort - this candidate's related port as described by ICE's RFC 5245.

getRelPort

public int getRelPort()
Returns this candidate's related port as described by ICE's RFC 5245.

Returns:
this candidate's related port as described by ICE's RFC 5245.

setType

public void setType(CandidateType type)
Sets a Candidate Type as defined in ICE-CORE. The allowable values are "host" for host candidates, "prflx" for peer reflexive candidates, "relay" for relayed candidates, and "srflx" for server reflexive candidates. All allowable values are enumerated in the CandidateType enum.

Parameters:
type - this candidates' type as per ICE's RFC 5245.

getType

public CandidateType getType()
Returns a Candidate Type as defined in ICE-CORE. The allowable values are "host" for host candidates, "prflx" for peer reflexive candidates, "relay" for relayed candidates, and "srflx" for server reflexive candidates. All allowable values are enumerated in the CandidateType enum.

Returns:
this candidates' type as per ICE's RFC 5245.

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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