mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-12-23 11:07:57 +01:00
Code Refactoring and Fixes
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@7363 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
76bd42da26
commit
3c455c8367
36 changed files with 420 additions and 29 deletions
|
@ -80,6 +80,7 @@ import java.util.List;
|
||||||
* JingleManager class, that will create the appropiate instance...
|
* JingleManager class, that will create the appropiate instance...
|
||||||
*
|
*
|
||||||
* @author Alvaro Saurin
|
* @author Alvaro Saurin
|
||||||
|
* @author Thiago Camargo
|
||||||
*/
|
*/
|
||||||
public class IncomingJingleSession extends JingleSession {
|
public class IncomingJingleSession extends JingleSession {
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,9 @@ import org.jivesoftware.smack.filter.PacketFilter;
|
||||||
import org.jivesoftware.smack.packet.IQ;
|
import org.jivesoftware.smack.packet.IQ;
|
||||||
import org.jivesoftware.smack.packet.Packet;
|
import org.jivesoftware.smack.packet.Packet;
|
||||||
import org.jivesoftware.smack.packet.Presence;
|
import org.jivesoftware.smack.packet.Presence;
|
||||||
|
import org.jivesoftware.smack.packet.PacketExtension;
|
||||||
import org.jivesoftware.smack.provider.ProviderManager;
|
import org.jivesoftware.smack.provider.ProviderManager;
|
||||||
|
import org.jivesoftware.smack.provider.PacketExtensionProvider;
|
||||||
import org.jivesoftware.smack.util.StringUtils;
|
import org.jivesoftware.smack.util.StringUtils;
|
||||||
import org.jivesoftware.smackx.ServiceDiscoveryManager;
|
import org.jivesoftware.smackx.ServiceDiscoveryManager;
|
||||||
import org.jivesoftware.smackx.jingle.listeners.CreatedJingleSessionListener;
|
import org.jivesoftware.smackx.jingle.listeners.CreatedJingleSessionListener;
|
||||||
|
@ -40,6 +42,8 @@ import org.jivesoftware.smackx.jingle.nat.TransportCandidate;
|
||||||
import org.jivesoftware.smackx.jingle.nat.TransportResolver;
|
import org.jivesoftware.smackx.jingle.nat.TransportResolver;
|
||||||
import org.jivesoftware.smackx.packet.DiscoverInfo;
|
import org.jivesoftware.smackx.packet.DiscoverInfo;
|
||||||
import org.jivesoftware.smackx.packet.Jingle;
|
import org.jivesoftware.smackx.packet.Jingle;
|
||||||
|
import org.jivesoftware.smackx.packet.JingleError;
|
||||||
|
import org.xmlpull.v1.XmlPullParser;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
@ -267,8 +271,7 @@ public class JingleManager implements JingleSessionListener {
|
||||||
JingleSession aux = null;
|
JingleSession aux = null;
|
||||||
for (JingleSession jingleSession : jingleSessions) {
|
for (JingleSession jingleSession : jingleSessions) {
|
||||||
if (jingleSession.getInitiator().equals(xmppAddress) ||
|
if (jingleSession.getInitiator().equals(xmppAddress) ||
|
||||||
jingleSession.getResponder().equals(xmppAddress))
|
jingleSession.getResponder().equals(xmppAddress)) {
|
||||||
{
|
|
||||||
aux = jingleSession;
|
aux = jingleSession;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,22 @@
|
||||||
|
/**
|
||||||
|
* $RCSfile$
|
||||||
|
* $Revision: 7329 $
|
||||||
|
* $Date: 2007-02-28 20:59:28 -0300 (qua, 28 fev 2007) $
|
||||||
|
*
|
||||||
|
* Copyright 2003-2005 Jive Software.
|
||||||
|
*
|
||||||
|
* All rights reserved. Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
package org.jivesoftware.smackx.jingle;
|
package org.jivesoftware.smackx.jingle;
|
||||||
|
|
||||||
import org.jivesoftware.smack.XMPPConnection;
|
import org.jivesoftware.smack.XMPPConnection;
|
||||||
|
|
|
@ -501,7 +501,6 @@ public abstract class JingleSession extends JingleNegotiator {
|
||||||
|
|
||||||
// Notify the session end and close everything...
|
// Notify the session end and close everything...
|
||||||
triggerSessionClosedOnError(e);
|
triggerSessionClosedOnError(e);
|
||||||
close();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -558,6 +557,7 @@ public abstract class JingleSession extends JingleNegotiator {
|
||||||
perror.addExtension(error);
|
perror.addExtension(error);
|
||||||
|
|
||||||
getConnection().sendPacket(perror);
|
getConnection().sendPacket(perror);
|
||||||
|
System.err.println(error.toXML());
|
||||||
}
|
}
|
||||||
return perror;
|
return perror;
|
||||||
}
|
}
|
||||||
|
@ -1022,6 +1022,7 @@ public abstract class JingleSession extends JingleNegotiator {
|
||||||
sli.sessionClosed(reason, this);
|
sli.sessionClosed(reason, this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
close();
|
||||||
if (jingleMediaSession != null) {
|
if (jingleMediaSession != null) {
|
||||||
jingleMediaSession.stopTrasmit();
|
jingleMediaSession.stopTrasmit();
|
||||||
jingleMediaSession.stopReceive();
|
jingleMediaSession.stopReceive();
|
||||||
|
@ -1041,6 +1042,7 @@ public abstract class JingleSession extends JingleNegotiator {
|
||||||
sli.sessionClosedOnError(exc, this);
|
sli.sessionClosedOnError(exc, this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
close();
|
||||||
if (jingleMediaSession != null) {
|
if (jingleMediaSession != null) {
|
||||||
jingleMediaSession.stopTrasmit();
|
jingleMediaSession.stopTrasmit();
|
||||||
jingleMediaSession.stopReceive();
|
jingleMediaSession.stopReceive();
|
||||||
|
@ -1125,7 +1127,6 @@ public abstract class JingleSession extends JingleNegotiator {
|
||||||
jout.setType(IQ.Type.SET);
|
jout.setType(IQ.Type.SET);
|
||||||
sendFormattedJingle(jout);
|
sendFormattedJingle(jout);
|
||||||
triggerSessionClosed("Closed Locally");
|
triggerSessionClosed("Closed Locally");
|
||||||
close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,3 +1,22 @@
|
||||||
|
/**
|
||||||
|
* $RCSfile$
|
||||||
|
* $Revision: $
|
||||||
|
* $Date: 15/11/2006
|
||||||
|
*
|
||||||
|
* Copyright 2003-2006 Jive Software.
|
||||||
|
*
|
||||||
|
* All rights reserved. Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
package org.jivesoftware.smackx.jingle;
|
package org.jivesoftware.smackx.jingle;
|
||||||
|
|
||||||
import org.jivesoftware.smack.XMPPException;
|
import org.jivesoftware.smack.XMPPException;
|
||||||
|
|
|
@ -78,6 +78,7 @@ import java.util.List;
|
||||||
* JingleManager class, that will create the appropiate instance...
|
* JingleManager class, that will create the appropiate instance...
|
||||||
*
|
*
|
||||||
* @author Alvaro Saurin <alvaro.saurin@gmail.com>
|
* @author Alvaro Saurin <alvaro.saurin@gmail.com>
|
||||||
|
* @author Thiago Camargo
|
||||||
*/
|
*/
|
||||||
public class OutgoingJingleSession extends JingleSession {
|
public class OutgoingJingleSession extends JingleSession {
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,3 @@
|
||||||
package org.jivesoftware.smackx.jingle.listeners;
|
|
||||||
|
|
||||||
import org.jivesoftware.smackx.jingle.JingleSession;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $RCSfile$
|
* $RCSfile$
|
||||||
* $Revision: $
|
* $Revision: $
|
||||||
|
@ -22,8 +18,14 @@ import org.jivesoftware.smackx.jingle.JingleSession;
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
package org.jivesoftware.smackx.jingle.listeners;
|
||||||
|
|
||||||
|
import org.jivesoftware.smackx.jingle.JingleSession;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Inteface used to dispatch a event when a Jingle session is created.
|
* Inteface used to dispatch a event when a Jingle session is created.
|
||||||
|
*
|
||||||
|
* @author Thiago Camargo
|
||||||
*/
|
*/
|
||||||
public interface CreatedJingleSessionListener {
|
public interface CreatedJingleSessionListener {
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ package org.jivesoftware.smackx.jingle.listeners;
|
||||||
* <i>sessionRequested()</i> of the listener will be executed, and the listener
|
* <i>sessionRequested()</i> of the listener will be executed, and the listener
|
||||||
* will be able to <i>accept()</i> or <i>decline()</i> the invitation.
|
* will be able to <i>accept()</i> or <i>decline()</i> the invitation.
|
||||||
*
|
*
|
||||||
* @author Alvaro Saurin
|
* @author Thiago Camargo
|
||||||
*/
|
*/
|
||||||
public interface JingleListener {
|
public interface JingleListener {
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@ package org.jivesoftware.smackx.jingle.listeners;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface for listening to jmf info events.
|
* Interface for listening to jmf info events.
|
||||||
|
* @author Thiago Camargo
|
||||||
*/
|
*/
|
||||||
public interface JingleMediaInfoListener extends JingleListener {
|
public interface JingleMediaInfoListener extends JingleListener {
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -24,6 +24,7 @@ import org.jivesoftware.smackx.jingle.media.PayloadType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface for listening to jmf events.
|
* Interface for listening to jmf events.
|
||||||
|
* @author Thiago Camargo
|
||||||
*/
|
*/
|
||||||
public interface JingleMediaListener extends JingleListener {
|
public interface JingleMediaListener extends JingleListener {
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -26,6 +26,7 @@ import org.jivesoftware.smackx.jingle.nat.TransportCandidate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface for listening for session events.
|
* Interface for listening for session events.
|
||||||
|
* @author Thiago Camargo
|
||||||
*/
|
*/
|
||||||
public interface JingleSessionListener extends JingleListener {
|
public interface JingleSessionListener extends JingleListener {
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -24,6 +24,8 @@ import org.jivesoftware.smackx.jingle.JingleNegotiator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to Listen for Jingle Session State Changes
|
* Used to Listen for Jingle Session State Changes
|
||||||
|
*
|
||||||
|
* @author Thiago Camargo
|
||||||
*/
|
*/
|
||||||
public interface JingleSessionStateListener {
|
public interface JingleSessionStateListener {
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,8 @@ import org.jivesoftware.smackx.jingle.nat.TransportCandidate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface for listening to transport events.
|
* Interface for listening to transport events.
|
||||||
|
*
|
||||||
|
* @author Thiago Camargo
|
||||||
*/
|
*/
|
||||||
public interface JingleTransportListener extends JingleListener {
|
public interface JingleTransportListener extends JingleListener {
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,6 @@ import java.util.List;
|
||||||
* This class is responsible for managing the descriptor negotiation process,
|
* This class is responsible for managing the descriptor negotiation process,
|
||||||
* handling all the xmpp packets interchange and the stage control.
|
* handling all the xmpp packets interchange and the stage control.
|
||||||
*
|
*
|
||||||
* @author Alvaro Saurin
|
|
||||||
* @author Thiago Camargo
|
* @author Thiago Camargo
|
||||||
*/
|
*/
|
||||||
public class MediaNegotiator extends JingleNegotiator {
|
public class MediaNegotiator extends JingleNegotiator {
|
||||||
|
|
|
@ -1,3 +1,22 @@
|
||||||
|
/**
|
||||||
|
* $RCSfile$
|
||||||
|
* $Revision: 7329 $
|
||||||
|
* $Date: 2007-02-28 20:59:28 -0300 (qua, 28 fev 2007) $
|
||||||
|
*
|
||||||
|
* Copyright 2003-2005 Jive Software.
|
||||||
|
*
|
||||||
|
* All rights reserved. Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
package org.jivesoftware.smackx.jingle.media;
|
package org.jivesoftware.smackx.jingle.media;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,3 +1,23 @@
|
||||||
|
/**
|
||||||
|
* $RCSfile$
|
||||||
|
* $Revision: 7329 $
|
||||||
|
* $Date: 2007-02-28 20:59:28 -0300 (qua, 28 fev 2007) $
|
||||||
|
*
|
||||||
|
* Copyright 2003-2005 Jive Software.
|
||||||
|
*
|
||||||
|
* All rights reserved. Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
package org.jivesoftware.smackx.jingle.nat;
|
package org.jivesoftware.smackx.jingle.nat;
|
||||||
|
|
||||||
import org.jivesoftware.smack.XMPPException;
|
import org.jivesoftware.smack.XMPPException;
|
||||||
|
|
|
@ -1,3 +1,22 @@
|
||||||
|
/**
|
||||||
|
* $RCSfile$
|
||||||
|
* $Revision: 7329 $
|
||||||
|
* $Date: 2007-02-28 20:59:28 -0300 (qua, 28 fev 2007) $
|
||||||
|
*
|
||||||
|
* Copyright 2003-2005 Jive Software.
|
||||||
|
*
|
||||||
|
* All rights reserved. Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
package org.jivesoftware.smackx.jingle.nat;
|
package org.jivesoftware.smackx.jingle.nat;
|
||||||
|
|
||||||
import org.jivesoftware.smack.XMPPConnection;
|
import org.jivesoftware.smack.XMPPConnection;
|
||||||
|
|
|
@ -1,12 +1,3 @@
|
||||||
package org.jivesoftware.smackx.jingle.nat;
|
|
||||||
|
|
||||||
import org.jivesoftware.smack.XMPPConnection;
|
|
||||||
import org.jivesoftware.smack.XMPPException;
|
|
||||||
import org.jivesoftware.smackx.jingle.JingleSession;
|
|
||||||
import org.jivesoftware.smackx.jingle.listeners.CreatedJingleSessionListener;
|
|
||||||
import org.jivesoftware.smackx.jingle.listeners.JingleSessionListener;
|
|
||||||
import org.jivesoftware.smackx.jingle.media.PayloadType;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $RCSfile$
|
* $RCSfile$
|
||||||
* $Revision: $
|
* $Revision: $
|
||||||
|
@ -26,6 +17,14 @@ import org.jivesoftware.smackx.jingle.media.PayloadType;
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.jivesoftware.smackx.jingle.nat;
|
||||||
|
|
||||||
|
import org.jivesoftware.smack.XMPPConnection;
|
||||||
|
import org.jivesoftware.smack.XMPPException;
|
||||||
|
import org.jivesoftware.smackx.jingle.JingleSession;
|
||||||
|
import org.jivesoftware.smackx.jingle.listeners.CreatedJingleSessionListener;
|
||||||
|
import org.jivesoftware.smackx.jingle.listeners.JingleSessionListener;
|
||||||
|
import org.jivesoftware.smackx.jingle.media.PayloadType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A Jingle Transport Manager implementation to be used for NAT Networks.
|
* A Jingle Transport Manager implementation to be used for NAT Networks.
|
||||||
|
|
|
@ -1,3 +1,22 @@
|
||||||
|
/**
|
||||||
|
* $RCSfile$
|
||||||
|
* $Revision: $
|
||||||
|
* $Date: 15/11/2006
|
||||||
|
*
|
||||||
|
* Copyright 2003-2006 Jive Software.
|
||||||
|
*
|
||||||
|
* All rights reserved. Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
package org.jivesoftware.smackx.jingle.nat;
|
package org.jivesoftware.smackx.jingle.nat;
|
||||||
|
|
||||||
import java.net.DatagramPacket;
|
import java.net.DatagramPacket;
|
||||||
|
|
|
@ -1,3 +1,22 @@
|
||||||
|
/**
|
||||||
|
* $RCSfile$
|
||||||
|
* $Revision: $
|
||||||
|
* $Date: 15/11/2006
|
||||||
|
*
|
||||||
|
* Copyright 2003-2006 Jive Software.
|
||||||
|
*
|
||||||
|
* All rights reserved. Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
package org.jivesoftware.smackx.jingle.nat;
|
package org.jivesoftware.smackx.jingle.nat;
|
||||||
|
|
||||||
import org.jivesoftware.smack.XMPPException;
|
import org.jivesoftware.smack.XMPPException;
|
||||||
|
|
|
@ -1,3 +1,22 @@
|
||||||
|
/**
|
||||||
|
* $RCSfile$
|
||||||
|
* $Revision: $
|
||||||
|
* $Date: 15/11/2006
|
||||||
|
*
|
||||||
|
* Copyright 2003-2006 Jive Software.
|
||||||
|
*
|
||||||
|
* All rights reserved. Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
package org.jivesoftware.smackx.jingle.nat;
|
package org.jivesoftware.smackx.jingle.nat;
|
||||||
|
|
||||||
import org.jivesoftware.smack.XMPPException;
|
import org.jivesoftware.smack.XMPPException;
|
||||||
|
|
|
@ -1,3 +1,22 @@
|
||||||
|
/**
|
||||||
|
* $RCSfile$
|
||||||
|
* $Revision: $
|
||||||
|
* $Date: 15/11/2006
|
||||||
|
*
|
||||||
|
* Copyright 2003-2006 Jive Software.
|
||||||
|
*
|
||||||
|
* All rights reserved. Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
package org.jivesoftware.smackx.jingle.nat;
|
package org.jivesoftware.smackx.jingle.nat;
|
||||||
|
|
||||||
import org.jivesoftware.smack.PacketCollector;
|
import org.jivesoftware.smack.PacketCollector;
|
||||||
|
|
|
@ -1,3 +1,22 @@
|
||||||
|
/**
|
||||||
|
* $RCSfile$
|
||||||
|
* $Revision: $
|
||||||
|
* $Date: 15/11/2006
|
||||||
|
*
|
||||||
|
* Copyright 2003-2006 Jive Software.
|
||||||
|
*
|
||||||
|
* All rights reserved. Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
package org.jivesoftware.smackx.jingle.nat;
|
package org.jivesoftware.smackx.jingle.nat;
|
||||||
|
|
||||||
import de.javawi.jstun.test.BindingLifetimeTest;
|
import de.javawi.jstun.test.BindingLifetimeTest;
|
||||||
|
@ -21,7 +40,7 @@ import java.util.Enumeration;
|
||||||
*
|
*
|
||||||
* The goal of this resolver is to take possible to establish and manage out-of-band connections between two XMPP entities, even if they are behind Network Address Translators (NATs) or firewalls.
|
* The goal of this resolver is to take possible to establish and manage out-of-band connections between two XMPP entities, even if they are behind Network Address Translators (NATs) or firewalls.
|
||||||
*
|
*
|
||||||
* @author Alvaro Saurin
|
* @author Thiago Camargo
|
||||||
*/
|
*/
|
||||||
public class STUNResolver extends TransportResolver {
|
public class STUNResolver extends TransportResolver {
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,3 @@
|
||||||
package org.jivesoftware.smackx.jingle.nat;
|
|
||||||
|
|
||||||
import org.jivesoftware.smack.XMPPException;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $RCSfile$
|
* $RCSfile$
|
||||||
* $Revision: $
|
* $Revision: $
|
||||||
|
@ -21,6 +17,9 @@ import org.jivesoftware.smack.XMPPException;
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.jivesoftware.smackx.jingle.nat;
|
||||||
|
|
||||||
|
import org.jivesoftware.smack.XMPPException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A Jingle Transport Manager implementation to be used on NAT networks with STUN Service NOT Blocked.
|
* A Jingle Transport Manager implementation to be used on NAT networks with STUN Service NOT Blocked.
|
||||||
|
|
|
@ -1,3 +1,23 @@
|
||||||
|
/**
|
||||||
|
* $RCSfile$
|
||||||
|
* $Revision: $
|
||||||
|
* $Date: 15/11/2006
|
||||||
|
*
|
||||||
|
* Copyright 2003-2006 Jive Software.
|
||||||
|
*
|
||||||
|
* All rights reserved. Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
package org.jivesoftware.smackx.jingle.nat;
|
package org.jivesoftware.smackx.jingle.nat;
|
||||||
|
|
||||||
import org.jivesoftware.smack.XMPPException;
|
import org.jivesoftware.smack.XMPPException;
|
||||||
|
|
|
@ -1,3 +1,22 @@
|
||||||
|
/**
|
||||||
|
* $RCSfile$
|
||||||
|
* $Revision: $
|
||||||
|
* $Date: 15/11/2006
|
||||||
|
*
|
||||||
|
* Copyright 2003-2006 Jive Software.
|
||||||
|
*
|
||||||
|
* All rights reserved. Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
package org.jivesoftware.smackx.jingle.nat;
|
package org.jivesoftware.smackx.jingle.nat;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,3 +1,22 @@
|
||||||
|
/**
|
||||||
|
* $RCSfile$
|
||||||
|
* $Revision: 7329 $
|
||||||
|
* $Date: 2007-02-28 20:59:28 -0300 (qua, 28 fev 2007) $
|
||||||
|
*
|
||||||
|
* Copyright 2003-2005 Jive Software.
|
||||||
|
*
|
||||||
|
* All rights reserved. Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
package org.jivesoftware.smackx.packet;
|
package org.jivesoftware.smackx.packet;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.PacketExtension;
|
import org.jivesoftware.smack.packet.PacketExtension;
|
||||||
|
|
|
@ -1,3 +1,22 @@
|
||||||
|
/**
|
||||||
|
* $RCSfile$
|
||||||
|
* $Revision: 7329 $
|
||||||
|
* $Date: 2007-02-28 20:59:28 -0300 (qua, 28 fev 2007) $
|
||||||
|
*
|
||||||
|
* Copyright 2003-2005 Jive Software.
|
||||||
|
*
|
||||||
|
* All rights reserved. Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
package org.jivesoftware.smackx.packet;
|
package org.jivesoftware.smackx.packet;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.PacketExtension;
|
import org.jivesoftware.smack.packet.PacketExtension;
|
||||||
|
|
|
@ -21,6 +21,9 @@
|
||||||
package org.jivesoftware.smackx.packet;
|
package org.jivesoftware.smackx.packet;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.PacketExtension;
|
import org.jivesoftware.smack.packet.PacketExtension;
|
||||||
|
import org.jivesoftware.smack.provider.PacketExtensionProvider;
|
||||||
|
import org.jivesoftware.smackx.jingle.media.ContentInfo;
|
||||||
|
import org.xmlpull.v1.XmlPullParser;
|
||||||
|
|
||||||
public class JingleError implements PacketExtension {
|
public class JingleError implements PacketExtension {
|
||||||
|
|
||||||
|
@ -119,4 +122,36 @@ public class JingleError implements PacketExtension {
|
||||||
public String getNamespace() {
|
public String getNamespace() {
|
||||||
return NAMESPACE;
|
return NAMESPACE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static class Provider implements PacketExtensionProvider {
|
||||||
|
|
||||||
|
private PacketExtension audioInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Empty constructor.
|
||||||
|
*/
|
||||||
|
public Provider() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parse a JingleContentDescription.Audio extension.
|
||||||
|
*/
|
||||||
|
public PacketExtension parseExtension(final XmlPullParser parser)
|
||||||
|
throws Exception {
|
||||||
|
PacketExtension result = null;
|
||||||
|
|
||||||
|
if (audioInfo != null) {
|
||||||
|
result = audioInfo;
|
||||||
|
} else {
|
||||||
|
String elementName = parser.getName();
|
||||||
|
|
||||||
|
// Try to get an Audio content info
|
||||||
|
ContentInfo mi = ContentInfo.Audio.fromString(elementName);
|
||||||
|
if (mi != null) {
|
||||||
|
result = new JingleContentInfo.Audio(mi);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,22 @@
|
||||||
|
/**
|
||||||
|
* $RCSfile$
|
||||||
|
* $Revision: 7329 $
|
||||||
|
* $Date: 2007-02-28 20:59:28 -0300 (qua, 28 fev 2007) $
|
||||||
|
*
|
||||||
|
* Copyright 2003-2005 Jive Software.
|
||||||
|
*
|
||||||
|
* All rights reserved. Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
package org.jivesoftware.smackx.packet;
|
package org.jivesoftware.smackx.packet;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.PacketExtension;
|
import org.jivesoftware.smack.packet.PacketExtension;
|
||||||
|
|
|
@ -1,3 +1,22 @@
|
||||||
|
/**
|
||||||
|
* $RCSfile$
|
||||||
|
* $Revision: 7329 $
|
||||||
|
* $Date: 2007-02-28 20:59:28 -0300 (qua, 28 fev 2007) $
|
||||||
|
*
|
||||||
|
* Copyright 2003-2005 Jive Software.
|
||||||
|
*
|
||||||
|
* All rights reserved. Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
package org.jivesoftware.smackx.provider;
|
package org.jivesoftware.smackx.provider;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.PacketExtension;
|
import org.jivesoftware.smack.packet.PacketExtension;
|
||||||
|
|
|
@ -1,3 +1,22 @@
|
||||||
|
/**
|
||||||
|
* $RCSfile$
|
||||||
|
* $Revision: 7329 $
|
||||||
|
* $Date: 2007-02-28 20:59:28 -0300 (qua, 28 fev 2007) $
|
||||||
|
*
|
||||||
|
* Copyright 2003-2005 Jive Software.
|
||||||
|
*
|
||||||
|
* All rights reserved. Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
package org.jivesoftware.smackx.provider;
|
package org.jivesoftware.smackx.provider;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.PacketExtension;
|
import org.jivesoftware.smack.packet.PacketExtension;
|
||||||
|
|
|
@ -1,3 +1,22 @@
|
||||||
|
/**
|
||||||
|
* $RCSfile$
|
||||||
|
* $Revision: 7329 $
|
||||||
|
* $Date: 2007-02-28 20:59:28 -0300 (qua, 28 fev 2007) $
|
||||||
|
*
|
||||||
|
* Copyright 2003-2005 Jive Software.
|
||||||
|
*
|
||||||
|
* All rights reserved. Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
package org.jivesoftware.smackx.provider;
|
package org.jivesoftware.smackx.provider;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.PacketExtension;
|
import org.jivesoftware.smack.packet.PacketExtension;
|
||||||
|
|
|
@ -81,6 +81,7 @@ import java.util.List;
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @author Alvaro Saurin
|
* @author Alvaro Saurin
|
||||||
|
* @author Thiago Camargo
|
||||||
*/
|
*/
|
||||||
public class JingleManagerTest extends SmackTestCase {
|
public class JingleManagerTest extends SmackTestCase {
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ import java.util.ArrayList;
|
||||||
/**
|
/**
|
||||||
* Test the STUN IP resolver.
|
* Test the STUN IP resolver.
|
||||||
*
|
*
|
||||||
* @author alvaro
|
* @author Thiago Camargo
|
||||||
*/
|
*/
|
||||||
public class STUNResolverTest extends SmackTestCase {
|
public class STUNResolverTest extends SmackTestCase {
|
||||||
|
|
||||||
|
|
|
@ -129,11 +129,10 @@ public class JingleMediaTest extends SmackTestCase {
|
||||||
x1, new BasicTransportManager());
|
x1, new BasicTransportManager());
|
||||||
|
|
||||||
MultiMediaManager jingleMediaManager0 = new MultiMediaManager();
|
MultiMediaManager jingleMediaManager0 = new MultiMediaManager();
|
||||||
jingleMediaManager0.addMediaManager(new SpeexMediaManager());
|
// jingleMediaManager0.addMediaManager(new SpeexMediaManager());
|
||||||
jingleMediaManager0.addMediaManager(new JmfMediaManager());
|
|
||||||
jingleMediaManager0.addMediaManager(new JmfMediaManager());
|
jingleMediaManager0.addMediaManager(new JmfMediaManager());
|
||||||
MultiMediaManager jingleMediaManager1 = new MultiMediaManager();
|
MultiMediaManager jingleMediaManager1 = new MultiMediaManager();
|
||||||
jingleMediaManager1.addMediaManager(new JmfMediaManager());
|
// jingleMediaManager1.addMediaManager(new JmfMediaManager());
|
||||||
jingleMediaManager1.addMediaManager(new SpeexMediaManager());
|
jingleMediaManager1.addMediaManager(new SpeexMediaManager());
|
||||||
|
|
||||||
jm0.setMediaManager(jingleMediaManager0);
|
jm0.setMediaManager(jingleMediaManager0);
|
||||||
|
|
Loading…
Reference in a new issue