1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2025-09-09 10:19:41 +02:00

Enable werror for javadoc and fix javadoc issues

This commit is contained in:
Florian Schmaus 2019-08-30 12:08:30 +02:00
parent 4249c1a845
commit 1a3067c89b
323 changed files with 2929 additions and 2704 deletions

View file

@ -59,7 +59,7 @@ public class JingleManagerTest extends SmackTestCase {
/**
* Constructor for JingleManagerTest.
*
* @param name
* @param name TODO javadoc me please
*/
public JingleManagerTest(final String name) {
super(name);

View file

@ -77,7 +77,7 @@ public class STUNResolverTest extends SmackTestCase {
/**
* Test for getPreferredCandidate()
*
* @throws Exception
* @throws Exception if an exception occurs.
*/
public void testGetPreferredCandidate() throws Exception {
int highestPref = 100;
@ -105,7 +105,7 @@ public class STUNResolverTest extends SmackTestCase {
/**
* Test for getPreferredCandidate()
*
* @throws Exception
* @throws Exception if an exception occurs.
*/
public void testGetPreferredCandidateICE() throws Exception {
int highestPref = 100;
@ -133,7 +133,7 @@ public class STUNResolverTest extends SmackTestCase {
/**
* Test priority generated by STUN lib
*
* @throws Exception
* @throws Exception if an exception occurs.
*/
public void testICEPriority() throws Exception {
@ -193,7 +193,7 @@ public class STUNResolverTest extends SmackTestCase {
/**
* Test for loadSTUNServers()
*
* @throws Exception
* @throws Exception if an exception occurs.
*/
public void testLoadSTUNServers() throws Exception {
STUNResolver stunResolver = new STUNResolver() {
@ -218,7 +218,7 @@ public class STUNResolverTest extends SmackTestCase {
/**
* Test for resolve()
*
* @throws Exception
* @throws Exception if an exception occurs.
*/
public void testResolve() throws Exception {

View file

@ -124,7 +124,7 @@ public class ContentNegotiator extends JingleNegotiator {
/**
* Set jingle transport manager.
* @param jingleTransportManager
* @param jingleTransportManager TODO javadoc me please
*/
public void setJingleTransportManager(JingleTransportManager jingleTransportManager) {
this.jingleTransportManager = jingleTransportManager;
@ -175,7 +175,7 @@ public class ContentNegotiator extends JingleNegotiator {
/**
* Set the jmf negotiator.
*
* @param mediaNeg
* @param mediaNeg TODO javadoc me please
* the description negotiator to set
*/
protected void setMediaNegotiator(MediaNegotiator mediaNeg) {
@ -205,7 +205,7 @@ public class ContentNegotiator extends JingleNegotiator {
/**
* Set TransportNegotiator
*
* @param transNeg
* @param transNeg TODO javadoc me please
* the transNeg to set
*/
protected void setTransportNegotiator(TransportNegotiator transNeg) {
@ -225,6 +225,8 @@ public class ContentNegotiator extends JingleNegotiator {
/**
* Return true if the transport and content negotiators have finished.
*
* @return <code>true</code> if fully established.
*/
public boolean isFullyEstablished() {
boolean result = true;
@ -275,8 +277,8 @@ public class ContentNegotiator extends JingleNegotiator {
/**
* Trigger a session established event.
* @throws NotConnectedException
* @throws InterruptedException
* @throws NotConnectedException if the XMPP connection is not connected.
* @throws InterruptedException if the calling thread was interrupted.
*/
private void triggerContentEstablished(PayloadType pt, TransportCandidate rc, TransportCandidate lc) throws NotConnectedException, InterruptedException {

View file

@ -53,6 +53,9 @@ public enum JingleActionEnum {
/**
* Returns the Action enum for a String action value.
*
* @param inActionCode the action code.
* @return the jingle action.
*/
public static JingleActionEnum getAction(String inActionCode) {
for (JingleActionEnum jingleAction : JingleActionEnum.values()) {

View file

@ -194,8 +194,8 @@ public class JingleManager implements JingleSessionListener {
*
* @param connection XMPP XMPPConnection to be used
* @param jingleMediaManagers an implemented JingleMediaManager to be used.
* @throws SmackException
* @throws XMPPException
* @throws SmackException if Smack detected an exceptional situation.
* @throws XMPPException if an XMPP protocol error was received.
*/
public JingleManager(XMPPConnection connection, List<JingleMediaManager> jingleMediaManagers) throws XMPPException, SmackException {
this.connection = connection;
@ -303,8 +303,8 @@ public class JingleManager implements JingleSessionListener {
* @return a boolean indicating whether the specified user handles Jingle
* messages
* @throws SmackException if there was no response from the server.
* @throws XMPPException
* @throws InterruptedException
* @throws XMPPException if an XMPP protocol error was received.
* @throws InterruptedException if the calling thread was interrupted.
*/
public static boolean isServiceEnabled(XMPPConnection connection, Jid userID) throws XMPPException, SmackException, InterruptedException {
return ServiceDiscoveryManager.getInstanceFor(connection).supportsFeature(userID, Jingle.NAMESPACE);
@ -367,7 +367,7 @@ public class JingleManager implements JingleSessionListener {
* Adds a CreatedJingleSessionListener.
* This listener will be called when a session is created by the JingleManager instance.
*
* @param createdJingleSessionListener
* @param createdJingleSessionListener TODO javadoc me please
*/
public void addCreationListener(CreatedJingleSessionListener createdJingleSessionListener) {
this.creationListeners.add(createdJingleSessionListener);
@ -377,7 +377,7 @@ public class JingleManager implements JingleSessionListener {
* Removes a CreatedJingleSessionListener.
* This listener will be called when a session is created by the JingleManager instance.
*
* @param createdJingleSessionListener
* @param createdJingleSessionListener TODO javadoc me please
*/
public void removeCreationListener(CreatedJingleSessionListener createdJingleSessionListener) {
this.creationListeners.remove(createdJingleSessionListener);
@ -386,7 +386,7 @@ public class JingleManager implements JingleSessionListener {
/**
* Trigger CreatedJingleSessionListeners that a session was created.
*
* @param jingleSession
* @param jingleSession TODO javadoc me please
*/
public void triggerSessionCreated(JingleSession jingleSession) {
jingleSessions.add(jingleSession);
@ -517,6 +517,7 @@ public class JingleManager implements JingleSessionListener {
* @param responder the fully qualified jabber ID with resource of the other
* user.
* @return The session on which the negotiation can be run.
* @throws XMPPException if an XMPP protocol error was received.
*/
public JingleSession createOutgoingJingleSession(EntityFullJid responder) throws XMPPException {
JingleSession session = new JingleSession(connection, null, connection.getUser(), responder, jingleMediaManagers);
@ -543,6 +544,7 @@ public class JingleManager implements JingleSessionListener {
*
* @param request the remote request that is being accepted.
* @return the session which manages the rest of the negotiation.
* @throws XMPPException if an XMPP protocol error was received.
*/
public JingleSession createIncomingJingleSession(JingleSessionRequest request) throws XMPPException {
if (request == null) {
@ -576,7 +578,7 @@ public class JingleManager implements JingleSessionListener {
/**
* Get a session with the informed JID. If no session is found, return null.
*
* @param jid
* @param jid TODO javadoc me please
* @return the JingleSession
*/
public JingleSession getSession(String jid) {

View file

@ -129,7 +129,7 @@ public abstract class JingleNegotiator {
/**
* Add expected ID.
*
* @param id
* @param id TODO javadoc me please
*/
public void addExpectedId(String id) {
expectedAckId = id;
@ -138,7 +138,7 @@ public abstract class JingleNegotiator {
/**
* Check if the passed ID is the expected ID.
*
* @param id
* @param id TODO javadoc me please
* @return true if is expected id
*/
public boolean isExpectedId(String id) {
@ -152,7 +152,7 @@ public abstract class JingleNegotiator {
/**
* Remove and expected ID.
*
* @param id
* @param id TODO javadoc me please
*/
public void removeExpectedId(String id) {
addExpectedId(null);
@ -229,8 +229,9 @@ public abstract class JingleNegotiator {
* @param iq the stanza received
* @param id the ID of the response that will be sent
* @return the new stanza to send (either a Jingle or an IQ error).
* @throws XMPPException
* @throws InterruptedException
* @throws XMPPException if an XMPP protocol error was received.
* @throws SmackException if Smack detected an exceptional situation.
* @throws InterruptedException if the calling thread was interrupted.
*/
public abstract List<IQ> dispatchIncomingPacket(IQ iq, String id) throws XMPPException, SmackException, InterruptedException;

View file

@ -100,15 +100,15 @@ public final class JingleSession extends JingleNegotiator implements MediaReceiv
/**
* Full featured JingleSession constructor.
*
* @param conn
* @param conn TODO javadoc me please
* the XMPPConnection which is used
* @param initiator
* @param initiator TODO javadoc me please
* the initiator JID
* @param responder
* @param responder TODO javadoc me please
* the responder JID
* @param sessionid
* @param sessionid TODO javadoc me please
* the session ID
* @param jingleMediaManagers
* @param jingleMediaManagers TODO javadoc me please
* the jingleMediaManager
*/
public JingleSession(XMPPConnection conn, Jid initiator, Jid responder, String sessionid,
@ -138,6 +138,7 @@ public final class JingleSession extends JingleNegotiator implements MediaReceiv
*
* @param conn
* Connection
* @param request the request.
* @param initiator
* the initiator JID
* @param responder
@ -168,7 +169,7 @@ public final class JingleSession extends JingleNegotiator implements MediaReceiv
/**
* Set the session initiator.
*
* @param initiator
* @param initiator TODO javadoc me please
* the initiator to set
*/
public void setInitiator(Jid initiator) {
@ -187,7 +188,7 @@ public final class JingleSession extends JingleNegotiator implements MediaReceiv
/**
* Set the Media Manager of this Jingle Session.
*
* @param jingleMediaManagers
* @param jingleMediaManagers TODO javadoc me please
*/
public void setMediaManagers(List<JingleMediaManager> jingleMediaManagers) {
this.jingleMediaManagers = jingleMediaManagers;
@ -205,7 +206,7 @@ public final class JingleSession extends JingleNegotiator implements MediaReceiv
/**
* Set the session responder.
*
* @param responder
* @param responder TODO javadoc me please
* the receptor to set
*/
public void setResponder(Jid responder) {
@ -224,7 +225,7 @@ public final class JingleSession extends JingleNegotiator implements MediaReceiv
/**
* Set the session ID
*
* @param sessionId
* @param sessionId TODO javadoc me please
* the sid to set
*/
protected void setSid(String sessionId) {
@ -233,6 +234,8 @@ public final class JingleSession extends JingleNegotiator implements MediaReceiv
/**
* Generate a unique session ID.
*
* @return the generated session ID.
*/
protected static String generateSessionId() {
return String.valueOf(randomGenerator.nextInt(Integer.MAX_VALUE) + randomGenerator.nextInt(Integer.MAX_VALUE));
@ -240,6 +243,8 @@ public final class JingleSession extends JingleNegotiator implements MediaReceiv
/**
* Validate the state changes.
*
* @param stateIs the jingle session state.
*/
public void setSessionState(JingleSessionState stateIs) {
@ -255,6 +260,8 @@ public final class JingleSession extends JingleNegotiator implements MediaReceiv
/**
* Return true if all of the media managers have finished.
*
* @return <code>true</code> if fully established.
*/
public boolean isFullyEstablished() {
boolean result = true;
@ -277,11 +284,11 @@ public final class JingleSession extends JingleNegotiator implements MediaReceiv
* a response. The response will be another Jingle stanza that will be sent
* to the other end point.
*
* @param iq
* @param iq TODO javadoc me please
* the stanza received
* @throws XMPPException
* @throws SmackException
* @throws InterruptedException
* @throws XMPPException if an XMPP protocol error was received.
* @throws SmackException if Smack detected an exceptional situation.
* @throws InterruptedException if the calling thread was interrupted.
*/
public synchronized void receivePacketAndRespond(IQ iq) throws XMPPException, SmackException, InterruptedException {
List<IQ> responses = new ArrayList<>();
@ -346,12 +353,12 @@ public final class JingleSession extends JingleNegotiator implements MediaReceiv
* the stanza type and, depending on the current state, delivering the
* stanza to the right event handler and wait for a response.
*
* @param iq
* @param iq TODO javadoc me please
* the stanza received
* @return the new Jingle stanza to send.
* @throws XMPPException
* @throws SmackException
* @throws InterruptedException
* @throws XMPPException if an XMPP protocol error was received.
* @throws SmackException if Smack detected an exceptional situation.
* @throws InterruptedException if the calling thread was interrupted.
*/
@Override
public List<IQ> dispatchIncomingPacket(IQ iq, String id) throws XMPPException, SmackException, InterruptedException {
@ -395,6 +402,8 @@ public final class JingleSession extends JingleNegotiator implements MediaReceiv
/**
* Add a new content negotiator on behalf of a &lt;content/&gt; section received.
*
* @param inContentNegotiator the content negotiator.
*/
public void addContentNegotiator(ContentNegotiator inContentNegotiator) {
contentNegotiators.add(inContentNegotiator);
@ -424,8 +433,9 @@ public final class JingleSession extends JingleNegotiator implements MediaReceiv
*
* @param jout
* the Jingle stanza we want to complete and send
* @throws NotConnectedException
* @throws InterruptedException
* @return the Jingle stanza.
* @throws NotConnectedException if the XMPP connection is not connected.
* @throws InterruptedException if the calling thread was interrupted.
*/
public Jingle sendFormattedJingle(Jingle jout) throws NotConnectedException, InterruptedException {
return sendFormattedJingle(null, jout);
@ -436,12 +446,11 @@ public final class JingleSession extends JingleNegotiator implements MediaReceiv
* reponse, using the session information we have or some info from the
* incoming packet.
*
* @param iq
* The Jingle stanza we are responding to
* @param jout
* the Jingle stanza we want to complete and send
* @throws NotConnectedException
* @throws InterruptedException
* @param iq The Jingle stanza we are responding to
* @param jout the Jingle stanza we want to complete and send
* @return the Jingle stanza.
* @throws NotConnectedException if the XMPP connection is not connected.
* @throws InterruptedException if the calling thread was interrupted.
*/
public Jingle sendFormattedJingle(IQ iq, Jingle jout) throws NotConnectedException, InterruptedException {
if (jout != null) {
@ -486,8 +495,8 @@ public final class JingleSession extends JingleNegotiator implements MediaReceiv
}
/**
* @param inJingle
* @param inAction
* @param inJingle TODO javadoc me please
* @param inAction TODO javadoc me please
*/
// private void sendUnknownStateAction(Jingle inJingle, JingleActionEnum inAction) {
//
@ -508,8 +517,8 @@ public final class JingleSession extends JingleNegotiator implements MediaReceiv
/**
* Acknowledge a IQ packet.
*
* @param iq
* The IQ to acknowledge
* @param iq The IQ to acknowledge.
* @return the ack IQ.
*/
public IQ createAck(IQ iq) {
IQ result = null;
@ -595,7 +604,7 @@ public final class JingleSession extends JingleNegotiator implements MediaReceiv
/**
* Clean a session from the list.
*
* @param connection
* @param connection TODO javadoc me please
* The connection to clean up
*/
private void unregisterInstanceFor(XMPPConnection connection) {
@ -616,7 +625,7 @@ public final class JingleSession extends JingleNegotiator implements MediaReceiv
/**
* Returns the JingleSession related to a particular connection.
*
* @param con
* @param con TODO javadoc me please
* A XMPP connection
* @return a Jingle session
*/
@ -638,7 +647,7 @@ public final class JingleSession extends JingleNegotiator implements MediaReceiv
/**
* Configure a session, setting some action listeners...
*
* @param connection
* @param connection TODO javadoc me please
* The connection to set up
*/
private void installConnectionListeners(final XMPPConnection connection) {
@ -750,7 +759,7 @@ public final class JingleSession extends JingleNegotiator implements MediaReceiv
/**
* Add a listener for jmf negotiation events.
*
* @param li
* @param li TODO javadoc me please
* The listener
*/
public void addMediaListener(JingleMediaListener li) {
@ -765,7 +774,7 @@ public final class JingleSession extends JingleNegotiator implements MediaReceiv
/**
* Remove a listener for jmf negotiation events.
*
* @param li
* @param li TODO javadoc me please
* The listener
*/
public void removeMediaListener(JingleMediaListener li) {
@ -779,7 +788,7 @@ public final class JingleSession extends JingleNegotiator implements MediaReceiv
/**
* Add a listener for transport negotiation events.
*
* @param li
* @param li TODO javadoc me please
* The listener
*/
public void addTransportListener(JingleTransportListener li) {
@ -793,7 +802,7 @@ public final class JingleSession extends JingleNegotiator implements MediaReceiv
/**
* Remove a listener for transport negotiation events.
*
* @param li
* @param li TODO javadoc me please
* The listener
*/
public void removeTransportListener(JingleTransportListener li) {
@ -883,6 +892,8 @@ public final class JingleSession extends JingleNegotiator implements MediaReceiv
/**
* Trigger a session closed event.
*
* @param reason the reason.
*/
protected void triggerSessionClosed(String reason) {
// for (ContentNegotiator contentNegotiator : contentNegotiators) {
@ -905,6 +916,8 @@ public final class JingleSession extends JingleNegotiator implements MediaReceiv
/**
* Trigger a session closed event due to an error.
*
* @param exc the exception.
*/
protected void triggerSessionClosedOnError(XMPPException exc) {
for (ContentNegotiator contentNegotiator : contentNegotiators) {
@ -938,6 +951,8 @@ public final class JingleSession extends JingleNegotiator implements MediaReceiv
// }
/**
* Trigger a media received event.
*
* @param participant the participant.
*/
protected void triggerMediaReceived(String participant) {
List<JingleListener> listeners = getListenersList();
@ -980,9 +995,9 @@ public final class JingleSession extends JingleNegotiator implements MediaReceiv
/**
* Terminates the session with default reason.
*
* @throws XMPPException
* @throws NotConnectedException
* @throws InterruptedException
* @throws XMPPException if an XMPP protocol error was received.
* @throws NotConnectedException if the XMPP connection is not connected.
* @throws InterruptedException if the calling thread was interrupted.
*/
public void terminate() throws XMPPException, NotConnectedException, InterruptedException {
terminate("Closed Locally");
@ -991,9 +1006,10 @@ public final class JingleSession extends JingleNegotiator implements MediaReceiv
/**
* Terminates the session with a custom reason.
*
* @throws XMPPException
* @throws NotConnectedException
* @throws InterruptedException
* @param reason the reason.
* @throws XMPPException if an XMPP protocol error was received.
* @throws NotConnectedException if the XMPP connection is not connected.
* @throws InterruptedException if the calling thread was interrupted.
*/
public void terminate(String reason) throws XMPPException, NotConnectedException, InterruptedException {
if (isClosed())
@ -1048,6 +1064,7 @@ public final class JingleSession extends JingleNegotiator implements MediaReceiv
* The Jingle stanza we are responding to
* @param jingleError
* the IQ stanza we want to complete and send
* @return the jingle error IQ.
*/
public IQ createJingleError(IQ iq, JingleError jingleError) {
IQ errorPacket = null;
@ -1078,9 +1095,9 @@ public final class JingleSession extends JingleNegotiator implements MediaReceiv
/**
* This is the starting point for intitiating a new session.
*
* @throws IllegalStateException
* @throws SmackException
* @throws InterruptedException
* @throws IllegalStateException if an illegal state was encountered
* @throws SmackException if Smack detected an exceptional situation.
* @throws InterruptedException if the calling thread was interrupted.
*/
public void startOutgoing() throws IllegalStateException, SmackException, InterruptedException {
@ -1168,6 +1185,9 @@ public final class JingleSession extends JingleNegotiator implements MediaReceiv
* The jingle session may have one or more media managers that are trying to establish media sessions.
* When the media manager succeeds in creating a media session is registers it with the session by the
* media manager's static name. This routine is where the media manager does the registering.
*
* @param mediaManagerName the name of the media manager.
* @param mediaSession the jingle media session.
*/
public void addJingleMediaSession(String mediaManagerName, JingleMediaSession mediaSession) {
mediaSessionMap.put(mediaManagerName, mediaSession);
@ -1178,6 +1198,9 @@ public final class JingleSession extends JingleNegotiator implements MediaReceiv
* When the media manager succeeds in creating a media session is registers it with the session by the
* media manager's static name. This routine is where other objects can access the registered media sessions.
* NB: If the media manager has not succeeded in establishing a media session then this could return null.
*
* @param mediaManagerName the name of the media manager.
* @return the jingle media session.
*/
public JingleMediaSession getMediaSession(String mediaManagerName) {
return mediaSessionMap.get(mediaManagerName);

View file

@ -80,6 +80,8 @@ public class JingleSessionRequest {
/**
* Returns the Jingle stanza that was sent by the requester which contains
* the parameters of the session.
*
* @return the jingle stanza.
*/
public Jingle getJingle() {
return jingle;
@ -109,8 +111,9 @@ public class JingleSessionRequest {
*
* @return Returns the IncomingJingleSession on which the
* negotiation can be carried out.
* @throws SmackException
* @throws InterruptedException
* @throws XMPPException if an XMPP protocol error was received.
* @throws SmackException if Smack detected an exceptional situation.
* @throws InterruptedException if the calling thread was interrupted.
*/
public synchronized JingleSession accept() throws XMPPException, SmackException, InterruptedException {
JingleSession session;

View file

@ -36,6 +36,8 @@ public abstract class JingleSessionState {
/**
* Called when entering the state.
*
* @return the jingle session state.
*/
public static JingleSessionState getInstance() {
// Since we can never instantiate this class there is nothing to return (ever).
@ -54,8 +56,14 @@ public abstract class JingleSessionState {
/**
* Process an incoming Jingle Packet.
* When you look at the GoF State pattern this method roughly corresponds to example on p310: ProcessOctect().
* @throws InterruptedException
* When you look at the GoF State pattern this method roughly corresponds to example on p310: ProcessOctect()
*
* @param session the jingle session.
* @param jingle the jingle stanza.
* @param action the jingle action.
* @return the resulting IQ.
* @throws SmackException if Smack detected an exceptional situation.
* @throws InterruptedException if the calling thread was interrupted.
*/
public abstract IQ processJingle(JingleSession session, Jingle jingle, JingleActionEnum action) throws SmackException, InterruptedException;

View file

@ -98,8 +98,8 @@ public class JingleSessionStateUnknown extends JingleSessionState {
/**
* In the UNKNOWN state we received a <session-initiate> action.
* This method processes that action.
* @throws SmackException
* @throws InterruptedException
* @throws SmackException if Smack detected an exceptional situation.
* @throws InterruptedException if the calling thread was interrupted.
*/
private IQ receiveSessionInitiateAction(JingleSession session, Jingle inJingle) throws SmackException, InterruptedException {

View file

@ -30,8 +30,8 @@ public interface JingleMediaListener extends JingleListener {
* Notification that the jmf has been negotiated and established.
*
* @param pt The payload type agreed.
* @throws NotConnectedException
* @throws InterruptedException
* @throws NotConnectedException if the XMPP connection is not connected.
* @throws InterruptedException if the calling thread was interrupted.
*/
void mediaEstablished(PayloadType pt) throws NotConnectedException, InterruptedException;

View file

@ -37,8 +37,8 @@ public interface JingleSessionListener extends JingleListener {
* service.
* @param localCandidate the local candidate where we must listen for connections
* @param jingleSession Session that called the method
* @throws NotConnectedException
* @throws InterruptedException
* @throws NotConnectedException if the XMPP connection is not connected.
* @throws InterruptedException if the calling thread was interrupted.
*/
void sessionEstablished(PayloadType pt, TransportCandidate remoteCandidate,
TransportCandidate localCandidate, JingleSession jingleSession) throws NotConnectedException, InterruptedException;
@ -54,7 +54,7 @@ public interface JingleSessionListener extends JingleListener {
/**
* Notification that the session was redirected.
*
* @param redirection
* @param redirection TODO javadoc me please
* @param jingleSession session that called the method
*/
void sessionRedirected(String redirection, JingleSession jingleSession);

View file

@ -35,8 +35,8 @@ public interface JingleTransportListener extends JingleListener {
* in the local machine
* @param remote The transport candidate that has been used for
* transmitting to the remote machine
* @throws NotConnectedException
* @throws InterruptedException
* @throws NotConnectedException if the XMPP connection is not connected.
* @throws InterruptedException if the calling thread was interrupted.
*/
void transportEstablished(TransportCandidate local,
TransportCandidate remote) throws NotConnectedException, InterruptedException;

View file

@ -56,6 +56,9 @@ public abstract class ContentInfo {
/**
* Returns the MediaInfo constant associated with the String value.
*
* @param value the input string.
* @return the content info.
*/
public static ContentInfo fromString(String value) {
value = value.toLowerCase(Locale.US);

View file

@ -45,7 +45,9 @@ public abstract class JingleMediaManager {
}
/**
* Return The transport manager that goes with this media manager.
* Returns the transport manager that goes with this media manager.
*
* @return the transport manager.
*/
public JingleTransportManager getTransportManager() {
return transportManager;
@ -70,9 +72,10 @@ public abstract class JingleMediaManager {
/**
* Create a Media Session Implementation.
*
* @param payloadType
* @param remote
* @param local
* @param payloadType TODO javadoc me please
* @param remote TODO javadoc me please
* @param local TODO javadoc me please
* @param jingleSession the jingle session.
* @return the media session
*/
public abstract JingleMediaSession createMediaSession(PayloadType payloadType, TransportCandidate remote,

View file

@ -56,6 +56,7 @@ public abstract class JingleMediaSession {
* @param remote Remote accepted Transport Candidate
* @param local Local accepted Transport Candidate
* @param mediaLocator Media Locator of the capture device
* @param jingleSession the jingle session.
*/
public JingleMediaSession(PayloadType payloadType, TransportCandidate remote,
TransportCandidate local, String mediaLocator, JingleSession jingleSession) {
@ -114,7 +115,7 @@ public abstract class JingleMediaSession {
/**
* Adds a Media Received Listener.
*
* @param mediaReceivedListener
* @param mediaReceivedListener TODO javadoc me please
*/
public void addMediaReceivedListener(MediaReceivedListener mediaReceivedListener) {
mediaReceivedListeners.add(mediaReceivedListener);
@ -123,7 +124,7 @@ public abstract class JingleMediaSession {
/**
* Removes a Media Received Listener.
*
* @param mediaReceivedListener
* @param mediaReceivedListener TODO javadoc me please
*/
public void removeMediaReceivedListener(MediaReceivedListener mediaReceivedListener) {
mediaReceivedListeners.remove(mediaReceivedListener);
@ -155,7 +156,7 @@ public abstract class JingleMediaSession {
* Set transmit activity. If the active is true, the instance should trasmit.
* If it is set to false, the instance should pause transmit.
*
* @param active
* @param active TODO javadoc me please
*/
public abstract void setTransmit(boolean active);
@ -171,6 +172,8 @@ public abstract class JingleMediaSession {
/**
* Called when new Media is received.
*
* @param participant the particpant.
*/
public void mediaReceived(String participant) {
for (MediaReceivedListener mediaReceivedListener : mediaReceivedListeners) {

View file

@ -69,8 +69,10 @@ public class MediaNegotiator extends JingleNegotiator {
* but it does not start the negotiation. For starting the negotiation, call
* startNegotiation.
*
* @param session
* The jingle session.
* @param session TODO javadoc me please
* @param mediaManager the media manager.
* @param pts the list of payload types.
* @param parentNegotiator the parent content negotiator.
*/
public MediaNegotiator(JingleSession session, JingleMediaManager mediaManager, List<PayloadType> pts,
ContentNegotiator parentNegotiator) {
@ -89,7 +91,9 @@ public class MediaNegotiator extends JingleNegotiator {
}
/**
* Return The media manager for this negotiator.
* Returns the media manager for this negotiator.
*
* @return the media manager.
*/
public JingleMediaManager getMediaManager() {
return mediaManager;
@ -100,12 +104,12 @@ public class MediaNegotiator extends JingleNegotiator {
* the stanza type and, depending on the current state, delivering the
* stanza to the right event handler and wait for a response.
*
* @param iq
* @param iq TODO javadoc me please
* the stanza received
* @return the new Jingle stanza to send.
* @throws XMPPException
* @throws NotConnectedException
* @throws InterruptedException
* @throws XMPPException if an XMPP protocol error was received.
* @throws NotConnectedException if the XMPP connection is not connected.
* @throws InterruptedException if the calling thread was interrupted.
*/
@Override
public List<IQ> dispatchIncomingPacket(IQ iq, String id) throws XMPPException, NotConnectedException, InterruptedException {
@ -203,10 +207,10 @@ public class MediaNegotiator extends JingleNegotiator {
* This means we can walk through our list, in order, until we find one from their list that matches. This
* will be the best payload type to use.
*
* @param jingle
* @param jingle TODO javadoc me please
* @return the iq
* @throws NotConnectedException
* @throws InterruptedException
* @throws NotConnectedException if the XMPP connection is not connected.
* @throws InterruptedException if the calling thread was interrupted.
*/
private IQ receiveContentAcceptAction(Jingle jingle, JingleDescription description) throws XMPPException, NotConnectedException, InterruptedException {
IQ response;
@ -233,8 +237,8 @@ public class MediaNegotiator extends JingleNegotiator {
/**
* Receive a session-initiate packet.
* @param jingle
* @param description
* @param jingle TODO javadoc me please
* @param description TODO javadoc me please
* @return the iq
*/
private IQ receiveSessionInitiateAction(Jingle jingle, JingleDescription description) {
@ -264,7 +268,7 @@ public class MediaNegotiator extends JingleNegotiator {
* A content info has been received. This is done for publishing the
* list of payload types...
*
* @param jingle
* @param jingle TODO javadoc me please
* The input packet
* @return a Jingle packet
* @throws JingleException
@ -304,7 +308,7 @@ public class MediaNegotiator extends JingleNegotiator {
* A jmf description has been accepted. In this case, we must save the
* accepted payload type and notify any listener...
*
* @param jin
* @param jin TODO javadoc me please
* The input packet
* @return a Jingle packet
* @throws JingleException
@ -409,7 +413,7 @@ public class MediaNegotiator extends JingleNegotiator {
/**
* Adds a payload type to the list of remote payloads.
*
* @param pt
* @param pt TODO javadoc me please
* the remote payload type
*/
public void addRemoteAudioPayloadType(PayloadType.Audio pt) {
@ -475,10 +479,10 @@ public class MediaNegotiator extends JingleNegotiator {
/**
* Trigger a session established event.
*
* @param bestPt
* @param bestPt TODO javadoc me please
* payload type that has been agreed.
* @throws NotConnectedException
* @throws InterruptedException
* @throws NotConnectedException if the XMPP connection is not connected.
* @throws InterruptedException if the calling thread was interrupted.
*/
protected void triggerMediaEstablished(PayloadType bestPt) throws NotConnectedException, InterruptedException {
List<JingleListener> listeners = getListenersList();
@ -493,7 +497,7 @@ public class MediaNegotiator extends JingleNegotiator {
/**
* Trigger a jmf closed event.
*
* @param currPt
* @param currPt TODO javadoc me please
* current payload type that is cancelled.
*/
protected void triggerMediaClosed(PayloadType currPt) {
@ -525,6 +529,8 @@ public class MediaNegotiator extends JingleNegotiator {
/**
* Create a JingleDescription that matches this negotiator.
*
* @return the jingle description.
*/
public JingleDescription getJingleDescription() {
JingleDescription result = null;

View file

@ -23,6 +23,8 @@ public interface MediaReceivedListener {
/**
* Called when new Media is received.
*
* @param participant the participant.
*/
void mediaReceived(String participant);

View file

@ -100,6 +100,7 @@ public class AudioChannel {
* @param localPort local port number
* @param remotePort remote port number
* @param format audio format
* @param jingleMediaSession the jingle media session.
*/
public AudioChannel(MediaLocator locator,
String localIpAddress,
@ -312,10 +313,10 @@ public class AudioChannel {
/**
* Get the best stanza size for a given codec and a codec rate
*
* @param codecFormat
* @param milliseconds
* @param codecFormat TODO javadoc me please
* @param milliseconds TODO javadoc me please
* @return the best stanza size
* @throws IllegalArgumentException
* @throws IllegalArgumentException if an illegal argument was given.
*/
private int getPacketSize(Format codecFormat, int milliseconds) throws IllegalArgumentException {
String encoding = codecFormat.getEncoding();
@ -336,7 +337,7 @@ public class AudioChannel {
* Use the RTPManager API to create sessions for each jmf
* track of the processor.
*
* @return description
* @return description TODO javadoc me please
*/
private String createTransmitter() {

View file

@ -51,6 +51,7 @@ public class AudioMediaSession extends JingleMediaSession {
* @param remote the remote information. The candidate that the jmf will be sent to.
* @param local the local information. The candidate that will receive the jmf
* @param locator media locator
* @param jingleSession the jingle session.
*/
public AudioMediaSession(final PayloadType payloadType, final TransportCandidate remote,
final TransportCandidate local, String locator, JingleSession jingleSession) {

View file

@ -50,6 +50,8 @@ public class JmfMediaManager extends JingleMediaManager {
/**
* Creates a Media Manager instance.
*
* @param transportManager the transport manger.
*/
public JmfMediaManager(JingleTransportManager transportManager) {
super(transportManager);
@ -60,6 +62,7 @@ public class JmfMediaManager extends JingleMediaManager {
* Creates a Media Manager instance.
*
* @param mediaLocator Media Locator
* @param transportManager the transport manger.
*/
public JmfMediaManager(String mediaLocator, JingleTransportManager transportManager) {
super(transportManager);
@ -73,7 +76,7 @@ public class JmfMediaManager extends JingleMediaManager {
* @param payloadType payloadType
* @param remote remote Candidate
* @param local local Candidate
* @return JingleMediaSession
* @return JingleMediaSession TODO javadoc me please
*/
@Override
public JingleMediaSession createMediaSession(final PayloadType payloadType, final TransportCandidate remote, final TransportCandidate local, final JingleSession jingleSession) {

View file

@ -67,11 +67,11 @@ public class AudioMediaSession extends JingleMediaSession implements MediaSessio
* @param quality quality
* @param secure secure
* @param micOn micOn
* @return MediaSession
* @throws NoProcessorException
* @throws UnsupportedFormatException
* @throws IOException
* @throws GeneralSecurityException
* @return MediaSession TODO javadoc me please
* @throws NoProcessorException if there is no media processor.
* @throws UnsupportedFormatException if the format is not supported.
* @throws IOException if an I/O error occured.
* @throws GeneralSecurityException if there was a geneeral security exception.
*/
public static MediaSession createSession(String localhost, int localPort, String remoteHost, int remotePort, MediaSessionListener eventHandler, int quality, boolean secure, boolean micOn) throws NoProcessorException, UnsupportedFormatException, IOException, GeneralSecurityException {
@ -102,6 +102,7 @@ public class AudioMediaSession extends JingleMediaSession implements MediaSessio
* @param remote the remote information. The candidate that the jmf will be sent to.
* @param local the local information. The candidate that will receive the jmf
* @param locator media locator
* @param jingleSession the jingle session.
*/
public AudioMediaSession(final PayloadType payloadType, final TransportCandidate remote,
final TransportCandidate local, String locator, JingleSession jingleSession) {

View file

@ -58,7 +58,7 @@ public class SpeexMediaManager extends JingleMediaManager {
* @param payloadType payloadType
* @param remote remote Candidate
* @param local local Candidate
* @return JingleMediaSession
* @return JingleMediaSession TODO javadoc me please
*/
@Override
public JingleMediaSession createMediaSession(PayloadType payloadType, final TransportCandidate remote, final TransportCandidate local, final JingleSession jingleSession) {

View file

@ -64,6 +64,7 @@ public class ScreenShareSession extends JingleMediaSession {
* @param remote the remote information. The candidate that the jmf will be sent to.
* @param local the local information. The candidate that will receive the jmf
* @param locator media locator
* @param jingleSession the jingle session.
*/
public ScreenShareSession(final PayloadType payloadType, final TransportCandidate remote, final TransportCandidate local,
final String locator, JingleSession jingleSession) {

View file

@ -196,7 +196,7 @@ public class ImageTransmitter implements Runnable {
/**
* Get the encoder used to encode Images Tiles.
*
* @return encoder
* @return encoder TODO javadoc me please
*/
public ImageEncoder getEncoder() {
return encoder;

View file

@ -52,6 +52,9 @@ public class PixelUtils {
/**
* Clamp a value to the range 0..255.
*
* @param c the input integer.
* @return the output integer.
*/
public static int clamp(int c) {
if (c < 0)

View file

@ -35,6 +35,7 @@ public class TestMediaSession extends JingleMediaSession {
* @param remote the remote information. The candidate that the jmf will be sent to.
* @param local the local information. The candidate that will receive the jmf
* @param locator media locator
* @param jingleSession the jingle session.
*/
public TestMediaSession(final PayloadType payloadType, final TransportCandidate remote, final TransportCandidate local,
final String locator, JingleSession jingleSession) {

View file

@ -48,8 +48,8 @@ public class BasicResolver extends TransportResolver {
*
* The BasicResolver takes the IP addresses of the interfaces and uses the
* first non-loopback, non-linklocal and non-sitelocal address.
* @throws NotConnectedException
* @throws InterruptedException
* @throws NotConnectedException if the XMPP connection is not connected.
* @throws InterruptedException if the calling thread was interrupted.
*/
@Override
public synchronized void resolve(JingleSession session) throws XMPPException, NotConnectedException, InterruptedException {

View file

@ -54,18 +54,20 @@ public class BridgedResolver extends TransportResolver {
/**
* Constructor.
* A Bridged Resolver need an XMPPConnection to connect to a RTP Bridge.
*
* @param connection the XMPP connection.
*/
public BridgedResolver(XMPPConnection connection) {
super();
this.connection = connection;
}
/**1
/**
* Resolve Bridged Candidate.
*
* The BridgedResolver takes the IP address and ports of a jmf proxy service.
* @throws NotConnectedException
* @throws InterruptedException
* @throws NotConnectedException if the XMPP connection is not connected.
* @throws InterruptedException if the calling thread was interrupted.
*/
@Override
public synchronized void resolve(JingleSession session) throws XMPPException, NotConnectedException, InterruptedException {

View file

@ -46,7 +46,7 @@ public class BridgedTransportManager extends JingleTransportManager implements J
* Return the correspondent resolver
*
* @param session correspondent Jingle Session
* @return resolver
* @return resolver TODO javadoc me please
*/
@Override
protected TransportResolver createResolver(JingleSession session) {

View file

@ -34,6 +34,9 @@ public class FixedResolver extends TransportResolver {
/**
* Constructor.
*
* @param ip the IP address.
* @param port the port number.
*/
public FixedResolver(String ip, int port) {
super();
@ -52,8 +55,8 @@ public class FixedResolver extends TransportResolver {
/**
* Resolve the IP address.
* @throws NotConnectedException
* @throws InterruptedException
* @throws NotConnectedException if the XMPP connection is not connected.
* @throws InterruptedException if the calling thread was interrupted.
*/
@Override
public synchronized void resolve(JingleSession session) throws XMPPException, NotConnectedException, InterruptedException {
@ -76,7 +79,7 @@ public class FixedResolver extends TransportResolver {
/**
* Initialize the resolver.
*
* @throws XMPPException
* @throws XMPPException if an XMPP protocol error was received.
*/
@Override
public void initialize() throws XMPPException {

View file

@ -96,8 +96,8 @@ public class ICEResolver extends TransportResolver {
/**
* Resolve the IP and obtain a valid transport method.
* @throws SmackException
* @throws InterruptedException
* @throws SmackException if Smack detected an exceptional situation.
* @throws InterruptedException if the calling thread was interrupted.
*/
@Override
public synchronized void resolve(JingleSession session) throws XMPPException, SmackException, InterruptedException {

View file

@ -51,8 +51,11 @@ public abstract class JingleTransportManager {
/**
* Get a new Transport Resolver to be used in a Jingle Session.
*
* @param session the jingle session.
* @return the TransportResolver to be used
* @throws InterruptedException
* @throws XMPPException if an XMPP protocol error was received.
* @throws SmackException if Smack detected an exceptional situation.
* @throws InterruptedException if the calling thread was interrupted.
*/
public TransportResolver getResolver(JingleSession session) throws XMPPException, SmackException, InterruptedException {
TransportResolver resolver = createResolver(session);
@ -67,8 +70,10 @@ public abstract class JingleTransportManager {
/**
* Create a Transport Resolver instance according to the implementation.
*
* @param session the jingle session.
* @return the TransportResolver
* @throws InterruptedException
* @throws SmackException if Smack detected an exceptional situation.
* @throws InterruptedException if the calling thread was interrupted.
*/
protected abstract TransportResolver createResolver(JingleSession session) throws SmackException, InterruptedException;

View file

@ -92,7 +92,7 @@ public class RTPBridge extends IQ {
/**
* Creates a RTPBridge Instance with defined Session ID.
*
* @param sid
* @param sid TODO javadoc me please
*/
public RTPBridge(String sid) {
this();
@ -102,7 +102,7 @@ public class RTPBridge extends IQ {
/**
* Creates a RTPBridge Instance with defined Session ID.
*
* @param action
* @param action TODO javadoc me please
*/
public RTPBridge(BridgeAction action) {
this();
@ -112,8 +112,8 @@ public class RTPBridge extends IQ {
/**
* Creates a RTPBridge Instance with defined Session ID.
*
* @param sid
* @param bridgeAction
* @param sid TODO javadoc me please
* @param bridgeAction TODO javadoc me please
*/
public RTPBridge(String sid, BridgeAction bridgeAction) {
this();
@ -130,6 +130,8 @@ public class RTPBridge extends IQ {
/**
* Get the attributes string.
*
* @return the attributes.
*/
public String getAttributes() {
StringBuilder str = new StringBuilder();
@ -167,7 +169,7 @@ public class RTPBridge extends IQ {
/**
* Set the Session ID of the Stanza (usually same as Jingle Session ID).
*
* @param sid
* @param sid TODO javadoc me please
*/
public void setSid(String sid) {
this.sid = sid;
@ -185,7 +187,7 @@ public class RTPBridge extends IQ {
/**
* Set the Host A IP Address.
*
* @param hostA
* @param hostA TODO javadoc me please
*/
public void setHostA(String hostA) {
this.hostA = hostA;
@ -203,7 +205,7 @@ public class RTPBridge extends IQ {
/**
* Set the Host B IP Address.
*
* @param hostB
* @param hostB TODO javadoc me please
*/
public void setHostB(String hostB) {
this.hostB = hostB;
@ -221,7 +223,7 @@ public class RTPBridge extends IQ {
/**
* Set Side A receive port.
*
* @param portA
* @param portA TODO javadoc me please
*/
public void setPortA(int portA) {
this.portA = portA;
@ -239,7 +241,7 @@ public class RTPBridge extends IQ {
/**
* Set Side B receive port.
*
* @param portB
* @param portB TODO javadoc me please
*/
public void setPortB(int portB) {
this.portB = portB;
@ -257,7 +259,7 @@ public class RTPBridge extends IQ {
/**
* Set the RTP Bridge IP.
*
* @param ip
* @param ip TODO javadoc me please
*/
public void setIp(String ip) {
this.ip = ip;
@ -275,7 +277,7 @@ public class RTPBridge extends IQ {
/**
* Set the RTP Agent Pass.
*
* @param pass
* @param pass TODO javadoc me please
*/
public void setPass(String pass) {
this.pass = pass;
@ -293,7 +295,7 @@ public class RTPBridge extends IQ {
/**
* Set the name of the Candidate.
*
* @param name
* @param name TODO javadoc me please
*/
public void setName(String name) {
this.name = name;
@ -389,11 +391,11 @@ public class RTPBridge extends IQ {
* Get a new RTPBridge Candidate from the server.
* If a error occurs or the server don't support RTPBridge Service, null is returned.
*
* @param connection
* @param sessionID
* @param connection TODO javadoc me please
* @param sessionID TODO javadoc me please
* @return the new RTPBridge
* @throws NotConnectedException
* @throws InterruptedException
* @throws NotConnectedException if the XMPP connection is not connected.
* @throws InterruptedException if the calling thread was interrupted.
*/
@SuppressWarnings("deprecation")
public static RTPBridge getRTPBridge(XMPPConnection connection, String sessionID) throws NotConnectedException, InterruptedException {
@ -418,12 +420,12 @@ public class RTPBridge extends IQ {
/**
* Check if the server support RTPBridge Service.
*
* @param connection
* @param connection TODO javadoc me please
* @return true if the server supports the RTPBridge service
* @throws XMPPErrorException
* @throws NoResponseException
* @throws NotConnectedException
* @throws InterruptedException
* @throws XMPPErrorException if there was an XMPP error returned.
* @throws NoResponseException if there was no response from the remote entity.
* @throws NotConnectedException if the XMPP connection is not connected.
* @throws InterruptedException if the calling thread was interrupted.
*/
public static boolean serviceAvailable(XMPPConnection connection) throws NoResponseException,
XMPPErrorException, NotConnectedException, InterruptedException {
@ -458,10 +460,14 @@ public class RTPBridge extends IQ {
/**
* Check if the server support RTPBridge Service.
*
* @param connection
* @param connection TODO javadoc me please
* @param sessionID the session id.
* @param pass the password.
* @param proxyCandidate the proxy candidate.
* @param localCandidate the local candidate.
* @return the RTPBridge
* @throws NotConnectedException
* @throws InterruptedException
* @throws NotConnectedException if the XMPP connection is not connected.
* @throws InterruptedException if the calling thread was interrupted.
*/
@SuppressWarnings("deprecation")
public static RTPBridge relaySession(XMPPConnection connection, String sessionID, String pass, TransportCandidate proxyCandidate, TransportCandidate localCandidate) throws NotConnectedException, InterruptedException {
@ -495,10 +501,10 @@ public class RTPBridge extends IQ {
/**
* Get Public Address from the Server.
*
* @param xmppConnection
* @param xmppConnection TODO javadoc me please
* @return public IP String or null if not found
* @throws NotConnectedException
* @throws InterruptedException
* @throws NotConnectedException if the XMPP connection is not connected.
* @throws InterruptedException if the calling thread was interrupted.
*/
@SuppressWarnings("deprecation")
public static String getPublicIP(XMPPConnection xmppConnection) throws NotConnectedException, InterruptedException {

View file

@ -101,7 +101,7 @@ public class STUN extends SimpleIQ {
/**
* Set Public Ip returned from the XMPP server
*
* @param publicIp
* @param publicIp TODO javadoc me please
*/
private void setPublicIp(String publicIp) {
this.publicIp = publicIp;
@ -172,10 +172,10 @@ public class STUN extends SimpleIQ {
* Get a new STUN Server Address and port from the server.
* If a error occurs or the server don't support STUN Service, null is returned.
*
* @param connection
* @param connection TODO javadoc me please
* @return the STUN server address
* @throws NotConnectedException
* @throws InterruptedException
* @throws NotConnectedException if the XMPP connection is not connected.
* @throws InterruptedException if the calling thread was interrupted.
*/
@SuppressWarnings("deprecation")
public static STUN getSTUNServer(XMPPConnection connection) throws NotConnectedException, InterruptedException {
@ -202,9 +202,9 @@ public class STUN extends SimpleIQ {
*
* @param connection the connection
* @return true if the server support STUN
* @throws SmackException
* @throws XMPPException
* @throws InterruptedException
* @throws SmackException if Smack detected an exceptional situation.
* @throws XMPPException if an XMPP protocol error was received.
* @throws InterruptedException if the calling thread was interrupted.
*/
public static boolean serviceAvailable(XMPPConnection connection) throws XMPPException, SmackException, InterruptedException {

View file

@ -263,8 +263,8 @@ public class STUNResolver extends TransportResolver {
/**
* Resolve the IP and obtain a valid transport method.
* @throws NotConnectedException
* @throws InterruptedException
* @throws NotConnectedException if the XMPP connection is not connected.
* @throws InterruptedException if the calling thread was interrupted.
*/
@Override
public synchronized void resolve(JingleSession session) throws XMPPException, NotConnectedException, InterruptedException {
@ -288,7 +288,7 @@ public class STUNResolver extends TransportResolver {
/**
* Initialize the resolver.
*
* @throws XMPPException
* @throws XMPPException if an XMPP protocol error was received.
*/
@Override
public void initialize() throws XMPPException {

View file

@ -117,7 +117,7 @@ public abstract class TransportCandidate {
/**
* Set local IP to bind to this candidate.
*
* @param localIp
* @param localIp TODO javadoc me please
*/
public void setLocalIp(String localIp) {
this.localIp = localIp;
@ -135,7 +135,7 @@ public abstract class TransportCandidate {
/**
* Set the symmetric candidate for this candidate.
*
* @param symmetric
* @param symmetric TODO javadoc me please
*/
public void setSymmetric(TransportCandidate symmetric) {
this.symmetric = symmetric;
@ -171,7 +171,7 @@ public abstract class TransportCandidate {
/**
* Set the XMPPConnection use to send or receive this candidate.
*
* @param connection
* @param connection TODO javadoc me please
*/
public void setConnection(XMPPConnection connection) {
this.connection = connection;
@ -189,7 +189,7 @@ public abstract class TransportCandidate {
/**
* Set the jingle's sessionId that is using this candidate.
*
* @param sessionId
* @param sessionId TODO javadoc me please
*/
public void setSessionId(String sessionId) {
this.sessionId = sessionId;
@ -349,6 +349,8 @@ public abstract class TransportCandidate {
* usable.
*
* Subclasses should provide better methods if they can...
*
* @param localCandidates a list of local candidates.
*/
@SuppressWarnings("UnusedVariable")
public void check(final List<TransportCandidate> localCandidates) {
@ -474,6 +476,9 @@ public abstract class TransportCandidate {
/**
* Returns the Protocol constant associated with the String value.
*
* @param value the input String.
* @return the protocol.
*/
public static Protocol fromString(String value) {
if (value == null) {
@ -563,6 +568,9 @@ public abstract class TransportCandidate {
/**
* Returns the MediaChannel constant associated with the String value.
*
* @param value the input String.
* @return the channel.
*/
public static Channel fromString(String value) {
if (value == null) {

View file

@ -94,6 +94,7 @@ public abstract class TransportNegotiator extends JingleNegotiator {
*
* @param session The Jingle session
* @param transResolver The JingleTransportManager to use
* @param parentNegotiator the parent ngeotiator.
*/
public TransportNegotiator(JingleSession session, TransportResolver transResolver, ContentNegotiator parentNegotiator) {
super(session);
@ -108,6 +109,7 @@ public abstract class TransportNegotiator extends JingleNegotiator {
* Get a new instance of the right TransportNegotiator class with this
* candidate.
*
* @param cand the transport candidate.
* @return A TransportNegotiator instance
*/
public abstract JingleTransport getJingleTransport(TransportCandidate cand);
@ -116,6 +118,8 @@ public abstract class TransportNegotiator extends JingleNegotiator {
* Return true if the transport candidate is acceptable for the current
* negotiator.
*
* @param tc the transport candidate.
* @param localCandidates a list of local transport candidates.
* @return true if the transport candidate is acceptable
*/
public abstract boolean acceptableTransportCandidate(TransportCandidate tc, List<TransportCandidate> localCandidates);
@ -184,6 +188,8 @@ public abstract class TransportNegotiator extends JingleNegotiator {
/**
* Return a JingleTransport that best reflects this transport negotiator.
*
* @return the jingle transport.
*/
public JingleTransport getJingleTransport() {
return getJingleTransport(getBestRemoteCandidate());
@ -531,9 +537,9 @@ public abstract class TransportNegotiator extends JingleNegotiator {
/**
* Send an offer for a transport candidate
*
* @param cand
* @throws NotConnectedException
* @throws InterruptedException
* @param cand TODO javadoc me please
* @throws NotConnectedException if the XMPP connection is not connected.
* @throws InterruptedException if the calling thread was interrupted.
*/
private synchronized void sendTransportCandidateOffer(TransportCandidate cand) throws NotConnectedException, InterruptedException {
if (!cand.isNull()) {
@ -554,9 +560,9 @@ public abstract class TransportNegotiator extends JingleNegotiator {
/**
* Create a Jingle stanza where we announce our transport candidates.
*
* @throws XMPPException
* @throws SmackException
* @throws InterruptedException
* @throws XMPPException if an XMPP protocol error was received.
* @throws SmackException if Smack detected an exceptional situation.
* @throws InterruptedException if the calling thread was interrupted.
*/
private void sendTransportCandidatesOffer() throws XMPPException, SmackException, InterruptedException {
List<TransportCandidate> notOffered = resolver.getCandidatesList();
@ -603,9 +609,9 @@ public abstract class TransportNegotiator extends JingleNegotiator {
*
* @param iq the stanza received
* @return the new Jingle stanza to send.
* @throws XMPPException
* @throws SmackException
* @throws InterruptedException
* @throws XMPPException if an XMPP protocol error was received.
* @throws SmackException if Smack detected an exceptional situation.
* @throws InterruptedException if the calling thread was interrupted.
*/
@Override
public final List<IQ> dispatchIncomingPacket(IQ iq, String id) throws XMPPException, SmackException, InterruptedException {
@ -675,9 +681,9 @@ public abstract class TransportNegotiator extends JingleNegotiator {
* offering a list of candidates.
*
* @return an IQ packet
* @throws XMPPException
* @throws SmackException
* @throws InterruptedException
* @throws XMPPException if an XMPP protocol error was received.
* @throws SmackException if Smack detected an exceptional situation.
* @throws InterruptedException if the calling thread was interrupted.
*/
private Jingle receiveResult(IQ iq) throws XMPPException, SmackException, InterruptedException {
Jingle response = null;
@ -689,10 +695,10 @@ public abstract class TransportNegotiator extends JingleNegotiator {
}
/**
* @param jingle
* @param jingle TODO javadoc me please
* @return the iq
* @throws SmackException
* @throws InterruptedException
* @throws SmackException if Smack detected an exceptional situation.
* @throws InterruptedException if the calling thread was interrupted.
*/
private IQ receiveSessionInitiateAction(Jingle jingle) throws XMPPException, SmackException, InterruptedException {
IQ response = null;
@ -714,7 +720,7 @@ public abstract class TransportNegotiator extends JingleNegotiator {
}
/**
* @param jingle
* @param jingle TODO javadoc me please
* @return the iq
*/
private IQ receiveTransportInfoAction(Jingle jingle) {
@ -775,7 +781,7 @@ public abstract class TransportNegotiator extends JingleNegotiator {
}
/**
* @param jingle
* @param jingle TODO javadoc me please
* @return the iq
*/
private static IQ receiveSessionAcceptAction(Jingle jingle) {
@ -794,8 +800,8 @@ public abstract class TransportNegotiator extends JingleNegotiator {
*
* @param local TransportCandidate that has been agreed.
* @param remote TransportCandidate that has been agreed.
* @throws NotConnectedException
* @throws InterruptedException
* @throws NotConnectedException if the XMPP connection is not connected.
* @throws InterruptedException if the calling thread was interrupted.
*/
private void triggerTransportEstablished(TransportCandidate local, TransportCandidate remote) throws NotConnectedException, InterruptedException {
List<JingleListener> listeners = getListenersList();
@ -838,6 +844,7 @@ public abstract class TransportNegotiator extends JingleNegotiator {
*
* @param js The Jingle session this negotiation belongs to.
* @param res The transport resolver to use.
* @param parentNegotiator the parent content negotiator.
*/
public RawUdp(JingleSession js, final TransportResolver res, ContentNegotiator parentNegotiator) {
super(js, res, parentNegotiator);
@ -893,6 +900,7 @@ public abstract class TransportNegotiator extends JingleNegotiator {
*
* @param js The Jingle session this negotiation belongs to.
* @param res The transport manager to use.
* @param parentNegotiator the parent content negotiator.
*/
public Ice(JingleSession js, final TransportResolver res, ContentNegotiator parentNegotiator) {
super(js, res, parentNegotiator);
@ -901,7 +909,7 @@ public abstract class TransportNegotiator extends JingleNegotiator {
/**
* Get a TransportNegotiator instance.
*
* @param candidate
* @param candidate TODO javadoc me please
*/
@Override
public org.jivesoftware.smackx.jingleold.packet.JingleTransport getJingleTransport(TransportCandidate candidate) {

View file

@ -90,20 +90,27 @@ public abstract class TransportResolver {
/**
* Initialize the Resolver.
* @throws InterruptedException
*
* @throws XMPPException if an XMPP protocol error was received.
* @throws SmackException if Smack detected an exceptional situation.
* @throws InterruptedException if the calling thread was interrupted.
*/
public abstract void initialize() throws XMPPException, SmackException, InterruptedException;
/**
* Start a the resolution.
* @throws InterruptedException
*
* @param session the Jingle session.
* @throws XMPPException if an XMPP protocol error was received.
* @throws SmackException if Smack detected an exceptional situation.
* @throws InterruptedException if the calling thread was interrupted.
*/
public abstract void resolve(JingleSession session) throws XMPPException, SmackException, InterruptedException;
/**
* Clear the list of candidates and start a new resolution process.
*
* @throws XMPPException
* @throws XMPPException if an XMPP protocol error was received.
*/
public void clear() throws XMPPException {
cancel();
@ -112,6 +119,8 @@ public abstract class TransportResolver {
/**
* Cancel any asynchronous resolution operation.
*
* @throws XMPPException if an XMPP protocol error was received.
*/
public abstract void cancel() throws XMPPException;
@ -211,8 +220,8 @@ public abstract class TransportResolver {
* Trigger a new candidate added event.
*
* @param cand The candidate added to the list of candidates.
* @throws NotConnectedException
* @throws InterruptedException
* @throws NotConnectedException if the XMPP connection is not connected.
* @throws InterruptedException if the calling thread was interrupted.
*/
protected void triggerCandidateAdded(TransportCandidate cand) throws NotConnectedException, InterruptedException {
Iterator<TransportResolverListener> iter = getListenersList().iterator();
@ -269,8 +278,8 @@ public abstract class TransportResolver {
* Add a new transport candidate
*
* @param cand The candidate to add
* @throws NotConnectedException
* @throws InterruptedException
* @throws NotConnectedException if the XMPP connection is not connected.
* @throws InterruptedException if the calling thread was interrupted.
*/
protected void addCandidate(TransportCandidate cand) throws NotConnectedException, InterruptedException {
synchronized (candidates) {
@ -347,6 +356,7 @@ public abstract class TransportResolver {
/**
* Get the n-th candidate.
*
* @param i the index of the candidate.
* @return a transport candidate
*/
public TransportCandidate getCandidate(int i) {
@ -360,8 +370,10 @@ public abstract class TransportResolver {
/**
* Initialize Transport Resolver and wait until it is completely uninitialized.
* @throws SmackException
* @throws InterruptedException
*
* @throws XMPPException if an XMPP protocol error was received.
* @throws SmackException if Smack detected an exceptional situation.
* @throws InterruptedException if the calling thread was interrupted.
*/
public void initializeAndWait() throws XMPPException, SmackException, InterruptedException {
this.initialize();

View file

@ -35,8 +35,8 @@ public interface TransportResolverListener {
* A transport candidate has been added.
*
* @param cand The transport candidate.
* @throws NotConnectedException
* @throws InterruptedException
* @throws NotConnectedException if the XMPP connection is not connected.
* @throws InterruptedException if the calling thread was interrupted.
*/
void candidateAdded(TransportCandidate cand) throws NotConnectedException, InterruptedException;

View file

@ -66,6 +66,10 @@ public class Jingle extends IQ {
/**
* A constructor where the main components can be initialized.
*
* @param contents the contents.
* @param mi the jingle content info
* @param sid the sid.
*/
public Jingle(final List<JingleContent> contents, final JingleContentInfo mi,
final String sid) {

View file

@ -41,7 +41,10 @@ public class JingleContent implements ExtensionElement {
private final List<JingleTransport> transports = new ArrayList<>();
/**
* Creates a content description..
* Creates a content description.
*
* @param creator the creator.
* @param name the name.
*/
public JingleContent(String creator, String name) {
super();
@ -81,7 +84,7 @@ public class JingleContent implements ExtensionElement {
/**
* Sets the description for this Jingle content.
*
* @param description
* @param description TODO javadoc me please
* The description
*/
public void setDescription(JingleDescription description) {
@ -100,7 +103,7 @@ public class JingleContent implements ExtensionElement {
/**
* Adds a JingleTransport type to the packet.
*
* @param transport
* @param transport TODO javadoc me please
* the JingleTransport to add.
*/
public void addJingleTransport(final JingleTransport transport) {
@ -112,7 +115,7 @@ public class JingleContent implements ExtensionElement {
/**
* Adds a list of transports to add to the packet.
*
* @param transports
* @param transports TODO javadoc me please
* the transports to add.
*/
public void addTransports(final List<JingleTransport> transports) {

View file

@ -181,6 +181,8 @@ public abstract class JingleContentDescription implements ExtensionElement {
/**
* Utility constructor, with a JinglePayloadType.
*
* @param pt the payload type.
*/
public Audio(final JinglePayloadType pt) {
super();

View file

@ -188,6 +188,8 @@ public abstract class JingleDescription implements ExtensionElement {
/**
* Utility constructor, with a PayloadType.
*
* @param pt the payload type.
*/
public Audio(final PayloadType pt) {
super();

View file

@ -89,6 +89,9 @@ public class JingleError implements ExtensionElement {
/**
* Returns a Action instance associated with the String value.
*
* @param value the input string.
* @return the jingle error.
*/
public static JingleError fromString(String value) {
if (value != null) {

View file

@ -314,6 +314,8 @@ public class JingleTransport implements ExtensionElement {
/**
* Constructor with a transport candidate.
*
* @param tc the transport candidate.
*/
public Candidate(final TransportCandidate tc) {
super(tc);
@ -403,6 +405,8 @@ public class JingleTransport implements ExtensionElement {
/**
* Constructor with a transport candidate.
*
* @param tc the transport candidate.
*/
public Candidate(final TransportCandidate tc) {
super(tc);

View file

@ -65,8 +65,8 @@ public abstract class JingleContentDescriptionProvider extends ExtensionElementP
*
* @param parser the input to parse
* @return a description element
* @throws IOException
* @throws XmlPullParserException
* @throws IOException if an I/O error occured.
* @throws XmlPullParserException if an error in the XML parser occured.
*/
@Override
public JingleContentDescription parse(XmlPullParser parser,
@ -98,6 +98,8 @@ public abstract class JingleContentDescriptionProvider extends ExtensionElementP
/**
* Return a new instance of this class. Subclasses must overwrite this
* method.
*
* @return the jingle content description.
*/
protected abstract JingleContentDescription getInstance();

View file

@ -36,7 +36,7 @@ public abstract class JingleDescriptionProvider extends ExtensionElementProvider
/**
* Parse a iq/jingle/description/payload-type element.
*
* @param parser
* @param parser TODO javadoc me please
* the input to parse
* @return a payload type element
*/
@ -63,11 +63,11 @@ public abstract class JingleDescriptionProvider extends ExtensionElementProvider
/**
* Parse a iq/jingle/description element.
*
* @param parser
* @param parser TODO javadoc me please
* the input to parse
* @return a description element
* @throws IOException
* @throws XmlPullParserException
* @throws IOException if an I/O error occured.
* @throws XmlPullParserException if an error in the XML parser occured.
*/
@Override
public JingleDescription parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException {
@ -97,6 +97,8 @@ public abstract class JingleDescriptionProvider extends ExtensionElementProvider
/**
* Return a new instance of this class. Subclasses must overwrite this
* method.
*
* @return the jingle description.
*/
protected abstract JingleDescription getInstance();

View file

@ -45,9 +45,9 @@ public class JingleProvider extends IQProvider<Jingle> {
/**
* Parse a iq/jingle element.
* @throws XmlPullParserException
* @throws IOException
* @throws SmackParsingException
* @throws XmlPullParserException if an error in the XML parser occured.
* @throws IOException if an I/O error occured.
* @throws SmackParsingException if the Smack parser (provider) encountered invalid input.
*/
@Override
public Jingle parse(XmlPullParser parser, int intialDepth, XmlEnvironment xmlEnvironment) throws IOException, XmlPullParserException, SmackParsingException {

View file

@ -49,8 +49,8 @@ public abstract class JingleTransportProvider extends ExtensionElementProvider<J
*
* @param parser the structure to parse
* @return a transport element.
* @throws IOException
* @throws XmlPullParserException
* @throws IOException if an I/O error occured.
* @throws XmlPullParserException if an error in the XML parser occured.
*/
@Override
public JingleTransport parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException {