public class DefaultNominator extends Object implements PropertyChangeListener
Modifier and Type | Class and Description |
---|---|
private class |
DefaultNominator.RelayedCandidateTask
TimerTask that will wait a certain amount of time to let other candidate
pair to be validated and possibly be better than the relayed candidate.
|
Modifier and Type | Field and Description |
---|---|
private static Logger |
classLogger
The class logger.
|
private Logger |
logger
The
Logger used by DefaultNominator instances. |
private Agent |
parentAgent
The Agent that created us.
|
private NominationStrategy |
strategy
The strategy that this nominator should use to nominate valid pairs.
|
private Map<String,TimerTask> |
validatedCandidates
Map that will remember association between validated relayed candidate
and a timer.
|
Constructor and Description |
---|
DefaultNominator(Agent parentAgent)
Creates a new instance of this nominator using parentAgent as
a reference to the Agent instance that we should use to
nominate pairs.
|
Modifier and Type | Method and Description |
---|---|
void |
propertyChange(PropertyChangeEvent ev)
Tracks changes of state in
IceMediaStream s and CheckList s. |
void |
setStrategy(NominationStrategy strategy)
The
NominationStrategy that this nominator should use when
deciding whether or not a valid CandidatePair is suitable for
nomination. |
private void |
strategyNominateFirstHostOrReflexiveValid(PropertyChangeEvent evt)
Implements a nomination strategy that consists in nominating directly
host or server reflexive pair that has become valid for a
check list.
|
private void |
strategyNominateFirstValid(PropertyChangeEvent evt)
Implements a basic nomination strategy that consists in nominating the
first pair that has become valid for a check list.
|
private void |
strategyNominateHighestPrio(PropertyChangeEvent ev)
Implements a nomination strategy that allows checks for several (or all)
pairs in a check list to conclude before nominating the one with the
highest priority.
|
private static final Logger classLogger
DefaultNominator
, because it doesn't take into account the
per-instance log level. Instances should use logger
instead.private final Agent parentAgent
private NominationStrategy strategy
private final Map<String,TimerTask> validatedCandidates
private Logger logger
Logger
used by DefaultNominator
instances.public void propertyChange(PropertyChangeEvent ev)
IceMediaStream
s and CheckList
s.propertyChange
in interface PropertyChangeListener
ev
- the event that we should use in case it means we should
nominate someone.private void strategyNominateFirstValid(PropertyChangeEvent evt)
evt
- the PropertyChangeEvent
containing the pair which
has been validated.private void strategyNominateHighestPrio(PropertyChangeEvent ev)
ev
- the PropertyChangeEvent
containing the new state and
the source CheckList
.public void setStrategy(NominationStrategy strategy)
NominationStrategy
that this nominator should use when
deciding whether or not a valid CandidatePair
is suitable for
nomination.strategy
- the NominationStrategy
we should be using.private void strategyNominateFirstHostOrReflexiveValid(PropertyChangeEvent evt)
evt
- the PropertyChangeEvent
containing the pair which
has been validated.Copyright © 2018. All rights reserved.