org.lastbamboo.common.ice.candidate
Interface IceCandidatePair

All Superinterfaces:
Comparable<IceCandidatePair>
All Known Implementing Classes:
IceUdpCandidatePair

public interface IceCandidatePair
extends Comparable<IceCandidatePair>

Interface for a pair of ICE candidates.


Method Summary
<T> T
accept(IceCandidatePairVisitor<T> visitor)
          Accepts the specified visitor to an ICE candidate pair.
 void cancelStunTransaction()
          Cancels the existing STUN transaction.
 org.littleshoot.stun.stack.message.StunMessage check(org.littleshoot.stun.stack.message.BindingRequest request, long rto)
           
 void close()
           
 int getComponentId()
          Accessor for the component ID for the pair.
 String getFoundation()
          Accessor for the foundation for the pair.
 org.littleshoot.mina.common.IoSession getIoSession()
           
 IceCandidate getLocalCandidate()
          Accessor for the local candidate for the pair.
 long getPriority()
          Accessor for the priority for the pair.
 IceCandidate getRemoteCandidate()
          Accessor for the remote candidate for the pair.
 IceCandidatePairState getState()
          Accesses the state of the pair.
 boolean isNominated()
          Returns whether or not this pair has already been nominated.
 boolean isNominateOnSuccess()
           
 boolean isTcp()
          Returns whether or not a pair is a TCP pair.
 boolean isTurnPair()
          Check for whether or not this pair is for a TURN connection.
 void nominate()
          Nominates this pair as potentially the final pair for exchanging media.
 void nominateOnSuccess()
           
 void recomputePriority()
          Recomputes the priority for the pair.
 void setIoSession(org.littleshoot.mina.common.IoSession session)
          Sets the IoSession for the pair.
 void setState(IceCandidatePairState state)
          Sets the state of the pair.
 void useCandidate()
          Sets a flag indicating checks on this pair should include the USE-CANDIDATE attribute in their Binding Requests.
 boolean useCandidateSet()
          Returns whether or not the USE-CANDIDATE attribute is set, i.e.
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

getLocalCandidate

IceCandidate getLocalCandidate()
Accessor for the local candidate for the pair.

Returns:
The local candidate for the pair.

getRemoteCandidate

IceCandidate getRemoteCandidate()
Accessor for the remote candidate for the pair.

Returns:
the remote candidate for the pair.

getPriority

long getPriority()
Accessor for the priority for the pair.

Returns:
The priority for the pair.

getState

IceCandidatePairState getState()
Accesses the state of the pair.

Returns:
The state of the pair.

getFoundation

String getFoundation()
Accessor for the foundation for the pair.

Returns:
The foundation for the candidate pair. Note that this is a string because the foundation for the pair is the *concatenation* of the foundations of the candidates.

setState

void setState(IceCandidatePairState state)
Sets the state of the pair.

Parameters:
state - The state of the pair.

getComponentId

int getComponentId()
Accessor for the component ID for the pair. Note that both candidates in the pair always have the same component ID.

Returns:
The component ID for the pair.

accept

<T> T accept(IceCandidatePairVisitor<T> visitor)
Accepts the specified visitor to an ICE candidate pair.

Type Parameters:
T - The class to return.
Parameters:
visitor - The visitor to accept.
Returns:
The class the visitor created.

nominate

void nominate()
Nominates this pair as potentially the final pair for exchanging media. The nominated pair with the highest priority is the pair that is ultimately used.

Parameters:
nominated - Whether or not this pair is nominated as the final pair for exchanging media.

recomputePriority

void recomputePriority()
Recomputes the priority for the pair.


cancelStunTransaction

void cancelStunTransaction()
Cancels the existing STUN transaction. The behavior for this is described in ICE section 7.2.1.4. on triggered checks. From that section, cancellation:

"means that the agent will not retransmit the request, will not treat the lack of response to be a failure, but will wait the duration of the transaction timeout for a response."


useCandidate

void useCandidate()
Sets a flag indicating checks on this pair should include the USE-CANDIDATE attribute in their Binding Requests. See: 8.1.1.1. Regular Nomination.


useCandidateSet

boolean useCandidateSet()
Returns whether or not the USE-CANDIDATE attribute is set, i.e. whether or not this pair includes the USE-CANDIDATE attribute in its outgoing Binding Requests.

Returns:
true if the USE-CANDIDATE attribute is in use.

isNominated

boolean isNominated()
Returns whether or not this pair has already been nominated.

Returns:
true if the pair has been nominated, otherwise false.

check

org.littleshoot.stun.stack.message.StunMessage check(org.littleshoot.stun.stack.message.BindingRequest request,
                                                     long rto)

close

void close()

getIoSession

org.littleshoot.mina.common.IoSession getIoSession()

setIoSession

void setIoSession(org.littleshoot.mina.common.IoSession session)
Sets the IoSession for the pair.

Parameters:
session - The IoSession.

isTurnPair

boolean isTurnPair()
Check for whether or not this pair is for a TURN connection. If so, we may handle it slightly differently upon nomination or at any other time.

Returns:
true if the local candidate for this pair is for our connection to our TURN server (the connection over which we sent an Allocate Request).

isTcp

boolean isTcp()
Returns whether or not a pair is a TCP pair.

Returns:
true if the pair is TCP, otherwise false.

nominateOnSuccess

void nominateOnSuccess()

isNominateOnSuccess

boolean isNominateOnSuccess()


Copyright © 2013 LittleShoot. All Rights Reserved.