Adds/fixes javadocs.

This commit is contained in:
lubomir.marinov 2010-07-14 10:41:28 +00:00
parent 908f572707
commit 0bcec0c2f8
4 changed files with 74 additions and 17 deletions

View File

@ -453,6 +453,10 @@ public class StunCandidateHarvest
* been challenged for a long-term credential
* @param request the STUN <tt>Request</tt> which has been challenged for a
* long-term credential
* @param requestTransactionID the <tt>TransactionID</tt> of
* <tt>request</tt> because <tt>request</tt> only has it as a <tt>byte</tt>
* array and <tt>TransactionID</tt> is required for the
* <tt>applicationData</tt> property value
* @return <tt>true</tt> if the challenge has been processed and this
* <tt>StunCandidateHarvest</tt> is to continue processing STUN
* <tt>Response</tt>s; otherwise, <tt>false</tt>
@ -579,6 +583,10 @@ public class StunCandidateHarvest
* @return <tt>true</tt> if the challenge has been processed and this
* <tt>StunCandidateHarvest</tt> is to continue processing STUN
* <tt>Response</tt>s; otherwise, <tt>false</tt>
* @param transactionID the <tt>TransactionID</tt> of <tt>response</tt> and
* <tt>request</tt> because <tt>response</tt> and <tt>request</tt> only have
* it as a <tt>byte</tt> array and <tt>TransactionID</tt> is required for
* the <tt>applicationData</tt> property value
* @throws StunException if anything goes wrong while processing the
* challenge
*/
@ -655,6 +663,10 @@ public class StunCandidateHarvest
* @param response the error <tt>Response</tt> which has been received for
* <tt>request</tt>
* @param request the <tt>Request</tt> to which <tt>Response</tt> responds
* @param transactionID the <tt>TransactionID</tt> of <tt>response</tt> and
* <tt>request</tt> because <tt>response</tt> and <tt>request</tt> only have
* it as a <tt>byte</tt> array and <tt>TransactionID</tt> is required for
* the <tt>applicationData</tt> property value
* @return <tt>true</tt> 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 <tt>Request</tt> to which <tt>response</tt>
* responds
* @param transactionID the <tt>TransactionID</tt> of <tt>response</tt> and
* <tt>request</tt> because <tt>response</tt> and <tt>request</tt> only have
* it as a <tt>byte</tt> array and <tt>TransactionID</tt> is required for
* the <tt>applicationData</tt> property value
* @return <tt>true</tt> if the specified STUN error <tt>response</tt> was
* successfully handled; <tt>false</tt>, otherwise
* @throws StunException if anything goes wrong while handling the specified
* "438 Stale Nonce" error <tt>response</tt>
*/
private boolean processStaleNonce(
Response response,
@ -894,6 +912,10 @@ public class StunCandidateHarvest
* be handled
* @param request the STUN <tt>Request</tt> to which <tt>response</tt>
* responds
* @param transactionID the <tt>TransactionID</tt> of <tt>response</tt> and
* <tt>request</tt> because <tt>response</tt> and <tt>request</tt> only have
* it as a <tt>byte</tt> array and <tt>TransactionID</tt> is required for
* the <tt>applicationData</tt> 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 <tt>Request</tt> to which <tt>response</tt>
* responds
* @param transactionID the <tt>TransactionID</tt> of <tt>response</tt> and
* <tt>request</tt> because <tt>response</tt> and <tt>request</tt> only have
* it as a <tt>byte</tt> array and <tt>TransactionID</tt> is required for
* the <tt>applicationData</tt> property value
* @return <tt>true</tt> if the specified STUN error <tt>response</tt> was
* successfully handled; <tt>false</tt>, otherwise
* @throws StunException if anything goes wrong while handling the specified
* "401 Unauthorized" error <tt>response</tt>
*/
private boolean processUnauthorized(
Response response,
@ -1123,6 +1151,10 @@ public class StunCandidateHarvest
* @return the <tt>TransactionID</tt> of the STUN client transaction through
* which the specified <tt>Request</tt> has been sent to the STUN server
* associated with this <tt>StunCandidateHarvest</tt>
* @param transactionID the <tt>TransactionID</tt> of <tt>request</tt>
* because <tt>request</tt> only has it as a <tt>byte</tt> array and
* <tt>TransactionID</tt> is required for the <tt>applicationData</tt>
* property value
* @throws StunException if anything goes wrong while sending the specified
* <tt>Request</tt> to the STUN server associated with this
* <tt>StunCandidateHarvest</tt>

View File

@ -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 <tt>true</tt> if the specified <tt>channelNumber</tt> 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);
}
/**

View File

@ -303,8 +303,8 @@ public class EventDispatcher
* implement <tt>MessageEventHandler</tt> for a specific
* <tt>MessageEventHandler</tt> which handles STUN indications.
*
* @param requestListener the <tt>RequestListener</tt> for which the new
* instance is to implement <tt>MessageEventHandler</tt>
* @param indicationListener the <tt>RequestListener</tt> for which the
* new instance is to implement <tt>MessageEventHandler</tt>
*/
public IndicationEventHandler(MessageEventHandler indicationListener)
{
@ -330,6 +330,8 @@ public class EventDispatcher
* implementations to specific <tt>Object</tt>s.
*
* @author Lubomir Marinov
* @param <T> the type of the delegate to which the notifications are to be
* forwarded
*/
private static abstract class MessageTypeEventHandler<T>
implements MessageEventHandler
@ -365,6 +367,15 @@ public class EventDispatcher
this.delegate = delegate;
}
/**
* Determines whether a specific <tt>Object</tt> is value equal to this
* <tt>Object</tt>.
*
* @param obj the <tt>Object</tt> to be compared to this <tt>Object</tt>
* for value equality
* @return <tt>true</tt> if this <tt>Object</tt> is value equal to the
* specified <tt>obj</tt>
*/
@Override
public boolean equals(Object obj)
{
@ -380,6 +391,13 @@ public class EventDispatcher
&& delegate.equals(mteh.delegate);
}
/**
* Returns a hash code value for this <tt>Object</tt> for the benefit of
* hashtables.
*
* @return a hash code value for this <tt>Object</tt> for the benefit of
* hashtables
*/
@Override
public int hashCode()
{

View File

@ -18,8 +18,12 @@ import java.util.logging.Logger;
*/
class MessageQueue
{
private static final Logger logger =
Logger.getLogger(MessageQueue.class.getName());
/**
* The <tt>Logger</tt> used by the <tt>MessageQueue</tt> 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();
}
}
}