Adds/fixes javadocs.
This commit is contained in:
parent
908f572707
commit
0bcec0c2f8
@ -453,6 +453,10 @@ public class StunCandidateHarvest
|
|||||||
* been challenged for a long-term credential
|
* been challenged for a long-term credential
|
||||||
* @param request the STUN <tt>Request</tt> which has been challenged for a
|
* @param request the STUN <tt>Request</tt> which has been challenged for a
|
||||||
* long-term credential
|
* 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
|
* @return <tt>true</tt> if the challenge has been processed and this
|
||||||
* <tt>StunCandidateHarvest</tt> is to continue processing STUN
|
* <tt>StunCandidateHarvest</tt> is to continue processing STUN
|
||||||
* <tt>Response</tt>s; otherwise, <tt>false</tt>
|
* <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
|
* @return <tt>true</tt> if the challenge has been processed and this
|
||||||
* <tt>StunCandidateHarvest</tt> is to continue processing STUN
|
* <tt>StunCandidateHarvest</tt> is to continue processing STUN
|
||||||
* <tt>Response</tt>s; otherwise, <tt>false</tt>
|
* <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
|
* @throws StunException if anything goes wrong while processing the
|
||||||
* challenge
|
* challenge
|
||||||
*/
|
*/
|
||||||
@ -655,6 +663,10 @@ public class StunCandidateHarvest
|
|||||||
* @param response the error <tt>Response</tt> which has been received for
|
* @param response the error <tt>Response</tt> which has been received for
|
||||||
* <tt>request</tt>
|
* <tt>request</tt>
|
||||||
* @param request the <tt>Request</tt> to which <tt>Response</tt> responds
|
* @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
|
* @return <tt>true</tt> if the error or failure condition has been
|
||||||
* processed and this instance can continue its execution (e.g. the
|
* processed and this instance can continue its execution (e.g. the
|
||||||
* resolution of the candidate) as if it was expected; otherwise,
|
* 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
|
* "438 Stale Nonce" which is to be handled
|
||||||
* @param request the STUN <tt>Request</tt> to which <tt>response</tt>
|
* @param request the STUN <tt>Request</tt> to which <tt>response</tt>
|
||||||
* responds
|
* 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
|
* @return <tt>true</tt> if the specified STUN error <tt>response</tt> was
|
||||||
* successfully handled; <tt>false</tt>, otherwise
|
* 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(
|
private boolean processStaleNonce(
|
||||||
Response response,
|
Response response,
|
||||||
@ -894,6 +912,10 @@ public class StunCandidateHarvest
|
|||||||
* be handled
|
* be handled
|
||||||
* @param request the STUN <tt>Request</tt> to which <tt>response</tt>
|
* @param request the STUN <tt>Request</tt> to which <tt>response</tt>
|
||||||
* responds
|
* 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(
|
protected void processSuccess(
|
||||||
Response response,
|
Response response,
|
||||||
@ -912,8 +934,14 @@ public class StunCandidateHarvest
|
|||||||
* "401 Unauthorized" which is to be handled
|
* "401 Unauthorized" which is to be handled
|
||||||
* @param request the STUN <tt>Request</tt> to which <tt>response</tt>
|
* @param request the STUN <tt>Request</tt> to which <tt>response</tt>
|
||||||
* responds
|
* 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
|
* @return <tt>true</tt> if the specified STUN error <tt>response</tt> was
|
||||||
* successfully handled; <tt>false</tt>, otherwise
|
* 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(
|
private boolean processUnauthorized(
|
||||||
Response response,
|
Response response,
|
||||||
@ -1123,6 +1151,10 @@ public class StunCandidateHarvest
|
|||||||
* @return the <tt>TransactionID</tt> of the STUN client transaction through
|
* @return the <tt>TransactionID</tt> of the STUN client transaction through
|
||||||
* which the specified <tt>Request</tt> has been sent to the STUN server
|
* which the specified <tt>Request</tt> has been sent to the STUN server
|
||||||
* associated with this <tt>StunCandidateHarvest</tt>
|
* 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
|
* @throws StunException if anything goes wrong while sending the specified
|
||||||
* <tt>Request</tt> to the STUN server associated with this
|
* <tt>Request</tt> to the STUN server associated with this
|
||||||
* <tt>StunCandidateHarvest</tt>
|
* <tt>StunCandidateHarvest</tt>
|
||||||
|
|||||||
@ -104,13 +104,18 @@ public class ChannelData
|
|||||||
return (char)data.length;
|
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)
|
private static boolean validateChannelNumber(char channelNumber)
|
||||||
{
|
{
|
||||||
if(channelNumber <= 0x3FFF)
|
return (channelNumber > 0x3FFF);
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -303,8 +303,8 @@ public class EventDispatcher
|
|||||||
* implement <tt>MessageEventHandler</tt> for a specific
|
* implement <tt>MessageEventHandler</tt> for a specific
|
||||||
* <tt>MessageEventHandler</tt> which handles STUN indications.
|
* <tt>MessageEventHandler</tt> which handles STUN indications.
|
||||||
*
|
*
|
||||||
* @param requestListener the <tt>RequestListener</tt> for which the new
|
* @param indicationListener the <tt>RequestListener</tt> for which the
|
||||||
* instance is to implement <tt>MessageEventHandler</tt>
|
* new instance is to implement <tt>MessageEventHandler</tt>
|
||||||
*/
|
*/
|
||||||
public IndicationEventHandler(MessageEventHandler indicationListener)
|
public IndicationEventHandler(MessageEventHandler indicationListener)
|
||||||
{
|
{
|
||||||
@ -330,6 +330,8 @@ public class EventDispatcher
|
|||||||
* implementations to specific <tt>Object</tt>s.
|
* implementations to specific <tt>Object</tt>s.
|
||||||
*
|
*
|
||||||
* @author Lubomir Marinov
|
* @author Lubomir Marinov
|
||||||
|
* @param <T> the type of the delegate to which the notifications are to be
|
||||||
|
* forwarded
|
||||||
*/
|
*/
|
||||||
private static abstract class MessageTypeEventHandler<T>
|
private static abstract class MessageTypeEventHandler<T>
|
||||||
implements MessageEventHandler
|
implements MessageEventHandler
|
||||||
@ -365,6 +367,15 @@ public class EventDispatcher
|
|||||||
this.delegate = delegate;
|
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
|
@Override
|
||||||
public boolean equals(Object obj)
|
public boolean equals(Object obj)
|
||||||
{
|
{
|
||||||
@ -380,6 +391,13 @@ public class EventDispatcher
|
|||||||
&& delegate.equals(mteh.delegate);
|
&& 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
|
@Override
|
||||||
public int hashCode()
|
public int hashCode()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -18,8 +18,12 @@ import java.util.logging.Logger;
|
|||||||
*/
|
*/
|
||||||
class MessageQueue
|
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
|
// not sure whether Vector is the best choice here since we explicitly
|
||||||
//sync all methods ... review later
|
//sync all methods ... review later
|
||||||
@ -74,8 +78,8 @@ class MessageQueue
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @return the oldest message in the fifo.
|
* @return the oldest message in the fifo.
|
||||||
* @throws java.lang.InterruptedException if an InterruptedException is thrown
|
* @throws java.lang.InterruptedException if an InterruptedException is
|
||||||
* wail waiting for a new message to be added.
|
* thrown wail waiting for a new message to be added.
|
||||||
*/
|
*/
|
||||||
public synchronized RawMessage remove()
|
public synchronized RawMessage remove()
|
||||||
throws InterruptedException
|
throws InterruptedException
|
||||||
@ -90,15 +94,13 @@ class MessageQueue
|
|||||||
/**
|
/**
|
||||||
* Blocks until there is at least one message in the queue.
|
* Blocks until there is at least one message in the queue.
|
||||||
*
|
*
|
||||||
* @throws java.lang.InterruptedException if an InterruptedException is thrown
|
* @throws java.lang.InterruptedException if an InterruptedException is
|
||||||
* wail waiting for a new message to be added.
|
* thrown wail waiting for a new message to be added.
|
||||||
*/
|
*/
|
||||||
public synchronized void waitWhileEmpty() throws InterruptedException
|
public synchronized void waitWhileEmpty()
|
||||||
|
throws InterruptedException
|
||||||
{
|
{
|
||||||
while (isEmpty())
|
while (isEmpty())
|
||||||
{
|
|
||||||
wait();
|
wait();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user