org.lastbamboo.common.ice
Interface IceAgent

All Superinterfaces:
IceOfferAnswer, org.lastbamboo.common.offer.answer.OfferAnswer
All Known Implementing Classes:
IceAgentImpl

public interface IceAgent
extends IceOfferAnswer

Interface for ICE agents.


Method Summary
 long calculateDelay(int Ta_i)
          Calculates the delay in milliseconds to use before initiating a new transaction for a given media stream.
 void checkValidPairsForAllComponents(IceMediaStream mediaStream)
          Notifies the listener that the media stream may have valid pairs for all components of a given media stream, possibly requiring changing states of other streams, as specified in part 2 of ICE section 7.1.2.2.3.
 IceState getIceState()
          Accessor for the overall state of ICE processing.
 Collection<IceMediaStream> getMediaStreams()
          Accessor for all the media streams for the agent.
 Queue<IceCandidatePair> getNominatedPairs()
          Accessor for the nominated pairs.
 IceTieBreaker getTieBreaker()
          Accessor for the role conflict tie-breaker for this agent.
 boolean isClosed()
          Whether or not the check list is closed.
 boolean isControlling()
          Returns whether or not this agent is the controlling agent.
 void onNominatedPair(IceCandidatePair pair, IceMediaStream iceMediaStream)
          Indicates a pair has been nominated.
 void onNoMorePairs()
          Called when there are no more pairs to process.
 void onUnfreezeCheckLists(IceMediaStream mediaStream)
          Tells the listener to unfreeze any other check lists.
 void onValidPairs(IceMediaStream mediaStream)
          Tells the agent to consider the valid pairs for this media stream for nomination.
 void recomputePairPriorities()
          Recomputes the priorities of pairs in checklists.
 void setControlling(boolean controlling)
          Sets whether or not this agent is the controlling agent.
 
Methods inherited from interface org.lastbamboo.common.ice.IceOfferAnswer
gatherCandidates
 
Methods inherited from interface org.lastbamboo.common.offer.answer.OfferAnswer
close, closeTcp, closeUdp, generateAnswer, generateOffer, processAnswer, processOffer, useRelay
 

Method Detail

getIceState

IceState getIceState()
Accessor for the overall state of ICE processing.

Returns:
The overall state of ICE processing for all media streams.

setControlling

void setControlling(boolean controlling)
Sets whether or not this agent is the controlling agent.

Parameters:
controlling - Whether or not this agent is the controlling agent.

isControlling

boolean isControlling()
Returns whether or not this agent is the controlling agent.

Returns:
true if this agent is the controlling agent, otherwise false.

getTieBreaker

IceTieBreaker getTieBreaker()
Accessor for the role conflict tie-breaker for this agent.

Returns:
The role conflict tie-breaker for this agent.

calculateDelay

long calculateDelay(int Ta_i)
Calculates the delay in milliseconds to use before initiating a new transaction for a given media stream. The agent handles this because the number of outstanding media streams is taken into account when calculating the delay, and only the agent has that information.

Parameters:
Ta_i - The transaction delay for the specific media stream.
Returns:
The transaction delay to use based on a formula taking into account the number of active media streams.

checkValidPairsForAllComponents

void checkValidPairsForAllComponents(IceMediaStream mediaStream)
Notifies the listener that the media stream may have valid pairs for all components of a given media stream, possibly requiring changing states of other streams, as specified in part 2 of ICE section 7.1.2.2.3. "Updating Pair States".

Parameters:
mediaStream - The media stream.

onUnfreezeCheckLists

void onUnfreezeCheckLists(IceMediaStream mediaStream)
Tells the listener to unfreeze any other check lists.

Parameters:
mediaStream - The media stream initiating the unfreeze operation.

recomputePairPriorities

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


getMediaStreams

Collection<IceMediaStream> getMediaStreams()
Accessor for all the media streams for the agent.

Returns:
The media streams for the agent.

onNominatedPair

void onNominatedPair(IceCandidatePair pair,
                     IceMediaStream iceMediaStream)
Indicates a pair has been nominated. The agent needs to update checks and pair states accordingly and likely to begin transmitting media.

Parameters:
pair - The nominated pair.
iceMediaStream - The ICE media stream the pair is a part of.

getNominatedPairs

Queue<IceCandidatePair> getNominatedPairs()
Accessor for the nominated pairs. TODO: We only currently support the single media stream. This method would have to change for multiple streams.

Returns:
The Queue of nominated IceCandidatePairs.

onValidPairs

void onValidPairs(IceMediaStream mediaStream)
Tells the agent to consider the valid pairs for this media stream for nomination.

Parameters:
mediaStream - The media stream the pair is valid for.

onNoMorePairs

void onNoMorePairs()
Called when there are no more pairs to process.


isClosed

boolean isClosed()
Whether or not the check list is closed.

Returns:
Whether or not the check list is closed.


Copyright © 2013 LittleShoot. All Rights Reserved.