diff --git a/src/org/ice4j/ice/harvest/StunCandidateHarvest.java b/src/org/ice4j/ice/harvest/StunCandidateHarvest.java index f16b5e4..e92850a 100644 --- a/src/org/ice4j/ice/harvest/StunCandidateHarvest.java +++ b/src/org/ice4j/ice/harvest/StunCandidateHarvest.java @@ -453,6 +453,10 @@ public class StunCandidateHarvest * been challenged for a long-term credential * @param request the STUN Request which has been challenged for a * long-term credential + * @param requestTransactionID the TransactionID of + * request because request only has it as a byte + * array and TransactionID is required for the + * applicationData property value * @return true if the challenge has been processed and this * StunCandidateHarvest is to continue processing STUN * Responses; otherwise, false @@ -579,6 +583,10 @@ public class StunCandidateHarvest * @return true if the challenge has been processed and this * StunCandidateHarvest is to continue processing STUN * Responses; otherwise, false + * @param transactionID the TransactionID of response and + * request because response and request only have + * it as a byte array and TransactionID is required for + * the applicationData property value * @throws StunException if anything goes wrong while processing the * challenge */ @@ -655,6 +663,10 @@ public class StunCandidateHarvest * @param response the error Response which has been received for * request * @param request the Request to which Response responds + * @param transactionID the TransactionID of response and + * request because response and request only have + * it as a byte array and TransactionID is required for + * the applicationData property value * @return true if the error or failure condition has been * processed and this instance can continue its execution (e.g. the * resolution of the candidate) as if it was expected; otherwise, @@ -842,8 +854,14 @@ public class StunCandidateHarvest * "438 Stale Nonce" which is to be handled * @param request the STUN Request to which response * responds + * @param transactionID the TransactionID of response and + * request because response and request only have + * it as a byte array and TransactionID is required for + * the applicationData property value * @return true if the specified STUN error response was * successfully handled; false, otherwise + * @throws StunException if anything goes wrong while handling the specified + * "438 Stale Nonce" error response */ private boolean processStaleNonce( Response response, @@ -894,6 +912,10 @@ public class StunCandidateHarvest * be handled * @param request the STUN Request to which response * responds + * @param transactionID the TransactionID of response and + * request because response and request only have + * it as a byte array and TransactionID is required for + * the applicationData property value */ protected void processSuccess( Response response, @@ -912,8 +934,14 @@ public class StunCandidateHarvest * "401 Unauthorized" which is to be handled * @param request the STUN Request to which response * responds + * @param transactionID the TransactionID of response and + * request because response and request only have + * it as a byte array and TransactionID is required for + * the applicationData property value * @return true if the specified STUN error response was * successfully handled; false, otherwise + * @throws StunException if anything goes wrong while handling the specified + * "401 Unauthorized" error response */ private boolean processUnauthorized( Response response, @@ -1123,6 +1151,10 @@ public class StunCandidateHarvest * @return the TransactionID of the STUN client transaction through * which the specified Request has been sent to the STUN server * associated with this StunCandidateHarvest + * @param transactionID the TransactionID of request + * because request only has it as a byte array and + * TransactionID is required for the applicationData + * property value * @throws StunException if anything goes wrong while sending the specified * Request to the STUN server associated with this * StunCandidateHarvest diff --git a/src/org/ice4j/message/ChannelData.java b/src/org/ice4j/message/ChannelData.java index 62625a4..f9a5b01 100644 --- a/src/org/ice4j/message/ChannelData.java +++ b/src/org/ice4j/message/ChannelData.java @@ -104,13 +104,18 @@ public class ChannelData return (char)data.length; } + /** + * Determines whether a specific channel number is in the valid channel + * number range defined by the TURN RFC. + * + * @param channelNumber the channel number to be checked for being in the + * valid channel number range defined by the TURN RFC + * @return true if the specified channelNumber is in the + * valid channel number range defined by the TURN RFC + */ private static boolean validateChannelNumber(char channelNumber) { - if(channelNumber <= 0x3FFF) - { - return false; - } - return true; + return (channelNumber > 0x3FFF); } /** diff --git a/src/org/ice4j/stack/EventDispatcher.java b/src/org/ice4j/stack/EventDispatcher.java index 4482c73..e8303fe 100644 --- a/src/org/ice4j/stack/EventDispatcher.java +++ b/src/org/ice4j/stack/EventDispatcher.java @@ -303,8 +303,8 @@ public class EventDispatcher * implement MessageEventHandler for a specific * MessageEventHandler which handles STUN indications. * - * @param requestListener the RequestListener for which the new - * instance is to implement MessageEventHandler + * @param indicationListener the RequestListener for which the + * new instance is to implement MessageEventHandler */ public IndicationEventHandler(MessageEventHandler indicationListener) { @@ -330,6 +330,8 @@ public class EventDispatcher * implementations to specific Objects. * * @author Lubomir Marinov + * @param the type of the delegate to which the notifications are to be + * forwarded */ private static abstract class MessageTypeEventHandler implements MessageEventHandler @@ -365,6 +367,15 @@ public class EventDispatcher this.delegate = delegate; } + /** + * Determines whether a specific Object is value equal to this + * Object. + * + * @param obj the Object to be compared to this Object + * for value equality + * @return true if this Object is value equal to the + * specified obj + */ @Override public boolean equals(Object obj) { @@ -380,6 +391,13 @@ public class EventDispatcher && delegate.equals(mteh.delegate); } + /** + * Returns a hash code value for this Object for the benefit of + * hashtables. + * + * @return a hash code value for this Object for the benefit of + * hashtables + */ @Override public int hashCode() { diff --git a/src/org/ice4j/stack/MessageQueue.java b/src/org/ice4j/stack/MessageQueue.java index ef9fba8..78d5c78 100644 --- a/src/org/ice4j/stack/MessageQueue.java +++ b/src/org/ice4j/stack/MessageQueue.java @@ -18,8 +18,12 @@ import java.util.logging.Logger; */ class MessageQueue { - private static final Logger logger = - Logger.getLogger(MessageQueue.class.getName()); + /** + * The Logger used by the MessageQueue and its instances + * for logging output. + */ + private static final Logger logger + = Logger.getLogger(MessageQueue.class.getName()); // not sure whether Vector is the best choice here since we explicitly //sync all methods ... review later @@ -74,8 +78,8 @@ class MessageQueue * * * @return the oldest message in the fifo. - * @throws java.lang.InterruptedException if an InterruptedException is thrown - * wail waiting for a new message to be added. + * @throws java.lang.InterruptedException if an InterruptedException is + * thrown wail waiting for a new message to be added. */ public synchronized RawMessage remove() throws InterruptedException @@ -90,15 +94,13 @@ class MessageQueue /** * Blocks until there is at least one message in the queue. * - * @throws java.lang.InterruptedException if an InterruptedException is thrown - * wail waiting for a new message to be added. + * @throws java.lang.InterruptedException if an InterruptedException is + * thrown wail waiting for a new message to be added. */ - public synchronized void waitWhileEmpty() throws InterruptedException + public synchronized void waitWhileEmpty() + throws InterruptedException { while (isEmpty()) - { wait(); - } } - }