org.lastbamboo.common.ice
Interface IceCheckList

All Known Implementing Classes:
IceCheckListImpl

public interface IceCheckList

Interface for ICE check lists.


Method Summary
 void addPair(IceCandidatePair pair)
          Adds the specified ICE candidate pair to the check list.
 void addTriggeredPair(IceCandidatePair pair)
          Adds a pair to the triggered check queue.
 void check()
           
 void close()
          Close all candidates pair connections.
 void executeOnPairs(org.littleshoot.util.Closure<IceCandidatePair> closure)
          Executes the specified Closure on candidate pairs in the check list.
 void formCheckList(Collection<IceCandidate> remoteCandidates)
          Forms the check list.
 IceCheckListState getState()
          Accessor for the state of the check list.
 boolean hasHigherPriorityPendingPair(IceCandidatePair pair)
          Checks whether or not there are existing pairs on either the triggered check list or the normal check list.
 boolean isActive()
          Returns whether or not this check list is considered "active" and should count towards the value of N in timer computation from section 5.8.
 boolean matchesAll(org.littleshoot.util.Predicate<IceCandidatePair> pred)
          Returns whether all the pairs in the check list fit the given predicate.
 boolean matchesAny(org.littleshoot.util.Predicate<IceCandidatePair> pred)
          Returns whether or not any pairs match the specified criteria.
 void recomputePairPriorities(boolean controlling)
          Recomputes the priorities of pairs in checklists.
 IceCandidatePair removeTopTriggeredPair()
          Removes the top triggered pair.
 void removeWaitingAndFrozenPairs(IceCandidatePair pair)
          Notifies the media stream that there's been a nominated pair.
 IceCandidatePair selectAnyPair(org.littleshoot.util.Predicate<IceCandidatePair> pred)
          Selects the first pair matching the predicate from any check list.
 IceCandidatePair selectPair(org.littleshoot.util.Predicate<IceCandidatePair> pred)
          Selects the first pair matching the predicate from the normal check list.
 void setState(IceCheckListState state)
          Sets the state of the check list.
 

Method Detail

setState

void setState(IceCheckListState state)
Sets the state of the check list.

Parameters:
state - The state of the check list.

getState

IceCheckListState getState()
Accessor for the state of the check list.

Returns:
The state of the check list.

check

void check()

isActive

boolean isActive()
Returns whether or not this check list is considered "active" and should count towards the value of N in timer computation from section 5.8.

Returns:
true if the check list is active, otherwise false.

addTriggeredPair

void addTriggeredPair(IceCandidatePair pair)
Adds a pair to the triggered check queue.

Parameters:
pair - The pair to add.

removeTopTriggeredPair

IceCandidatePair removeTopTriggeredPair()
Removes the top triggered pair. Triggered pairs are maintained in a FIFO queue.

Returns:
The top triggered pair, or null if there is no such pair.

recomputePairPriorities

void recomputePairPriorities(boolean controlling)
Recomputes the priorities of pairs in checklists. This can happen, for example, if our role has changed from controlling to controlled or vice versa.

Parameters:
controlling - The current controlling status of the agent.

addPair

void addPair(IceCandidatePair pair)
Adds the specified ICE candidate pair to the check list.

Parameters:
pair - The pair to add.

formCheckList

void formCheckList(Collection<IceCandidate> remoteCandidates)
Forms the check list. The check list is not created upon construction because we can receive incoming checks before we've received the answer, requiring adding triggered pairs to the list before we can create a proper check list.

Parameters:
remoteCandidates - The remote candidates to use in forming a check list.

hasHigherPriorityPendingPair

boolean hasHigherPriorityPendingPair(IceCandidatePair pair)
Checks whether or not there are existing pairs on either the triggered check list or the normal check list. For the normal check list, the pair must be in the FROZEN, WAITING, or IN PROGRESS states.

Parameters:
pair - The pair to check.
Returns:
true if there's a higher priority pair that could still complete its check, otherwise false.

removeWaitingAndFrozenPairs

void removeWaitingAndFrozenPairs(IceCandidatePair pair)
Notifies the media stream that there's been a nominated pair. The media stream follows the process in section 8.1.2, removing all Waiting and Frozen pairs in the check list and the triggered check queue and ceasing retransmissions for pairs that are In-Progress if their priorities are lower than the nominated pair.

Parameters:
pair - The nominated pair.

executeOnPairs

void executeOnPairs(org.littleshoot.util.Closure<IceCandidatePair> closure)
Executes the specified Closure on candidate pairs in the check list.

Parameters:
closure - The Closure to execute.

selectPair

IceCandidatePair selectPair(org.littleshoot.util.Predicate<IceCandidatePair> pred)
Selects the first pair matching the predicate from the normal check list.

Parameters:
pred - The Predicate to check with.
Returns:
The first matching pair, or null if no such pair exists.

selectAnyPair

IceCandidatePair selectAnyPair(org.littleshoot.util.Predicate<IceCandidatePair> pred)
Selects the first pair matching the predicate from any check list.

Parameters:
pred - The Predicate to check with.
Returns:
The first matching pair from any check list, including the triggered check queue, or null if no such pair exists.

matchesAny

boolean matchesAny(org.littleshoot.util.Predicate<IceCandidatePair> pred)
Returns whether or not any pairs match the specified criteria.

Parameters:
pred - The Predicate to match against.
Returns:
true if any pairs match the specified criteria, otherwise false.

matchesAll

boolean matchesAll(org.littleshoot.util.Predicate<IceCandidatePair> pred)
Returns whether all the pairs in the check list fit the given predicate.

Parameters:
pred - The Predicate to match against.
Returns:
true if all pairs match the specified criteria, otherwise false.

close

void close()
Close all candidates pair connections.



Copyright © 2013 LittleShoot. All Rights Reserved.