(streamListeners);
+ }
+
+ PropertyChangeEvent evt = new PropertyChangeEvent(
+ this, "CheckListState", oldValue, newValue);
+
+ for(PropertyChangeListener l : listenersCopy)
+ {
+ l.propertyChange(evt);
+ }
+ }
+
+ /**
+ * Returns the {@link CandidatePair} from component that's
+ * currently first in our valid list and that is therefore with the highest
+ * priority.
+ *
+ * @param component the {@link Component} whose highest priority valid
+ * {@link CandidatePair} we are looking for.
+ *
+ * @return the {@link CandidatePair} with the highest priority in our
+ * valid list or null if our valid list is still empty.
+ */
+ public CandidatePair getFirstValidPair(Component component)
+ {
+ synchronized(validList)
+ {
+ for(CandidatePair pair : validList)
+ {
+ if (pair.getParentComponent() == component)
+ return pair;
+ }
+ }
+
+ return null;
+ }
}
diff --git a/src/org/ice4j/ice/NominationStrategy.java b/src/org/ice4j/ice/NominationStrategy.java
new file mode 100644
index 0000000..8fc7789
--- /dev/null
+++ b/src/org/ice4j/ice/NominationStrategy.java
@@ -0,0 +1,66 @@
+/*
+ * ice4j, the OpenSource Java Solution for NAT and Firewall Traversal.
+ * Maintained by the SIP Communicator community (http://sip-communicator.org).
+ *
+ * Distributable under LGPL license. See terms of license at gnu.org.
+ */
+package org.ice4j.ice;
+
+/**
+ * Contains the nomination strategies currently supported by this
+ * implementation's {@link DefaultNominator} class. Applications can either
+ * pick one of these strategies or select NONE in case they want to
+ * handle nominations themselves.
+ *
+ * Note that NominationStrategies are an ice4j concept and they are not
+ * mentioned in RFC 5245.
+ *
+ * @author Emil Ivov
+ */
+public enum NominationStrategy
+{
+ /**
+ * The strategy consists in nominating the first candidate pair that's
+ * confirmed as valid.
+ */
+ NOMINATE_FIRST_VALID("NominateFirstValid"),
+
+ /**
+ * The strategy consists in nominating the highest priority valid pair once
+ * all checks in a list have completed.
+ */
+ NOMINATE_HIGHEST_PRIO("NominateHighestPriority"),
+
+ /**
+ * The strategy consists in nominating the pair that showed the best
+ * shortest round trip time once all checks in a list completed.
+ */
+ NOMINATE_BEST_RTT("NominateBestRTT");
+
+ /**
+ * The name of this strategy.
+ */
+ private final String strategyName;
+
+ /**
+ * Creates a NominationStrategy instance with the specified name.
+ *
+ * @param name the name of the NominationStrategy that we'd like
+ * to create.
+ */
+ private NominationStrategy(String name)
+ {
+ this.strategyName = name;
+ }
+
+ /**
+ * Returns the name of this NominationStrategy.
+ *
+ * @return the name of this NominationStrategy.
+ */
+ @Override
+ public String toString()
+ {
+ return strategyName;
+ }
+}