public class CheckList extends Vector<CandidatePair>
Given the asynchronous nature of ice, a check list may be accessed from different locations. This class therefore stores pairs in a Vector
Modifier and Type | Field and Description |
---|---|
private List<PropertyChangeListener> |
checkListeners
Contains
PropertyChangeListener s registered with this Agent and following its changes of state. |
private static Logger |
classLogger
The class logger.
|
private Logger |
logger
|
private IceMediaStream |
parentStream
A reference to the
IceMediaStream that we belong to. |
static String |
PROPERTY_CHECK_LIST_CHECKS
The name of the
PropertyChangeEvent that we use to deliver
changes on the end of checks of this check list. |
static String |
PROPERTY_CHECK_LIST_STATE
The name of the
PropertyChangeEvent that we use to deliver
changes on the state of this check list. |
private static long |
serialVersionUID
A dummy serialization id.
|
private CheckListState |
state
The state of this check list.
|
private List<PropertyChangeListener> |
stateListeners
Contains
PropertyChangeListener s registered with this Agent and following its changes of state. |
private List<CandidatePair> |
triggeredCheckQueue
The triggeredCheckQueue is a FIFO queue containing candidate
pairs for which checks are to be sent at the next available opportunity.
|
capacityIncrement, elementCount, elementData
modCount
Modifier | Constructor and Description |
---|---|
protected |
CheckList(IceMediaStream parentStream)
Creates a check list with the specified name.
|
Modifier and Type | Method and Description |
---|---|
void |
addChecksListener(PropertyChangeListener l)
Add a CheckListener.
|
void |
addStateChangeListener(PropertyChangeListener l)
Adds l to the list of listeners tracking changes of the
CheckListState of this CheckList |
boolean |
allChecksCompleted()
Determines whether all checks in this CheckList have ended one
way or another.
|
protected void |
computeInitialCheckListPairStates()
Computes and resets states of all pairs in this check list.
|
boolean |
containsNomineeForComponent(Component component)
Deprecated.
This method takes into account only candidates in the
checklist. In case of peer reflexives candidates nominated, they do not
appears in checklist but in valid list.
|
protected void |
fireEndOfOrdinaryChecks()
Creates a new
PropertyChangeEvent and delivers it to all
currently registered checks listeners. |
private void |
fireStateChange(CheckListState oldState,
CheckListState newState)
Creates a new
PropertyChangeEvent and delivers it to all
currently registered state listeners. |
String |
getName()
Returns the name of this check list so that we could use it for debugging
purposes.
|
protected CandidatePair |
getNextOrdinaryPairToCheck()
Returns the next
CandidatePair that is eligible for a regular
connectivity check. |
IceMediaStream |
getParentStream()
Returns a reference to the
IceMediaStream that created and that
maintains this check list. |
CheckListState |
getState()
Returns the state of this check list.
|
protected void |
handleNominationConfirmed(CandidatePair nominatedPair)
Removes from this CheckList and its associated triggered check
queue all
CandidatePair s that are in the Waiting and
Frozen states and that belong to the same Component as
nominatedPair. |
boolean |
isActive()
Determines whether this CheckList can be considered active.
|
boolean |
isFrozen()
Determines whether this CheckList can be considered frozen.
|
protected CandidatePair |
popTriggeredCheck()
Returns the first
CandidatePair in the triggered check queue or
null if that queue is empty. |
protected void |
recomputePairPriorities()
Recomputes priorities of all pairs in this CheckList.
|
void |
removeChecksListener(PropertyChangeListener l)
Remove a CheckListener.
|
void |
removeStateChangeListener(PropertyChangeListener l)
Removes l from the list of listeners tracking changes of the
CheckListState of this CheckList |
protected void |
scheduleTriggeredCheck(CandidatePair pair)
Adds pair to the local triggered check queue unless it's already
there.
|
protected void |
setState(CheckListState newState)
Sets the state of this list.
|
String |
toString()
Returns a String representation of this check list.
|
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, forEach, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, iterator, lastElement, lastIndexOf, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeIf, removeRange, replaceAll, retainAll, set, setElementAt, setSize, size, sort, spliterator, subList, toArray, toArray, trimToSize
finalize, getClass, notify, notifyAll, wait, wait, wait
parallelStream, stream
private static final Logger classLogger
private static final long serialVersionUID
public static final String PROPERTY_CHECK_LIST_STATE
PropertyChangeEvent
that we use to deliver
changes on the state of this check list.public static final String PROPERTY_CHECK_LIST_CHECKS
PropertyChangeEvent
that we use to deliver
changes on the end of checks of this check list.private CheckListState state
private final List<CandidatePair> triggeredCheckQueue
private final IceMediaStream parentStream
IceMediaStream
that we belong to.private final List<PropertyChangeListener> stateListeners
PropertyChangeListener
s registered with this Agent
and following its changes of state.private final List<PropertyChangeListener> checkListeners
PropertyChangeListener
s registered with this Agent
and following its changes of state.private Logger logger
protected CheckList(IceMediaStream parentStream)
parentStream
- a reference to the parent IceMediaStream
that created us and that we belong to.public CheckListState getState()
protected void setState(CheckListState newState)
newState
- the CheckListState for this list.protected void scheduleTriggeredCheck(CandidatePair pair)
CandidatePairState.WAITING
.pair
- the pair to schedule a triggered check for.protected CandidatePair popTriggeredCheck()
CandidatePair
in the triggered check queue or
null if that queue is empty.CandidatePair
in the triggered check queue or
null if that queue is empty.protected CandidatePair getNextOrdinaryPairToCheck()
CandidatePair
that is eligible for a regular
connectivity check. According to RFC 5245 this would be the highest
priority pair that is in the Waiting state or, if there is
no such pair, the highest priority Frozen CandidatePair
.CandidatePair
that is eligible for a regular
connectivity check, which would either be the highest priority
Waiting pair or, when there's no such pair, the highest priority
Frozen pair or null otherwisepublic boolean isActive()
public boolean allChecksCompleted()
public boolean isFrozen()
public String toString()
toString
in class Vector<CandidatePair>
protected void computeInitialCheckListPairStates()
protected void recomputePairPriorities()
protected void handleNominationConfirmed(CandidatePair nominatedPair)
CandidatePair
s that are in the Waiting and
Frozen states and that belong to the same Component
as
nominatedPair. Typically this will happen upon confirmation of
the nomination of one pair in that component. The procedure implemented
here represents one of the cases specified in RFC 5245, Section 8.1.2:
The agent MUST remove all Waiting and Frozen pairs in the check list and triggered check queue for the same component as the nominated pairs for that media stream.
If an In-Progress pair in the check list is for the same component as a nominated pair, the agent SHOULD cease retransmissions for its check if its pair priority is lower than the lowest-priority nominated pair for that component.
nominatedPair
- the CandidatePair
whose nomination we need
to handle.public String getName()
@Deprecated public boolean containsNomineeForComponent(Component component)
CandidatePair
for the specified component
and false otherwise.component
- the Component
that we'd whose nominees we are
interested in.CandidatePair
for the specified component
and false otherwise.public void addStateChangeListener(PropertyChangeListener l)
CheckListState
of this CheckListl
- the listener to register.public void removeStateChangeListener(PropertyChangeListener l)
CheckListState
of this CheckListl
- the listener to remove.private void fireStateChange(CheckListState oldState, CheckListState newState)
PropertyChangeEvent
and delivers it to all
currently registered state listeners.oldState
- the CheckListState
we had before the changenewState
- the CheckListState
we had after the changepublic void addChecksListener(PropertyChangeListener l)
l
- CheckListener to addpublic void removeChecksListener(PropertyChangeListener l)
l
- CheckListener to removeprotected void fireEndOfOrdinaryChecks()
PropertyChangeEvent
and delivers it to all
currently registered checks listeners.public IceMediaStream getParentStream()
IceMediaStream
that created and that
maintains this check list.IceMediaStream
that this list belongs
to.Copyright © 2018. All rights reserved.