org.lastbamboo.common.ice.candidate
Class AbstractIceCandidate

java.lang.Object
  extended by org.lastbamboo.common.ice.candidate.AbstractIceCandidate
All Implemented Interfaces:
Comparable<AbstractIceCandidate>, IceCandidate
Direct Known Subclasses:
IceTcpActiveCandidate, IceTcpHostPassiveCandidate, IceTcpPeerReflexiveCandidate, IceTcpRelayPassiveCandidate, IceTcpServerReflexiveSoCandidate, IceUdpHostCandidate, IceUdpPeerReflexiveCandidate, IceUdpRelayCandidate, IceUdpServerReflexiveCandidate

public abstract class AbstractIceCandidate
extends Object
implements IceCandidate, Comparable<AbstractIceCandidate>

Class that abstracts out general attributes of all ICE session candidates.


Field Summary
protected static int DEFAULT_COMPONENT_ID
          The component ID is 1 unless otherwise specified.
 
Constructor Summary
  AbstractIceCandidate(InetSocketAddress socketAddress, InetAddress baseAddress, IceCandidateType type, IceTransportProtocol transport, boolean controlling)
          Creates a new ICE candidate.
protected AbstractIceCandidate(InetSocketAddress socketAddress, String foundation, IceCandidateType type, IceTransportProtocol transport, long priority, boolean controlling, int componentId, IceCandidate baseCandidate, InetAddress relatedAddress, int relatedPort)
           
 
Method Summary
 int compareTo(AbstractIceCandidate other)
           
 boolean equals(Object obj)
           
 IceCandidate getBaseCandidate()
          Accessor for the base candidate for this candidate.
 int getComponentId()
          Accessor for the component ID of this candidate.
 String getFoundation()
          Accessor for the candidate's foundation.
 long getPriority()
          Accessor for the priority of the candidate.
 InetAddress getRelatedAddress()
           
 int getRelatedPort()
           
 InetSocketAddress getSocketAddress()
          Accessor for the address and port of the candidate.
 IceTransportProtocol getTransport()
          Accessor for the type of transport of this candidate, such as TCP or UDP.
 IceCandidateType getType()
          Gets the type of the ICE candidate.
 int hashCode()
           
 boolean isControlling()
          Returns whether or not this peer is the controlling peer.
 boolean isUdp()
           
 void setControlling(boolean controlling)
          Sets the controlling status of this candidate.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.lastbamboo.common.ice.candidate.IceCandidate
accept
 

Field Detail

DEFAULT_COMPONENT_ID

protected static final int DEFAULT_COMPONENT_ID
The component ID is 1 unless otherwise specified.

See Also:
Constant Field Values
Constructor Detail

AbstractIceCandidate

public AbstractIceCandidate(InetSocketAddress socketAddress,
                            InetAddress baseAddress,
                            IceCandidateType type,
                            IceTransportProtocol transport,
                            boolean controlling)
Creates a new ICE candidate.

Parameters:
socketAddress - The candidate address and port.
baseAddress - The base address.
type - The type of candidate.
transport - The transport protocol.
controlling - Whether or not this candidate is the controlling candidate.

AbstractIceCandidate

protected AbstractIceCandidate(InetSocketAddress socketAddress,
                               String foundation,
                               IceCandidateType type,
                               IceTransportProtocol transport,
                               long priority,
                               boolean controlling,
                               int componentId,
                               IceCandidate baseCandidate,
                               InetAddress relatedAddress,
                               int relatedPort)
Method Detail

setControlling

public void setControlling(boolean controlling)
Description copied from interface: IceCandidate
Sets the controlling status of this candidate.

Specified by:
setControlling in interface IceCandidate
Parameters:
controlling - The controlling status.

getTransport

public IceTransportProtocol getTransport()
Description copied from interface: IceCandidate
Accessor for the type of transport of this candidate, such as TCP or UDP.

Specified by:
getTransport in interface IceCandidate
Returns:
The transport for this candidate.

getType

public IceCandidateType getType()
Description copied from interface: IceCandidate
Gets the type of the ICE candidate.

Specified by:
getType in interface IceCandidate
Returns:
The type of the ICE candidate.

getSocketAddress

public final InetSocketAddress getSocketAddress()
Description copied from interface: IceCandidate
Accessor for the address and port of the candidate.

Specified by:
getSocketAddress in interface IceCandidate
Returns:
The address and port of the candidate.

getPriority

public final long getPriority()
Description copied from interface: IceCandidate
Accessor for the priority of the candidate.

Specified by:
getPriority in interface IceCandidate
Returns:
The priority of the candidate.

getComponentId

public int getComponentId()
Description copied from interface: IceCandidate
Accessor for the component ID of this candidate. A component of a candidate is the number of the component of the media stream it represents. Many media streams will only have one component, starting with "1", but others might have two or more, such as a media stream with RTP and RTCP.

Specified by:
getComponentId in interface IceCandidate
Returns:
The component ID.

getFoundation

public String getFoundation()
Description copied from interface: IceCandidate
Accessor for the candidate's foundation.

Specified by:
getFoundation in interface IceCandidate
Returns:
The candidate's foundation.

isControlling

public boolean isControlling()
Description copied from interface: IceCandidate
Returns whether or not this peer is the controlling peer.

Specified by:
isControlling in interface IceCandidate
Returns:
true if this peer is the controlling peer, otherwise false.

getBaseCandidate

public IceCandidate getBaseCandidate()
Description copied from interface: IceCandidate
Accessor for the base candidate for this candidate. For host and relay candidates, the base candidate is the same as the candidate itself. For server reflexive candidates, the candidate is the host candidate used to determine the server reflexive address.

Specified by:
getBaseCandidate in interface IceCandidate
Returns:
The base candidate.

getRelatedAddress

public InetAddress getRelatedAddress()
Specified by:
getRelatedAddress in interface IceCandidate

getRelatedPort

public int getRelatedPort()
Specified by:
getRelatedPort in interface IceCandidate

isUdp

public boolean isUdp()
Specified by:
isUdp in interface IceCandidate

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

compareTo

public int compareTo(AbstractIceCandidate other)
Specified by:
compareTo in interface Comparable<AbstractIceCandidate>

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013 LittleShoot. All Rights Reserved.