mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-10 17:49:38 +02:00
Introduce SmackException
SmackException (and it's subclasses) is for all errors/exceptions not defined by any XMPP specification. XMPPException is now an abstract class for all errors defined by the XMPP specifications. Methods that involve an IQ exchange now either return the result, which is obtained by IQ response, or they throw an XMPPErrorException if an IQ error was the result of the IQ set/get. If there was no response from the server within the default packet timeout, a NoResponseException will be thrown. XMPP SASL errors are now also reported accordingly. SMACK-426
This commit is contained in:
parent
4b6f09f962
commit
4b56446e40
109 changed files with 2040 additions and 1599 deletions
|
@ -19,6 +19,7 @@ package org.jivesoftware.smackx.jingle;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.jivesoftware.smack.SmackException;
|
||||
import org.jivesoftware.smack.XMPPException;
|
||||
import org.jivesoftware.smack.packet.IQ;
|
||||
import org.jivesoftware.smackx.jingle.listeners.JingleListener;
|
||||
|
@ -56,7 +57,7 @@ public class ContentNegotiator extends JingleNegotiator {
|
|||
transportNegotiators = new ArrayList<TransportNegotiator>();
|
||||
}
|
||||
|
||||
public List<IQ> dispatchIncomingPacket(IQ iq, String id) throws XMPPException {
|
||||
public List<IQ> dispatchIncomingPacket(IQ iq, String id) throws XMPPException, SmackException {
|
||||
List<IQ> responses = new ArrayList<IQ>();
|
||||
|
||||
// First only process IQ packets that contain <content> stanzas that
|
||||
|
|
|
@ -24,6 +24,7 @@ import java.util.logging.Logger;
|
|||
import org.jivesoftware.smack.ConnectionCreationListener;
|
||||
import org.jivesoftware.smack.PacketListener;
|
||||
import org.jivesoftware.smack.RosterListener;
|
||||
import org.jivesoftware.smack.SmackException;
|
||||
import org.jivesoftware.smack.XMPPConnection;
|
||||
import org.jivesoftware.smack.XMPPException;
|
||||
import org.jivesoftware.smack.filter.PacketFilter;
|
||||
|
@ -44,7 +45,6 @@ import org.jivesoftware.smackx.jingle.nat.TransportCandidate;
|
|||
import org.jivesoftware.smackx.jingle.nat.TransportResolver;
|
||||
import org.jivesoftware.smackx.jingle.packet.Jingle;
|
||||
import org.jivesoftware.smackx.jingle.provider.JingleProvider;
|
||||
import org.jivesoftware.smackx.disco.packet.DiscoverInfo;
|
||||
|
||||
/**
|
||||
* Jingle is a session establishment protocol defined in (XEP-0166).
|
||||
|
@ -205,8 +205,10 @@ public class JingleManager implements JingleSessionListener {
|
|||
*
|
||||
* @param connection XMPP XMPPConnection to be used
|
||||
* @param jingleMediaManagers an implemeted JingleMediaManager to be used.
|
||||
* @throws SmackException
|
||||
* @throws XMPPException
|
||||
*/
|
||||
public JingleManager(XMPPConnection connection, List<JingleMediaManager> jingleMediaManagers) {
|
||||
public JingleManager(XMPPConnection connection, List<JingleMediaManager> jingleMediaManagers) throws XMPPException, SmackException {
|
||||
this.connection = connection;
|
||||
this.jingleMediaManagers = jingleMediaManagers;
|
||||
|
||||
|
@ -307,15 +309,11 @@ public class JingleManager implements JingleSessionListener {
|
|||
* jdoe@example.com
|
||||
* @return a boolean indicating whether the specified user handles Jingle
|
||||
* messages
|
||||
* @throws SmackException if there was no response from the server.
|
||||
* @throws XMPPException
|
||||
*/
|
||||
public static boolean isServiceEnabled(XMPPConnection connection, String userID) {
|
||||
try {
|
||||
DiscoverInfo result = ServiceDiscoveryManager.getInstanceFor(connection).discoverInfo(userID);
|
||||
return result.containsFeature(Jingle.NAMESPACE);
|
||||
} catch (XMPPException e) {
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
}
|
||||
public static boolean isServiceEnabled(XMPPConnection connection, String userID) throws XMPPException, SmackException {
|
||||
return ServiceDiscoveryManager.getInstanceFor(connection).supportsFeature(userID, Jingle.NAMESPACE);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -20,6 +20,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.jivesoftware.smack.SmackException;
|
||||
import org.jivesoftware.smack.XMPPConnection;
|
||||
import org.jivesoftware.smack.XMPPException;
|
||||
import org.jivesoftware.smack.packet.IQ;
|
||||
|
@ -232,7 +233,7 @@ public abstract class JingleNegotiator {
|
|||
* @return the new packet to send (either a Jingle or an IQ error).
|
||||
* @throws XMPPException
|
||||
*/
|
||||
public abstract List<IQ> dispatchIncomingPacket(IQ iq, String id) throws XMPPException;
|
||||
public abstract List<IQ> dispatchIncomingPacket(IQ iq, String id) throws XMPPException, SmackException;
|
||||
|
||||
|
||||
public void start() {
|
||||
|
|
|
@ -25,6 +25,7 @@ import java.util.logging.Logger;
|
|||
|
||||
import org.jivesoftware.smack.ConnectionListener;
|
||||
import org.jivesoftware.smack.PacketListener;
|
||||
import org.jivesoftware.smack.SmackException;
|
||||
import org.jivesoftware.smack.XMPPConnection;
|
||||
import org.jivesoftware.smack.XMPPException;
|
||||
import org.jivesoftware.smack.filter.PacketFilter;
|
||||
|
@ -273,8 +274,9 @@ public class JingleSession extends JingleNegotiator implements MediaReceivedList
|
|||
* @param iq
|
||||
* the packet received
|
||||
* @throws XMPPException
|
||||
* @throws SmackException
|
||||
*/
|
||||
public synchronized void receivePacketAndRespond(IQ iq) throws XMPPException {
|
||||
public synchronized void receivePacketAndRespond(IQ iq) throws XMPPException, SmackException {
|
||||
List<IQ> responses = new ArrayList<IQ>();
|
||||
|
||||
String responseId = null;
|
||||
|
@ -340,8 +342,9 @@ public class JingleSession extends JingleNegotiator implements MediaReceivedList
|
|||
* the packet received
|
||||
* @return the new Jingle packet to send.
|
||||
* @throws XMPPException
|
||||
* @throws SmackException
|
||||
*/
|
||||
public List<IQ> dispatchIncomingPacket(IQ iq, String id) throws XMPPException {
|
||||
public List<IQ> dispatchIncomingPacket(IQ iq, String id) throws XMPPException, SmackException {
|
||||
List<IQ> responses = new ArrayList<IQ>();
|
||||
IQ response = null;
|
||||
|
||||
|
@ -676,7 +679,7 @@ public class JingleSession extends JingleNegotiator implements MediaReceivedList
|
|||
public void processPacket(Packet packet) {
|
||||
try {
|
||||
receivePacketAndRespond((IQ) packet);
|
||||
} catch (XMPPException e) {
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
@ -1110,8 +1113,9 @@ public class JingleSession extends JingleNegotiator implements MediaReceivedList
|
|||
* This is the starting point for intitiating a new session.
|
||||
*
|
||||
* @throws IllegalStateException
|
||||
* @throws SmackException
|
||||
*/
|
||||
public void startOutgoing() throws IllegalStateException {
|
||||
public void startOutgoing() throws IllegalStateException, SmackException {
|
||||
|
||||
updatePacketListener();
|
||||
setSessionState(JingleSessionStatePending.getInstance());
|
||||
|
|
|
@ -19,6 +19,7 @@ package org.jivesoftware.smackx.jingle;
|
|||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.jivesoftware.smack.SmackException;
|
||||
import org.jivesoftware.smack.XMPPException;
|
||||
import org.jivesoftware.smackx.jingle.packet.Jingle;
|
||||
|
||||
|
@ -105,8 +106,9 @@ public class JingleSessionRequest {
|
|||
*
|
||||
* @return Returns the <b><i>IncomingJingleSession</b></i> on which the
|
||||
* negotiation can be carried out.
|
||||
* @throws SmackException
|
||||
*/
|
||||
public synchronized JingleSession accept() throws XMPPException {
|
||||
public synchronized JingleSession accept() throws XMPPException, SmackException {
|
||||
JingleSession session = null;
|
||||
synchronized (manager) {
|
||||
session = manager.createIncomingJingleSession(this);
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
*/
|
||||
package org.jivesoftware.smackx.jingle;
|
||||
|
||||
import org.jivesoftware.smack.SmackException;
|
||||
import org.jivesoftware.smack.packet.IQ;
|
||||
import org.jivesoftware.smackx.jingle.packet.Jingle;
|
||||
|
||||
|
@ -54,7 +55,7 @@ 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().
|
||||
*/
|
||||
public abstract IQ processJingle(JingleSession session, Jingle jingle, JingleActionEnum action);
|
||||
public abstract IQ processJingle(JingleSession session, Jingle jingle, JingleActionEnum action) throws SmackException;
|
||||
|
||||
/**
|
||||
* For debugging just emit the short name of the class.
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
*/
|
||||
package org.jivesoftware.smackx.jingle;
|
||||
|
||||
import org.jivesoftware.smack.SmackException;
|
||||
import org.jivesoftware.smack.XMPPException;
|
||||
import org.jivesoftware.smack.packet.IQ;
|
||||
import org.jivesoftware.smackx.jingle.media.JingleMediaManager;
|
||||
|
@ -62,7 +63,7 @@ public class JingleSessionStateUnknown extends JingleSessionState {
|
|||
|
||||
}
|
||||
|
||||
public IQ processJingle(JingleSession session, Jingle jingle, JingleActionEnum action) {
|
||||
public IQ processJingle(JingleSession session, Jingle jingle, JingleActionEnum action) throws SmackException {
|
||||
IQ response = null;
|
||||
|
||||
switch (action) {
|
||||
|
@ -86,9 +87,10 @@ public class JingleSessionStateUnknown extends JingleSessionState {
|
|||
/**
|
||||
* In the UNKNOWN state we received a <session-initiate> action.
|
||||
* This method processes that action.
|
||||
* @throws SmackException
|
||||
*/
|
||||
|
||||
private IQ receiveSessionInitiateAction(JingleSession session, Jingle inJingle) {
|
||||
private IQ receiveSessionInitiateAction(JingleSession session, Jingle inJingle) throws SmackException {
|
||||
|
||||
IQ response = null;
|
||||
boolean shouldAck = true;
|
||||
|
|
|
@ -16,8 +16,10 @@
|
|||
*/
|
||||
package org.jivesoftware.smackx.jingle.nat;
|
||||
|
||||
import org.jivesoftware.smack.SmackException;
|
||||
import org.jivesoftware.smack.XMPPConnection;
|
||||
import org.jivesoftware.smack.XMPPException;
|
||||
import org.jivesoftware.smack.XMPPException.XMPPErrorException;
|
||||
import org.jivesoftware.smackx.jingle.JingleSession;
|
||||
|
||||
import java.net.Inet6Address;
|
||||
|
@ -94,13 +96,13 @@ public class BridgedResolver extends TransportResolver {
|
|||
setResolveEnd();
|
||||
}
|
||||
|
||||
public void initialize() throws XMPPException {
|
||||
public void initialize() throws SmackException, XMPPErrorException {
|
||||
|
||||
clearCandidates();
|
||||
|
||||
if (!RTPBridge.serviceAvailable(connection)) {
|
||||
setInitialized();
|
||||
throw new XMPPException("No RTP Bridge service available");
|
||||
throw new SmackException("No RTP Bridge service available");
|
||||
}
|
||||
setInitialized();
|
||||
|
||||
|
|
|
@ -26,6 +26,7 @@ import java.util.Map;
|
|||
import java.util.Random;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.jivesoftware.smack.SmackException;
|
||||
import org.jivesoftware.smack.XMPPConnection;
|
||||
import org.jivesoftware.smack.XMPPException;
|
||||
import org.jivesoftware.smackx.jingle.JingleSession;
|
||||
|
@ -89,8 +90,9 @@ public class ICEResolver extends TransportResolver {
|
|||
|
||||
/**
|
||||
* Resolve the IP and obtain a valid transport method.
|
||||
* @throws SmackException
|
||||
*/
|
||||
public synchronized void resolve(JingleSession session) throws XMPPException {
|
||||
public synchronized void resolve(JingleSession session) throws XMPPException, SmackException {
|
||||
this.setResolveInit();
|
||||
|
||||
for (TransportCandidate candidate : this.getCandidatesList()) {
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
*/
|
||||
package org.jivesoftware.smackx.jingle.nat;
|
||||
|
||||
import org.jivesoftware.smack.SmackException;
|
||||
import org.jivesoftware.smack.XMPPConnection;
|
||||
import org.jivesoftware.smack.XMPPException;
|
||||
import org.jivesoftware.smackx.jingle.JingleSession;
|
||||
|
@ -32,12 +33,12 @@ public class ICETransportManager extends JingleTransportManager implements Jingl
|
|||
try {
|
||||
iceResolver.initializeAndWait();
|
||||
}
|
||||
catch (XMPPException e) {
|
||||
catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
protected TransportResolver createResolver(JingleSession session) {
|
||||
protected TransportResolver createResolver(JingleSession session) throws SmackException {
|
||||
try {
|
||||
iceResolver.resolve(session);
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
*/
|
||||
package org.jivesoftware.smackx.jingle.nat;
|
||||
|
||||
import org.jivesoftware.smack.SmackException;
|
||||
import org.jivesoftware.smack.XMPPException;
|
||||
import org.jivesoftware.smackx.jingle.JingleSession;
|
||||
|
||||
|
@ -51,7 +52,7 @@ public abstract class JingleTransportManager {
|
|||
*
|
||||
* @return the TransportResolver to be used
|
||||
*/
|
||||
public TransportResolver getResolver(JingleSession session) throws XMPPException {
|
||||
public TransportResolver getResolver(JingleSession session) throws XMPPException, SmackException {
|
||||
TransportResolver resolver = createResolver(session);
|
||||
if (resolver == null) {
|
||||
resolver = new BasicResolver();
|
||||
|
@ -66,6 +67,6 @@ public abstract class JingleTransportManager {
|
|||
*
|
||||
* @return the TransportResolver
|
||||
*/
|
||||
protected abstract TransportResolver createResolver(JingleSession session);
|
||||
protected abstract TransportResolver createResolver(JingleSession session) throws SmackException;
|
||||
|
||||
}
|
||||
|
|
|
@ -24,9 +24,10 @@ import java.util.Enumeration;
|
|||
import java.util.Iterator;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.jivesoftware.smack.SmackException.NoResponseException;
|
||||
import org.jivesoftware.smack.XMPPConnection;
|
||||
import org.jivesoftware.smack.PacketCollector;
|
||||
import org.jivesoftware.smack.XMPPException;
|
||||
import org.jivesoftware.smack.XMPPException.XMPPErrorException;
|
||||
import org.jivesoftware.smack.packet.IQ;
|
||||
import org.jivesoftware.smack.provider.IQProvider;
|
||||
import org.jivesoftware.smack.provider.ProviderManager;
|
||||
|
@ -407,8 +408,11 @@ public class RTPBridge extends IQ {
|
|||
*
|
||||
* @param connection
|
||||
* @return true if the server supports the RTPBridge service
|
||||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
*/
|
||||
public static boolean serviceAvailable(XMPPConnection connection) {
|
||||
public static boolean serviceAvailable(XMPPConnection connection) throws NoResponseException,
|
||||
XMPPErrorException {
|
||||
|
||||
if (!connection.isConnected()) {
|
||||
return false;
|
||||
|
@ -418,7 +422,6 @@ public class RTPBridge extends IQ {
|
|||
|
||||
ServiceDiscoveryManager disco = ServiceDiscoveryManager
|
||||
.getInstanceFor(connection);
|
||||
try {
|
||||
// DiscoverItems items = disco.discoverItems(connection.getServiceName());
|
||||
// Iterator iter = items.getItems();
|
||||
// while (iter.hasNext()) {
|
||||
|
@ -428,17 +431,13 @@ public class RTPBridge extends IQ {
|
|||
// }
|
||||
// }
|
||||
|
||||
DiscoverInfo discoInfo = disco.discoverInfo(connection.getServiceName());
|
||||
Iterator<DiscoverInfo.Identity> iter = discoInfo.getIdentities();
|
||||
while (iter.hasNext()) {
|
||||
DiscoverInfo.Identity identity = iter.next();
|
||||
if ((identity.getName() != null) && (identity.getName().startsWith("rtpbridge"))) {
|
||||
return true;
|
||||
}
|
||||
DiscoverInfo discoInfo = disco.discoverInfo(connection.getServiceName());
|
||||
Iterator<DiscoverInfo.Identity> iter = discoInfo.getIdentities();
|
||||
while (iter.hasNext()) {
|
||||
DiscoverInfo.Identity identity = iter.next();
|
||||
if ((identity.getName() != null) && (identity.getName().startsWith("rtpbridge"))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
catch (XMPPException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
|
@ -19,9 +19,9 @@ package org.jivesoftware.smackx.jingle.nat;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.jivesoftware.smack.SmackException;
|
||||
import org.jivesoftware.smack.XMPPConnection;
|
||||
import org.jivesoftware.smack.PacketCollector;
|
||||
import org.jivesoftware.smack.XMPPException;
|
||||
|
@ -206,8 +206,10 @@ public class STUN extends IQ {
|
|||
*
|
||||
* @param connection the connection
|
||||
* @return true if the server support STUN
|
||||
* @throws SmackException
|
||||
* @throws XMPPException
|
||||
*/
|
||||
public static boolean serviceAvailable(XMPPConnection connection) {
|
||||
public static boolean serviceAvailable(XMPPConnection connection) throws XMPPException, SmackException {
|
||||
|
||||
if (!connection.isConnected()) {
|
||||
return false;
|
||||
|
@ -215,31 +217,26 @@ public class STUN extends IQ {
|
|||
|
||||
LOGGER.fine("Service listing");
|
||||
|
||||
ServiceDiscoveryManager disco = ServiceDiscoveryManager
|
||||
.getInstanceFor(connection);
|
||||
try {
|
||||
DiscoverItems items = disco.discoverItems(connection.getServiceName());
|
||||
ServiceDiscoveryManager disco = ServiceDiscoveryManager.getInstanceFor(connection);
|
||||
DiscoverItems items = disco.discoverItems(connection.getServiceName());
|
||||
|
||||
Iterator<DiscoverItems.Item> iter = items.getItems();
|
||||
while (iter.hasNext()) {
|
||||
DiscoverItems.Item item = iter.next();
|
||||
DiscoverInfo info = disco.discoverInfo(item.getEntityID());
|
||||
|
||||
Iterator<DiscoverInfo.Identity> iter2 = info.getIdentities();
|
||||
while (iter2.hasNext()) {
|
||||
DiscoverInfo.Identity identity = iter2.next();
|
||||
if (identity.getCategory().equals("proxy") && identity.getType().equals("stun"))
|
||||
if (info.containsFeature(NAMESPACE))
|
||||
return true;
|
||||
}
|
||||
|
||||
LOGGER.fine(item.getName()+"-"+info.getType());
|
||||
Iterator<DiscoverItems.Item> iter = items.getItems();
|
||||
while (iter.hasNext()) {
|
||||
DiscoverItems.Item item = iter.next();
|
||||
DiscoverInfo info = disco.discoverInfo(item.getEntityID());
|
||||
|
||||
Iterator<DiscoverInfo.Identity> iter2 = info.getIdentities();
|
||||
while (iter2.hasNext()) {
|
||||
DiscoverInfo.Identity identity = iter2.next();
|
||||
if (identity.getCategory().equals("proxy") && identity.getType().equals("stun"))
|
||||
if (info.containsFeature(NAMESPACE))
|
||||
return true;
|
||||
}
|
||||
|
||||
LOGGER.fine(item.getName() + "-" + info.getType());
|
||||
|
||||
}
|
||||
catch (XMPPException e) {
|
||||
LOGGER.log(Level.SEVERE, "serviceAvailable", e);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ public class STUNTransportManager extends JingleTransportManager {
|
|||
};
|
||||
try {
|
||||
stunResolver.initializeAndWait();
|
||||
} catch (XMPPException e) {
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ import java.util.Iterator;
|
|||
import java.util.List;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.jivesoftware.smack.SmackException;
|
||||
import org.jivesoftware.smack.XMPPException;
|
||||
import org.jivesoftware.smack.packet.IQ;
|
||||
import org.jivesoftware.smackx.jingle.ContentNegotiator;
|
||||
|
@ -160,7 +161,7 @@ public abstract class TransportNegotiator extends JingleNegotiator {
|
|||
try {
|
||||
sendTransportCandidatesOffer();
|
||||
setNegotiatorState(JingleNegotiatorState.PENDING);
|
||||
} catch (XMPPException e) {
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
@ -528,8 +529,9 @@ public abstract class TransportNegotiator extends JingleNegotiator {
|
|||
* Create a Jingle packet where we announce our transport candidates.
|
||||
*
|
||||
* @throws XMPPException
|
||||
* @throws SmackException
|
||||
*/
|
||||
private void sendTransportCandidatesOffer() throws XMPPException {
|
||||
private void sendTransportCandidatesOffer() throws XMPPException, SmackException {
|
||||
List<TransportCandidate> notOffered = resolver.getCandidatesList();
|
||||
|
||||
notOffered.removeAll(offeredCandidates);
|
||||
|
@ -572,8 +574,9 @@ public abstract class TransportNegotiator extends JingleNegotiator {
|
|||
* @param iq the packet received
|
||||
* @return the new Jingle packet to send.
|
||||
* @throws XMPPException
|
||||
* @throws SmackException
|
||||
*/
|
||||
public final List<IQ> dispatchIncomingPacket(IQ iq, String id) throws XMPPException {
|
||||
public final List<IQ> dispatchIncomingPacket(IQ iq, String id) throws XMPPException, SmackException {
|
||||
List<IQ> responses = new ArrayList<IQ>();
|
||||
IQ response = null;
|
||||
|
||||
|
@ -641,8 +644,9 @@ public abstract class TransportNegotiator extends JingleNegotiator {
|
|||
*
|
||||
* @return an IQ packet
|
||||
* @throws XMPPException
|
||||
* @throws SmackException
|
||||
*/
|
||||
private Jingle receiveResult(IQ iq) throws XMPPException {
|
||||
private Jingle receiveResult(IQ iq) throws XMPPException, SmackException {
|
||||
Jingle response = null;
|
||||
|
||||
sendTransportCandidatesOffer();
|
||||
|
@ -655,8 +659,9 @@ public abstract class TransportNegotiator extends JingleNegotiator {
|
|||
* @param jingle
|
||||
* @param jingleTransport
|
||||
* @return the iq
|
||||
* @throws SmackException
|
||||
*/
|
||||
private IQ receiveSessionInitiateAction(Jingle jingle) throws XMPPException {
|
||||
private IQ receiveSessionInitiateAction(Jingle jingle) throws XMPPException, SmackException {
|
||||
IQ response = null;
|
||||
|
||||
// Parse the Jingle and get any proposed transport candidates
|
||||
|
|
|
@ -24,6 +24,7 @@ import java.util.Iterator;
|
|||
import java.util.List;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.jivesoftware.smack.SmackException;
|
||||
import org.jivesoftware.smack.XMPPException;
|
||||
import org.jivesoftware.smackx.jingle.JingleSession;
|
||||
|
||||
|
@ -89,12 +90,12 @@ public abstract class TransportResolver {
|
|||
/**
|
||||
* Initialize the Resolver
|
||||
*/
|
||||
public abstract void initialize() throws XMPPException;
|
||||
public abstract void initialize() throws XMPPException, SmackException;
|
||||
|
||||
/**
|
||||
* Start a the resolution.
|
||||
*/
|
||||
public abstract void resolve(JingleSession session) throws XMPPException;
|
||||
public abstract void resolve(JingleSession session) throws XMPPException, SmackException;
|
||||
|
||||
/**
|
||||
* Clear the list of candidates and start a new resolution process.
|
||||
|
@ -352,8 +353,9 @@ public abstract class TransportResolver {
|
|||
|
||||
/**
|
||||
* Initialize Transport Resolver and wait until it is complete unitialized.
|
||||
* @throws SmackException
|
||||
*/
|
||||
public void initializeAndWait() throws XMPPException {
|
||||
public void initializeAndWait() throws XMPPException, SmackException {
|
||||
this.initialize();
|
||||
try {
|
||||
LOGGER.fine("Initializing transport resolver...");
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
package org.jivesoftware.smackx.jingle.provider;
|
||||
|
||||
import org.jivesoftware.smack.XMPPException;
|
||||
import org.jivesoftware.smack.SmackException;
|
||||
import org.jivesoftware.smack.packet.IQ;
|
||||
import org.jivesoftware.smack.provider.IQProvider;
|
||||
import org.jivesoftware.smackx.jingle.JingleActionEnum;
|
||||
|
@ -101,12 +101,12 @@ public class JingleProvider implements IQProvider {
|
|||
} else if (namespace.equals(JingleTransport.Ice.NAMESPACE)) {
|
||||
currentContent.addJingleTransport((JingleTransport) jtpIce.parseExtension(parser));
|
||||
} else {
|
||||
throw new XMPPException("Unknown transport namespace \"" + namespace + "\" in Jingle packet.");
|
||||
throw new SmackException("Unknown transport namespace \"" + namespace + "\" in Jingle packet.");
|
||||
}
|
||||
} else if (namespace.equals(JingleContentInfo.Audio.NAMESPACE)) {
|
||||
jingle.setContentInfo((JingleContentInfo) jmipAudio.parseExtension(parser));
|
||||
} else {
|
||||
throw new XMPPException("Unknown combination of namespace \"" + namespace + "\" and element name \""
|
||||
throw new SmackException("Unknown combination of namespace \"" + namespace + "\" and element name \""
|
||||
+ elementName + "\" in Jingle packet.");
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue