mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-09 17:19:39 +02:00
Rework Smack Provider design
this is the first stop towards fixing "SMACK-65: parsing should look for depth", by providing the initial parsing depth to the provider. Some methods (.e.g parseMessage) now use the depth as abort condition, instead of a unclean String equals check. parseIQ() and parseExtension() where both renamed to parse. This also restricts the Exceptions thrown by the parse method, to just XmlPullParserException, IOException and SmackException (not really a big victory, but nevertheless a slight improvement). StreamFeatureProvider is now gone, we simply use PacketExtensionProvider for stream features.
This commit is contained in:
parent
d04517cd08
commit
6980c8e63d
137 changed files with 1101 additions and 841 deletions
|
@ -17,12 +17,14 @@
|
|||
|
||||
package org.jivesoftware.smackx.jingleold.nat;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.InetAddress;
|
||||
import java.net.NetworkInterface;
|
||||
import java.net.SocketException;
|
||||
import java.util.Enumeration;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.jivesoftware.smack.SmackException;
|
||||
import org.jivesoftware.smack.SmackException.NoResponseException;
|
||||
import org.jivesoftware.smack.SmackException.NotConnectedException;
|
||||
import org.jivesoftware.smack.XMPPConnection;
|
||||
|
@ -34,6 +36,7 @@ import org.jivesoftware.smack.provider.ProviderManager;
|
|||
import org.jivesoftware.smackx.disco.ServiceDiscoveryManager;
|
||||
import org.jivesoftware.smackx.disco.packet.DiscoverInfo;
|
||||
import org.xmlpull.v1.XmlPullParser;
|
||||
import org.xmlpull.v1.XmlPullParserException;
|
||||
|
||||
/**
|
||||
* RTPBridge IQ Packet used to request and retrieve a RTPBridge Candidates that can be used for a Jingle Media Transmission between two parties that are behind NAT.
|
||||
|
@ -316,13 +319,12 @@ public class RTPBridge extends IQ {
|
|||
*
|
||||
* @author Thiago Rocha
|
||||
*/
|
||||
public static class Provider implements IQProvider {
|
||||
public static class Provider extends IQProvider<RTPBridge> {
|
||||
|
||||
public Provider() {
|
||||
super();
|
||||
}
|
||||
|
||||
public IQ parseIQ(XmlPullParser parser) throws Exception {
|
||||
@Override
|
||||
public RTPBridge parse(XmlPullParser parser, int initialDepth)
|
||||
throws SmackException, XmlPullParserException,
|
||||
IOException {
|
||||
|
||||
boolean done = false;
|
||||
|
||||
|
@ -330,7 +332,7 @@ public class RTPBridge extends IQ {
|
|||
String elementName;
|
||||
|
||||
if (!parser.getNamespace().equals(RTPBridge.NAMESPACE))
|
||||
throw new Exception("Not a RTP Bridge packet");
|
||||
throw new SmackException("Not a RTP Bridge packet");
|
||||
|
||||
RTPBridge iq = new RTPBridge();
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
*/
|
||||
package org.jivesoftware.smackx.jingleold.nat;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.logging.Logger;
|
||||
|
@ -32,6 +33,7 @@ import org.jivesoftware.smackx.disco.ServiceDiscoveryManager;
|
|||
import org.jivesoftware.smackx.disco.packet.DiscoverInfo;
|
||||
import org.jivesoftware.smackx.disco.packet.DiscoverItems;
|
||||
import org.xmlpull.v1.XmlPullParser;
|
||||
import org.xmlpull.v1.XmlPullParserException;
|
||||
|
||||
/**
|
||||
* STUN IQ Packet used to request and retrieve a STUN server and port to make p2p connections easier. STUN is usually used by Jingle Media Transmission between two parties that are behind NAT.
|
||||
|
@ -119,13 +121,12 @@ public class STUN extends IQ {
|
|||
*
|
||||
* @author Thiago Rocha
|
||||
*/
|
||||
public static class Provider implements IQProvider {
|
||||
public static class Provider extends IQProvider<STUN> {
|
||||
|
||||
public Provider() {
|
||||
super();
|
||||
}
|
||||
|
||||
public IQ parseIQ(XmlPullParser parser) throws Exception {
|
||||
@Override
|
||||
public STUN parse(XmlPullParser parser, int initialDepth)
|
||||
throws SmackException, XmlPullParserException,
|
||||
IOException {
|
||||
|
||||
boolean done = false;
|
||||
|
||||
|
@ -133,7 +134,7 @@ public class STUN extends IQ {
|
|||
String elementName;
|
||||
|
||||
if (!parser.getNamespace().equals(NAMESPACE))
|
||||
throw new Exception("Not a STUN packet");
|
||||
throw new SmackException("Not a STUN packet");
|
||||
|
||||
STUN iq = new STUN();
|
||||
|
||||
|
|
|
@ -122,7 +122,7 @@ public class JingleError implements PacketExtension {
|
|||
return NAMESPACE;
|
||||
}
|
||||
|
||||
public static class Provider implements PacketExtensionProvider {
|
||||
public static class Provider extends PacketExtensionProvider<PacketExtension> {
|
||||
|
||||
private PacketExtension audioInfo;
|
||||
|
||||
|
@ -135,8 +135,8 @@ public class JingleError implements PacketExtension {
|
|||
/**
|
||||
* Parse a JingleDescription.Audio extension.
|
||||
*/
|
||||
public PacketExtension parseExtension(final XmlPullParser parser)
|
||||
throws Exception {
|
||||
@Override
|
||||
public PacketExtension parse(XmlPullParser parser, int initialDepth) {
|
||||
PacketExtension result = null;
|
||||
|
||||
if (audioInfo != null) {
|
||||
|
|
|
@ -16,36 +16,30 @@
|
|||
*/
|
||||
package org.jivesoftware.smackx.jingleold.provider;
|
||||
|
||||
import org.jivesoftware.smack.packet.PacketExtension;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.jivesoftware.smack.SmackException;
|
||||
import org.jivesoftware.smack.provider.PacketExtensionProvider;
|
||||
import org.jivesoftware.smackx.jingleold.media.PayloadType;
|
||||
import org.jivesoftware.smackx.jingleold.packet.JingleContentDescription;
|
||||
import org.jivesoftware.smackx.jingleold.packet.JingleContentDescription.JinglePayloadType;
|
||||
import org.xmlpull.v1.XmlPullParser;
|
||||
import org.xmlpull.v1.XmlPullParserException;
|
||||
|
||||
/**
|
||||
* Parser for a Jingle description
|
||||
*
|
||||
* @author Alvaro Saurin <alvaro.saurin@gmail.com>
|
||||
*/
|
||||
public abstract class JingleContentDescriptionProvider implements PacketExtensionProvider {
|
||||
|
||||
/**
|
||||
* Default constructor
|
||||
*/
|
||||
public JingleContentDescriptionProvider() {
|
||||
super();
|
||||
}
|
||||
public abstract class JingleContentDescriptionProvider extends PacketExtensionProvider<JingleContentDescription> {
|
||||
|
||||
/**
|
||||
* Parse a iq/jingle/description/payload-type element.
|
||||
*
|
||||
* @param parser the input to parse
|
||||
* @return a payload type element
|
||||
* @throws Exception
|
||||
*/
|
||||
protected JinglePayloadType parsePayload(final XmlPullParser parser)
|
||||
throws Exception {
|
||||
protected JinglePayloadType parsePayload(final XmlPullParser parser) {
|
||||
int ptId = 0;
|
||||
String ptName;
|
||||
int ptChannels = 0;
|
||||
|
@ -70,9 +64,14 @@ public abstract class JingleContentDescriptionProvider implements PacketExtensio
|
|||
*
|
||||
* @param parser the input to parse
|
||||
* @return a description element
|
||||
* @throws Exception
|
||||
* @throws IOException
|
||||
* @throws XmlPullParserException
|
||||
* @throws SmackException
|
||||
*/
|
||||
public PacketExtension parseExtension(final XmlPullParser parser) throws Exception {
|
||||
@Override
|
||||
public JingleContentDescription parse(XmlPullParser parser,
|
||||
int initialDepth) throws XmlPullParserException,
|
||||
IOException, SmackException {
|
||||
boolean done = false;
|
||||
JingleContentDescription desc = getInstance();
|
||||
|
||||
|
@ -84,7 +83,7 @@ public abstract class JingleContentDescriptionProvider implements PacketExtensio
|
|||
if (name.equals(JingleContentDescription.JinglePayloadType.NODENAME)) {
|
||||
desc.addJinglePayloadType(parsePayload(parser));
|
||||
} else {
|
||||
throw new Exception("Unknow element \"" + name + "\" in content.");
|
||||
throw new SmackException("Unknow element \"" + name + "\" in content.");
|
||||
}
|
||||
} else if (eventType == XmlPullParser.END_TAG) {
|
||||
if (name.equals(JingleContentDescription.NODENAME)) {
|
||||
|
@ -106,18 +105,10 @@ public abstract class JingleContentDescriptionProvider implements PacketExtensio
|
|||
*/
|
||||
public static class Audio extends JingleContentDescriptionProvider {
|
||||
|
||||
/**
|
||||
* Default constructor
|
||||
*/
|
||||
public Audio() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse an audio payload type.
|
||||
*/
|
||||
public JinglePayloadType parsePayload(final XmlPullParser parser)
|
||||
throws Exception {
|
||||
public JinglePayloadType parsePayload(final XmlPullParser parser) {
|
||||
JinglePayloadType pte = super.parsePayload(parser);
|
||||
PayloadType.Audio pt = new PayloadType.Audio(pte.getPayloadType());
|
||||
int ptClockRate = 0;
|
||||
|
|
|
@ -27,27 +27,14 @@ import org.xmlpull.v1.XmlPullParser;
|
|||
*
|
||||
* @author Alvaro Saurin
|
||||
*/
|
||||
public class JingleContentInfoProvider implements PacketExtensionProvider {
|
||||
|
||||
/**
|
||||
* Creates a new provider. ProviderManager requires that every
|
||||
* PacketExtensionProvider has a public, no-argument constructor
|
||||
*/
|
||||
public JingleContentInfoProvider() {
|
||||
super();
|
||||
}
|
||||
|
||||
public PacketExtension parseExtension(final XmlPullParser parser) throws Exception {
|
||||
// This method must be overwritten by subclasses...
|
||||
return null;
|
||||
}
|
||||
public class JingleContentInfoProvider {
|
||||
|
||||
/**
|
||||
* JingleDescription.Audio info provider
|
||||
*/
|
||||
public static class Audio extends JingleContentInfoProvider {
|
||||
public static class Audio extends PacketExtensionProvider<PacketExtension> {
|
||||
|
||||
private PacketExtension audioInfo;
|
||||
private final PacketExtension audioInfo;
|
||||
|
||||
/**
|
||||
* Empty constructor.
|
||||
|
@ -69,8 +56,8 @@ public class JingleContentInfoProvider implements PacketExtensionProvider {
|
|||
/**
|
||||
* Parse a JingleDescription.Audio extension.
|
||||
*/
|
||||
public PacketExtension parseExtension(final XmlPullParser parser)
|
||||
throws Exception {
|
||||
@Override
|
||||
public PacketExtension parse(XmlPullParser parser, int initialDepth) {
|
||||
PacketExtension result = null;
|
||||
|
||||
if (audioInfo != null) {
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
*/
|
||||
package org.jivesoftware.smackx.jingleold.provider;
|
||||
|
||||
import org.jivesoftware.smack.packet.PacketExtension;
|
||||
import org.jivesoftware.smack.provider.PacketExtensionProvider;
|
||||
import org.jivesoftware.smackx.jingleold.packet.JingleContent;
|
||||
import org.xmlpull.v1.XmlPullParser;
|
||||
|
@ -26,30 +25,19 @@ import org.xmlpull.v1.XmlPullParser;
|
|||
*
|
||||
* @author Jeff Williams
|
||||
*/
|
||||
public class JingleContentProvider implements PacketExtensionProvider {
|
||||
|
||||
/**
|
||||
* Creates a new provider. ProviderManager requires that every
|
||||
* PacketExtensionProvider has a public, no-argument constructor
|
||||
*/
|
||||
public JingleContentProvider() {
|
||||
super();
|
||||
}
|
||||
public class JingleContentProvider extends PacketExtensionProvider<JingleContent> {
|
||||
|
||||
/**
|
||||
* Parse a JingleContent extension.
|
||||
*/
|
||||
public PacketExtension parseExtension(final XmlPullParser parser) throws Exception {
|
||||
PacketExtension result = null;
|
||||
|
||||
@Override
|
||||
public JingleContent parse(XmlPullParser parser, int initialDepth) {
|
||||
String elementName = parser.getName();
|
||||
String creator = parser.getAttributeValue("", JingleContent.CREATOR);
|
||||
String name = parser.getAttributeValue("", JingleContent.NAME);
|
||||
|
||||
// Try to get an Audio content info
|
||||
result = new JingleContent(creator, name);
|
||||
|
||||
return result;
|
||||
return new JingleContent(creator, name);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -16,25 +16,21 @@
|
|||
*/
|
||||
package org.jivesoftware.smackx.jingleold.provider;
|
||||
|
||||
import org.jivesoftware.smack.packet.PacketExtension;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.jivesoftware.smack.SmackException;
|
||||
import org.jivesoftware.smack.provider.PacketExtensionProvider;
|
||||
import org.jivesoftware.smackx.jingleold.media.PayloadType;
|
||||
import org.jivesoftware.smackx.jingleold.packet.JingleDescription;
|
||||
import org.xmlpull.v1.XmlPullParser;
|
||||
import org.xmlpull.v1.XmlPullParserException;
|
||||
|
||||
/**
|
||||
* Parser for a Jingle description
|
||||
*
|
||||
* @author Alvaro Saurin <alvaro.saurin@gmail.com>
|
||||
*/
|
||||
public abstract class JingleDescriptionProvider implements PacketExtensionProvider {
|
||||
|
||||
/**
|
||||
* Default constructor
|
||||
*/
|
||||
public JingleDescriptionProvider() {
|
||||
super();
|
||||
}
|
||||
public abstract class JingleDescriptionProvider extends PacketExtensionProvider<JingleDescription> {
|
||||
|
||||
/**
|
||||
* Parse a iq/jingle/description/payload-type element.
|
||||
|
@ -42,9 +38,8 @@ public abstract class JingleDescriptionProvider implements PacketExtensionProvid
|
|||
* @param parser
|
||||
* the input to parse
|
||||
* @return a payload type element
|
||||
* @throws Exception
|
||||
*/
|
||||
protected PayloadType parsePayload(final XmlPullParser parser) throws Exception {
|
||||
protected PayloadType parsePayload(final XmlPullParser parser) {
|
||||
int ptId = 0;
|
||||
String ptName;
|
||||
int ptChannels = 0;
|
||||
|
@ -70,9 +65,11 @@ public abstract class JingleDescriptionProvider implements PacketExtensionProvid
|
|||
* @param parser
|
||||
* the input to parse
|
||||
* @return a description element
|
||||
* @throws Exception
|
||||
* @throws SmackException
|
||||
* @throws IOException
|
||||
* @throws XmlPullParserException
|
||||
*/
|
||||
public PacketExtension parseExtension(final XmlPullParser parser) throws Exception {
|
||||
public JingleDescription parse(XmlPullParser parser, int initialDepth) throws SmackException, XmlPullParserException, IOException {
|
||||
boolean done = false;
|
||||
JingleDescription desc = getInstance();
|
||||
|
||||
|
@ -84,7 +81,7 @@ public abstract class JingleDescriptionProvider implements PacketExtensionProvid
|
|||
if (name.equals(PayloadType.NODENAME)) {
|
||||
desc.addPayloadType(parsePayload(parser));
|
||||
} else {
|
||||
throw new Exception("Unknow element \"" + name + "\" in content.");
|
||||
throw new SmackException("Unknow element \"" + name + "\" in content.");
|
||||
}
|
||||
} else if (eventType == XmlPullParser.END_TAG) {
|
||||
if (name.equals(JingleDescription.NODENAME)) {
|
||||
|
@ -106,17 +103,10 @@ public abstract class JingleDescriptionProvider implements PacketExtensionProvid
|
|||
*/
|
||||
public static class Audio extends JingleDescriptionProvider {
|
||||
|
||||
/**
|
||||
* Default constructor
|
||||
*/
|
||||
public Audio() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse an audio payload type.
|
||||
*/
|
||||
public PayloadType parsePayload(final XmlPullParser parser) throws Exception {
|
||||
public PayloadType parsePayload(final XmlPullParser parser) {
|
||||
PayloadType pte = super.parsePayload(parser);
|
||||
PayloadType.Audio pt = new PayloadType.Audio(pte);
|
||||
int ptClockRate = 0;
|
||||
|
|
|
@ -17,9 +17,11 @@
|
|||
|
||||
package org.jivesoftware.smackx.jingleold.provider;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import org.jivesoftware.smack.SmackException;
|
||||
import org.jivesoftware.smack.packet.IQ;
|
||||
import org.jivesoftware.smack.provider.IQProvider;
|
||||
import org.jivesoftware.smack.provider.PacketExtensionProvider;
|
||||
import org.jivesoftware.smackx.jingleold.JingleActionEnum;
|
||||
import org.jivesoftware.smackx.jingleold.packet.Jingle;
|
||||
import org.jivesoftware.smackx.jingleold.packet.JingleContent;
|
||||
|
@ -27,26 +29,24 @@ import org.jivesoftware.smackx.jingleold.packet.JingleContentInfo;
|
|||
import org.jivesoftware.smackx.jingleold.packet.JingleDescription;
|
||||
import org.jivesoftware.smackx.jingleold.packet.JingleTransport;
|
||||
import org.xmlpull.v1.XmlPullParser;
|
||||
import org.xmlpull.v1.XmlPullParserException;
|
||||
|
||||
/**
|
||||
* The JingleProvider parses Jingle packets.
|
||||
*
|
||||
* @author Alvaro Saurin
|
||||
*/
|
||||
public class JingleProvider implements IQProvider {
|
||||
|
||||
/**
|
||||
* Creates a new provider. ProviderManager requires that every
|
||||
* PacketExtensionProvider has a public, no-argument constructor
|
||||
*/
|
||||
public JingleProvider() {
|
||||
super();
|
||||
}
|
||||
public class JingleProvider extends IQProvider<Jingle> {
|
||||
|
||||
/**
|
||||
* Parse a iq/jingle element.
|
||||
* @throws IOException
|
||||
* @throws XmlPullParserException
|
||||
* @throws SmackException
|
||||
*/
|
||||
public IQ parseIQ(final XmlPullParser parser) throws Exception {
|
||||
@Override
|
||||
public Jingle parse(XmlPullParser parser, int intialDepth)
|
||||
throws XmlPullParserException, IOException, SmackException {
|
||||
|
||||
Jingle jingle = new Jingle();
|
||||
String sid = "";
|
||||
|
@ -61,7 +61,7 @@ public class JingleProvider implements IQProvider {
|
|||
JingleDescriptionProvider jdpAudio = new JingleDescriptionProvider.Audio();
|
||||
JingleTransportProvider jtpRawUdp = new JingleTransportProvider.RawUdp();
|
||||
JingleTransportProvider jtpIce = new JingleTransportProvider.Ice();
|
||||
JingleContentInfoProvider jmipAudio = new JingleContentInfoProvider.Audio();
|
||||
PacketExtensionProvider jmipAudio = new JingleContentInfoProvider.Audio();
|
||||
|
||||
int eventType;
|
||||
String elementName;
|
||||
|
@ -91,24 +91,24 @@ public class JingleProvider implements IQProvider {
|
|||
|
||||
if (elementName.equals(JingleContent.NODENAME)) {
|
||||
// Add a new <content> element to the jingle
|
||||
currentContent = (JingleContent) jcp.parseExtension(parser);
|
||||
currentContent = (JingleContent) jcp.parse(parser);
|
||||
jingle.addContent(currentContent);
|
||||
} else if (elementName.equals(JingleDescription.NODENAME) && namespace.equals(JingleDescription.Audio.NAMESPACE)) {
|
||||
// Set the <description> element of the <content>
|
||||
currentContent.setDescription((JingleDescription) jdpAudio.parseExtension(parser));
|
||||
currentContent.setDescription((JingleDescription) jdpAudio.parse(parser));
|
||||
} else if (elementName.equals(JingleTransport.NODENAME)) {
|
||||
// Add all of the <transport> elements to the <content> of the jingle
|
||||
|
||||
// Parse the possible transport namespaces
|
||||
if (namespace.equals(JingleTransport.RawUdp.NAMESPACE)) {
|
||||
currentContent.addJingleTransport((JingleTransport) jtpRawUdp.parseExtension(parser));
|
||||
currentContent.addJingleTransport((JingleTransport) jtpRawUdp.parse(parser));
|
||||
} else if (namespace.equals(JingleTransport.Ice.NAMESPACE)) {
|
||||
currentContent.addJingleTransport((JingleTransport) jtpIce.parseExtension(parser));
|
||||
currentContent.addJingleTransport((JingleTransport) jtpIce.parse(parser));
|
||||
} else {
|
||||
throw new SmackException("Unknown transport namespace \"" + namespace + "\" in Jingle packet.");
|
||||
}
|
||||
} else if (namespace.equals(JingleContentInfo.Audio.NAMESPACE)) {
|
||||
jingle.setContentInfo((JingleContentInfo) jmipAudio.parseExtension(parser));
|
||||
jingle.setContentInfo((JingleContentInfo) jmipAudio.parse(parser));
|
||||
} else {
|
||||
throw new SmackException("Unknown combination of namespace \"" + namespace + "\" and element name \""
|
||||
+ elementName + "\" in Jingle packet.");
|
||||
|
|
|
@ -16,28 +16,23 @@
|
|||
*/
|
||||
package org.jivesoftware.smackx.jingleold.provider;
|
||||
|
||||
import org.jivesoftware.smack.packet.PacketExtension;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.jivesoftware.smack.SmackException;
|
||||
import org.jivesoftware.smack.provider.PacketExtensionProvider;
|
||||
import org.jivesoftware.smackx.jingleold.nat.ICECandidate;
|
||||
import org.jivesoftware.smackx.jingleold.nat.TransportCandidate;
|
||||
import org.jivesoftware.smackx.jingleold.packet.JingleTransport;
|
||||
import org.jivesoftware.smackx.jingleold.packet.JingleTransport.JingleTransportCandidate;
|
||||
import org.xmlpull.v1.XmlPullParser;
|
||||
import org.xmlpull.v1.XmlPullParserException;
|
||||
|
||||
/**
|
||||
* Provider for a Jingle transport element
|
||||
*
|
||||
* @author Alvaro Saurin <alvaro.saurin@gmail.com>
|
||||
*/
|
||||
public abstract class JingleTransportProvider implements PacketExtensionProvider {
|
||||
|
||||
/**
|
||||
* Creates a new provider. ProviderManager requires that every
|
||||
* PacketExtensionProvider has a public, no-argument constructor
|
||||
*/
|
||||
public JingleTransportProvider() {
|
||||
super();
|
||||
}
|
||||
public abstract class JingleTransportProvider extends PacketExtensionProvider<JingleTransport> {
|
||||
|
||||
/**
|
||||
* Obtain the corresponding TransportNegotiator instance.
|
||||
|
@ -53,9 +48,12 @@ public abstract class JingleTransportProvider implements PacketExtensionProvider
|
|||
*
|
||||
* @param parser the structure to parse
|
||||
* @return a transport element.
|
||||
* @throws Exception
|
||||
* @throws IOException
|
||||
* @throws XmlPullParserException
|
||||
* @throws SmackException
|
||||
*/
|
||||
public PacketExtension parseExtension(final XmlPullParser parser) throws Exception {
|
||||
@Override
|
||||
public JingleTransport parse(XmlPullParser parser, int initialDepth) throws XmlPullParserException, IOException, SmackException {
|
||||
boolean done = false;
|
||||
JingleTransport trans = getInstance();
|
||||
|
||||
|
@ -69,7 +67,7 @@ public abstract class JingleTransportProvider implements PacketExtensionProvider
|
|||
if (jtc != null) trans.addCandidate(jtc);
|
||||
}
|
||||
else {
|
||||
throw new Exception("Unknown tag \"" + name + "\" in transport element.");
|
||||
throw new SmackException("Unknown tag \"" + name + "\" in transport element.");
|
||||
}
|
||||
}
|
||||
else if (eventType == XmlPullParser.END_TAG) {
|
||||
|
@ -82,8 +80,7 @@ public abstract class JingleTransportProvider implements PacketExtensionProvider
|
|||
return trans;
|
||||
}
|
||||
|
||||
protected abstract JingleTransportCandidate parseCandidate(final XmlPullParser parser)
|
||||
throws Exception;
|
||||
protected abstract JingleTransportCandidate parseCandidate(final XmlPullParser parser);
|
||||
|
||||
/**
|
||||
* RTP-ICE profile
|
||||
|
@ -111,9 +108,8 @@ public abstract class JingleTransportProvider implements PacketExtensionProvider
|
|||
*
|
||||
* @param parser the structure to parse
|
||||
* @return a candidate element
|
||||
* @throws Exception
|
||||
*/
|
||||
protected JingleTransportCandidate parseCandidate(XmlPullParser parser) throws Exception {
|
||||
protected JingleTransportCandidate parseCandidate(XmlPullParser parser) {
|
||||
ICECandidate mt = new ICECandidate();
|
||||
|
||||
String channel = parser.getAttributeValue("", "channel");
|
||||
|
@ -221,9 +217,8 @@ public abstract class JingleTransportProvider implements PacketExtensionProvider
|
|||
*
|
||||
* @param parser the structure to parse
|
||||
* @return a candidate element
|
||||
* @throws Exception
|
||||
*/
|
||||
protected JingleTransportCandidate parseCandidate(XmlPullParser parser) throws Exception {
|
||||
protected JingleTransportCandidate parseCandidate(XmlPullParser parser) {
|
||||
TransportCandidate.Fixed mt = new TransportCandidate.Fixed();
|
||||
|
||||
String generation = parser.getAttributeValue("", "generation");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue