mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-13 02:59:39 +02:00
Activate the jingle subproject and move integration tests
The jingle subproject builds now. This doesn't change that the code is outdated with regard to the specification and unmaintained for years. But hopefully this is the first step to change that. :) The integration tests have been moved into SourceSets of 'core' and 'extensions'.
This commit is contained in:
parent
f7d3f559a2
commit
602a8fc812
177 changed files with 441 additions and 590 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,4 +1,6 @@
|
|||
/**
|
||||
*
|
||||
* Copyright the original author or authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
/**
|
||||
*
|
||||
* Copyright the original author or authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
/**
|
||||
*
|
||||
* Copyright the original author or authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
|
@ -14,12 +14,12 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jivesoftware.smackx.jingle;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.jivesoftware.smack.ConnectionCreationListener;
|
||||
import org.jivesoftware.smack.PacketListener;
|
||||
|
@ -32,7 +32,7 @@ import org.jivesoftware.smack.packet.Packet;
|
|||
import org.jivesoftware.smack.packet.Presence;
|
||||
import org.jivesoftware.smack.provider.ProviderManager;
|
||||
import org.jivesoftware.smack.util.StringUtils;
|
||||
import org.jivesoftware.smackx.ServiceDiscoveryManager;
|
||||
import org.jivesoftware.smackx.disco.ServiceDiscoveryManager;
|
||||
import org.jivesoftware.smackx.jingle.listeners.CreatedJingleSessionListener;
|
||||
import org.jivesoftware.smackx.jingle.listeners.JingleListener;
|
||||
import org.jivesoftware.smackx.jingle.listeners.JingleSessionListener;
|
||||
|
@ -42,7 +42,7 @@ import org.jivesoftware.smackx.jingle.media.PayloadType;
|
|||
import org.jivesoftware.smackx.jingle.nat.BasicTransportManager;
|
||||
import org.jivesoftware.smackx.jingle.nat.TransportCandidate;
|
||||
import org.jivesoftware.smackx.jingle.nat.TransportResolver;
|
||||
import org.jivesoftware.smackx.packet.DiscoverInfo;
|
||||
import org.jivesoftware.smackx.disco.packet.DiscoverInfo;
|
||||
import org.jivesoftware.smackx.packet.Jingle;
|
||||
import org.jivesoftware.smackx.provider.JingleProvider;
|
||||
|
||||
|
@ -181,7 +181,7 @@ import org.jivesoftware.smackx.provider.JingleProvider;
|
|||
*/
|
||||
public class JingleManager implements JingleSessionListener {
|
||||
|
||||
private static final SmackLogger LOGGER = SmackLogger.getLogger(JingleManager.class);
|
||||
private static final Logger LOGGER = Logger.getLogger(JingleManager.class.getName());
|
||||
|
||||
// non-static
|
||||
|
||||
|
@ -415,7 +415,7 @@ public class JingleManager implements JingleSessionListener {
|
|||
jingleSession.removeListener(this);
|
||||
jingleSessions.remove(jingleSession);
|
||||
jingleSession.close();
|
||||
LOGGER.error("Declined:" + reason);
|
||||
LOGGER.severe("Declined:" + reason);
|
||||
}
|
||||
|
||||
public void sessionRedirected(String redirection, JingleSession jingleSession) {
|
||||
|
|
|
@ -18,6 +18,7 @@ package org.jivesoftware.smackx.jingle;
|
|||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.jivesoftware.smack.Connection;
|
||||
import org.jivesoftware.smack.XMPPException;
|
||||
|
@ -40,7 +41,7 @@ import org.jivesoftware.smackx.jingle.listeners.JingleListener;
|
|||
*/
|
||||
public abstract class JingleNegotiator {
|
||||
|
||||
private static final SmackLogger LOGGER = SmackLogger.getLogger(JingleNegotiator.class);
|
||||
private static final Logger LOGGER = Logger.getLogger(JingleNegotiator.class.getName());
|
||||
|
||||
//private Connection connection; // The connection associated
|
||||
|
||||
|
@ -79,7 +80,7 @@ public abstract class JingleNegotiator {
|
|||
|
||||
JingleNegotiatorState stateWas = state;
|
||||
|
||||
LOGGER.debug("Negotiator state change: " + stateWas + "->" + stateIs + "(" + this.getClass().getSimpleName() + ")");
|
||||
LOGGER.fine("Negotiator state change: " + stateWas + "->" + stateIs + "(" + this.getClass().getSimpleName() + ")");
|
||||
|
||||
switch (stateIs) {
|
||||
case PENDING:
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
/**
|
||||
*
|
||||
* Copyright 2003-2005 Jive Software.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
/**
|
||||
*
|
||||
* Copyright the original author or authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -12,7 +14,6 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jivesoftware.smackx.jingle;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -20,6 +21,7 @@ import java.util.HashMap;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.jivesoftware.smack.ConnectionListener;
|
||||
import org.jivesoftware.smack.PacketListener;
|
||||
|
@ -56,7 +58,7 @@ import org.jivesoftware.smackx.packet.JingleError;
|
|||
*/
|
||||
public class JingleSession extends JingleNegotiator implements MediaReceivedListener {
|
||||
|
||||
private static final SmackLogger LOGGER = SmackLogger.getLogger(JingleSession.class);
|
||||
private static final Logger LOGGER = Logger.getLogger(JingleSession.class.getName());
|
||||
|
||||
// static
|
||||
private static final HashMap<Connection, JingleSession> sessions = new HashMap<Connection, JingleSession>();
|
||||
|
@ -235,7 +237,7 @@ public class JingleSession extends JingleNegotiator implements MediaReceivedList
|
|||
|
||||
public void setSessionState(JingleSessionState stateIs) {
|
||||
|
||||
LOGGER.debug("Session state change: " + sessionState + "->" + stateIs);
|
||||
LOGGER.fine("Session state change: " + sessionState + "->" + stateIs);
|
||||
stateIs.enter();
|
||||
sessionState = stateIs;
|
||||
}
|
||||
|
@ -278,7 +280,7 @@ public class JingleSession extends JingleNegotiator implements MediaReceivedList
|
|||
|
||||
String responseId = null;
|
||||
|
||||
LOGGER.debug("Packet: " + iq.toXML());
|
||||
LOGGER.fine("Packet: " + iq.toXML());
|
||||
|
||||
try {
|
||||
|
||||
|
@ -647,7 +649,7 @@ public class JingleSession extends JingleNegotiator implements MediaReceivedList
|
|||
if (connectionListener != null) {
|
||||
getConnection().removeConnectionListener(connectionListener);
|
||||
|
||||
LOGGER.debug("JINGLE SESSION: REMOVE CONNECTION LISTENER");
|
||||
LOGGER.fine("JINGLE SESSION: REMOVE CONNECTION LISTENER");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -658,7 +660,7 @@ public class JingleSession extends JingleNegotiator implements MediaReceivedList
|
|||
if (packetListener != null) {
|
||||
getConnection().removePacketListener(packetListener);
|
||||
|
||||
LOGGER.debug("JINGLE SESSION: REMOVE PACKET LISTENER");
|
||||
LOGGER.fine("JINGLE SESSION: REMOVE PACKET LISTENER");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -669,7 +671,7 @@ public class JingleSession extends JingleNegotiator implements MediaReceivedList
|
|||
protected void updatePacketListener() {
|
||||
removePacketListener();
|
||||
|
||||
LOGGER.debug("UpdatePacketListener");
|
||||
LOGGER.fine("UpdatePacketListener");
|
||||
|
||||
packetListener = new PacketListener() {
|
||||
public void processPacket(Packet packet) {
|
||||
|
@ -704,21 +706,21 @@ public class JingleSession extends JingleNegotiator implements MediaReceivedList
|
|||
|
||||
String sid = jin.getSid();
|
||||
if (sid == null || !sid.equals(getSid())) {
|
||||
LOGGER.debug("Ignored Jingle(SID) " + sid + "|" + getSid() + " :" + iq.toXML());
|
||||
LOGGER.fine("Ignored Jingle(SID) " + sid + "|" + getSid() + " :" + iq.toXML());
|
||||
return false;
|
||||
}
|
||||
String ini = jin.getInitiator();
|
||||
if (!ini.equals(getInitiator())) {
|
||||
LOGGER.debug("Ignored Jingle(INI): " + iq.toXML());
|
||||
LOGGER.fine("Ignored Jingle(INI): " + iq.toXML());
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
// We accept some non-Jingle IQ packets: ERRORs and ACKs
|
||||
if (iq.getType().equals(IQ.Type.SET)) {
|
||||
LOGGER.debug("Ignored Jingle(TYPE): " + iq.toXML());
|
||||
LOGGER.fine("Ignored Jingle(TYPE): " + iq.toXML());
|
||||
return false;
|
||||
} else if (iq.getType().equals(IQ.Type.GET)) {
|
||||
LOGGER.debug("Ignored Jingle(TYPE): " + iq.toXML());
|
||||
LOGGER.fine("Ignored Jingle(TYPE): " + iq.toXML());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -974,7 +976,7 @@ public class JingleSession extends JingleNegotiator implements MediaReceivedList
|
|||
public void terminate(String reason) throws XMPPException {
|
||||
if (isClosed())
|
||||
return;
|
||||
LOGGER.debug("Terminate " + reason);
|
||||
LOGGER.fine("Terminate " + reason);
|
||||
Jingle jout = new Jingle(JingleActionEnum.SESSION_TERMINATE);
|
||||
jout.setType(IQ.Type.SET);
|
||||
sendPacket(jout);
|
||||
|
@ -1003,7 +1005,7 @@ public class JingleSession extends JingleNegotiator implements MediaReceivedList
|
|||
removePacketListener();
|
||||
removeConnectionListener();
|
||||
getConnection().removeConnectionListener(connectionListener);
|
||||
LOGGER.debug("Negotiation Closed: " + getConnection().getUser() + " " + sid);
|
||||
LOGGER.fine("Negotiation Closed: " + getConnection().getUser() + " " + sid);
|
||||
super.close();
|
||||
|
||||
}
|
||||
|
@ -1062,7 +1064,7 @@ public class JingleSession extends JingleNegotiator implements MediaReceivedList
|
|||
IQ iqError = createIQ(ID, to, from, IQ.Type.ERROR);
|
||||
iqError.setError(error);
|
||||
|
||||
LOGGER.debug("Created Error Packet:" + iqError.toXML());
|
||||
LOGGER.fine("Created Error Packet:" + iqError.toXML());
|
||||
|
||||
return iqError;
|
||||
}
|
||||
|
@ -1093,7 +1095,7 @@ public class JingleSession extends JingleNegotiator implements MediaReceivedList
|
|||
|
||||
// NO! Let the normal state machinery do all of the sending.
|
||||
// getConnection().sendPacket(perror);
|
||||
LOGGER.error("Error sent: " + errorPacket.toXML());
|
||||
LOGGER.severe("Error sent: " + errorPacket.toXML());
|
||||
}
|
||||
return errorPacket;
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* 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
|
||||
* 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,
|
||||
|
@ -16,6 +16,9 @@
|
|||
*/
|
||||
package org.jivesoftware.smackx.jingle;
|
||||
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.jivesoftware.smack.XMPPException;
|
||||
import org.jivesoftware.smackx.packet.Jingle;
|
||||
|
||||
|
@ -30,7 +33,7 @@ import org.jivesoftware.smackx.packet.Jingle;
|
|||
*/
|
||||
public class JingleSessionRequest {
|
||||
|
||||
private static final SmackLogger LOGGER = SmackLogger.getLogger(JingleSessionRequest.class);
|
||||
private static final Logger LOGGER = Logger.getLogger(JingleSessionRequest.class.getName());
|
||||
|
||||
private final Jingle jingle; // The Jingle packet
|
||||
|
||||
|
@ -130,7 +133,7 @@ public class JingleSessionRequest {
|
|||
session.updatePacketListener();
|
||||
session.terminate("Declined");
|
||||
} catch (XMPPException e) {
|
||||
LOGGER.error("", e);
|
||||
LOGGER.log(Level.SEVERE, "XMPPexception in reject", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
/**
|
||||
*
|
||||
* Copyright the original author or authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
/**
|
||||
*
|
||||
* Copyright the original author or authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
/**
|
||||
*
|
||||
* Copyright the original author or authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -14,6 +16,8 @@
|
|||
*/
|
||||
package org.jivesoftware.smackx.jingle;
|
||||
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.jivesoftware.smack.packet.IQ;
|
||||
import org.jivesoftware.smackx.packet.Jingle;
|
||||
import org.jivesoftware.smackx.packet.JingleError;
|
||||
|
@ -24,7 +28,7 @@ import org.jivesoftware.smackx.packet.JingleError;
|
|||
*/
|
||||
public class JingleSessionStateEnded extends JingleSessionState {
|
||||
|
||||
private static final SmackLogger LOGGER = SmackLogger.getLogger(JingleSessionStateEnded.class);
|
||||
private static final Logger LOGGER = Logger.getLogger(JingleSessionStateEnded.class.getName());
|
||||
|
||||
private static JingleSessionStateEnded INSTANCE = null;
|
||||
|
||||
|
@ -45,8 +49,8 @@ public class JingleSessionStateEnded extends JingleSessionState {
|
|||
}
|
||||
|
||||
public void enter() {
|
||||
LOGGER.debug("Session Ended");
|
||||
LOGGER.debug("-------------------------------------------------------------------");
|
||||
LOGGER.fine("Session Ended");
|
||||
LOGGER.fine("-------------------------------------------------------------------");
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
/**
|
||||
*
|
||||
* Copyright the original author or authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
/**
|
||||
*
|
||||
* Copyright the original author or authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
|
@ -1,189 +0,0 @@
|
|||
/**
|
||||
*
|
||||
* Copyright 2003-2007 Jive Software.
|
||||
*
|
||||
* 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;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
/**
|
||||
* SmackLogger attempts to use Apache commons-logging if it's available.
|
||||
*
|
||||
* When you request an instance of SmackLogger we make an attempt to create an instance of org.apache.commons.logging.Log.
|
||||
* If we are able to make an instance of Log then we dispatch all log requests to commons-logging.
|
||||
* If we are not able to make an instance of Log then we dispatch all log requests to System.out/err.
|
||||
*
|
||||
* @author jeffw
|
||||
*/
|
||||
public class SmackLogger {
|
||||
|
||||
private Log commonsLogger;
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
/**
|
||||
* This static method is the only way to get an instance of a SmackLogger.
|
||||
* @param classToLog This is the class that wants to log. (This gives commons-logging a means to control log-level by class.)
|
||||
* @return An instance of a SmackLogger for the class that wants logging.
|
||||
*/
|
||||
public static SmackLogger getLogger(Class<?> classToLog) {
|
||||
return new SmackLogger(classToLog);
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
/**
|
||||
* This is private to make it impossible to instantiate a new SmackLogger outside of the getLogger() static method.
|
||||
* @param classToLog This is the class that wants to log. (This gives commons-logging a means to control log-level by class.)
|
||||
*/
|
||||
public SmackLogger(Class<?> classToLog) {
|
||||
setupSmackLogger(classToLog);
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
/**
|
||||
* The actual attempt to create an instance of commons-logging Log.
|
||||
* @param classToLog
|
||||
* @return
|
||||
*/
|
||||
private void setupSmackLogger(Class<?> classToLog) {
|
||||
try {
|
||||
Class<?> logFactoryClass = SmackLogger.class.getClassLoader().loadClass("org.apache.commons.logging.LogFactory");
|
||||
Method method = logFactoryClass.getMethod("getLog", Class.class);
|
||||
//Constructor<Log> constructor = Log.class.getConstructor(new Class[] { Object.class });
|
||||
commonsLogger = (Log) method.invoke(null, classToLog);
|
||||
|
||||
// We don't care to do anything about exceptions.
|
||||
// If we can't create a commons-logger then just use our simple one.
|
||||
} catch (ClassNotFoundException e) {
|
||||
} catch (SecurityException e) {
|
||||
} catch (NoSuchMethodException e) {
|
||||
} catch (IllegalArgumentException e) {
|
||||
} catch (IllegalAccessException e) {
|
||||
} catch (InvocationTargetException e) {
|
||||
}
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
/**
|
||||
* Wrapper for commons-logging error(Object msg, Exception exception)
|
||||
* @param inDebugMsg
|
||||
*/
|
||||
public void error(String inErrorMsg, Exception inException) {
|
||||
if (commonsLogger != null) {
|
||||
commonsLogger.error(inErrorMsg, inException);
|
||||
} else {
|
||||
System.err.println(inErrorMsg);
|
||||
inException.printStackTrace(System.err);
|
||||
}
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
/**
|
||||
* Wrapper for commons-logging error(Object msg)
|
||||
* @param inDebugMsg
|
||||
*/
|
||||
public void error(String inErrorMsg) {
|
||||
if (commonsLogger != null) {
|
||||
commonsLogger.error(inErrorMsg);
|
||||
} else {
|
||||
System.err.println(inErrorMsg);
|
||||
}
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
/**
|
||||
* Wrapper for commons-logging debug(Object msg)
|
||||
* @param inDebugMsg
|
||||
*/
|
||||
public void debug(String inDebugMsg, Exception inException) {
|
||||
if (commonsLogger != null) {
|
||||
commonsLogger.debug(inDebugMsg, inException);
|
||||
} else {
|
||||
System.out.println(inDebugMsg);
|
||||
inException.printStackTrace(System.out);
|
||||
}
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
/**
|
||||
* Wrapper for commons-logging debug(Object msg)
|
||||
* @param inDebugMsg
|
||||
*/
|
||||
public void debug(String inDebugMsg) {
|
||||
if (commonsLogger != null) {
|
||||
commonsLogger.debug(inDebugMsg);
|
||||
} else {
|
||||
System.out.println(inDebugMsg);
|
||||
}
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
/**
|
||||
* Wrapper for commons-logging warn(Object msg)
|
||||
* @param inDebugMsg
|
||||
*/
|
||||
public void warn(String inDebugMsg, Exception inException) {
|
||||
if (commonsLogger != null) {
|
||||
commonsLogger.warn(inDebugMsg, inException);
|
||||
} else {
|
||||
System.out.println(inDebugMsg);
|
||||
inException.printStackTrace(System.out);
|
||||
}
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
/**
|
||||
* Wrapper for commons-logging warn(Object msg)
|
||||
* @param inDebugMsg
|
||||
*/
|
||||
public void warn(String inDebugMsg) {
|
||||
if (commonsLogger != null) {
|
||||
commonsLogger.warn(inDebugMsg);
|
||||
} else {
|
||||
System.out.println(inDebugMsg);
|
||||
}
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
/**
|
||||
* Wrapper for commons-logging info(Object msg)
|
||||
* @param inDebugMsg
|
||||
*/
|
||||
public void info(String inDebugMsg, Exception inException) {
|
||||
if (commonsLogger != null) {
|
||||
commonsLogger.info(inDebugMsg, inException);
|
||||
} else {
|
||||
System.out.println(inDebugMsg);
|
||||
inException.printStackTrace(System.out);
|
||||
}
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
/**
|
||||
* Wrapper for commons-logging info(Object msg)
|
||||
* @param inDebugMsg
|
||||
*/
|
||||
public void info(String inDebugMsg) {
|
||||
if (commonsLogger != null) {
|
||||
commonsLogger.info(inDebugMsg);
|
||||
} else {
|
||||
System.out.println(inDebugMsg);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -6,7 +6,7 @@
|
|||
* 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
|
||||
* 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,
|
||||
|
@ -14,7 +14,6 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jivesoftware.smackx.jingle.listeners;
|
||||
|
||||
import org.jivesoftware.smackx.jingle.JingleSession;
|
||||
|
|
|
@ -18,6 +18,7 @@ package org.jivesoftware.smackx.jingle.media;
|
|||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.jivesoftware.smack.XMPPException;
|
||||
import org.jivesoftware.smack.packet.IQ;
|
||||
|
@ -27,7 +28,6 @@ import org.jivesoftware.smackx.jingle.JingleException;
|
|||
import org.jivesoftware.smackx.jingle.JingleNegotiator;
|
||||
import org.jivesoftware.smackx.jingle.JingleNegotiatorState;
|
||||
import org.jivesoftware.smackx.jingle.JingleSession;
|
||||
import org.jivesoftware.smackx.jingle.SmackLogger;
|
||||
import org.jivesoftware.smackx.jingle.listeners.JingleListener;
|
||||
import org.jivesoftware.smackx.jingle.listeners.JingleMediaListener;
|
||||
import org.jivesoftware.smackx.packet.Jingle;
|
||||
|
@ -45,7 +45,7 @@ import org.jivesoftware.smackx.packet.JingleError;
|
|||
*/
|
||||
public class MediaNegotiator extends JingleNegotiator {
|
||||
|
||||
private static final SmackLogger LOGGER = SmackLogger.getLogger(MediaNegotiator.class);
|
||||
private static final Logger LOGGER = Logger.getLogger(MediaNegotiator.class.getName());
|
||||
|
||||
//private JingleSession session; // The session this negotiation
|
||||
|
||||
|
@ -216,7 +216,7 @@ public class MediaNegotiator extends JingleNegotiator {
|
|||
|
||||
setNegotiatorState(JingleNegotiatorState.SUCCEEDED);
|
||||
triggerMediaEstablished(getBestCommonAudioPt());
|
||||
LOGGER.error("Media choice:" + getBestCommonAudioPt().getName());
|
||||
LOGGER.severe("Media choice:" + getBestCommonAudioPt().getName());
|
||||
|
||||
response = session.createAck(jingle);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
/**
|
||||
*
|
||||
* Copyright the original author or authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -18,14 +20,13 @@ import java.awt.Frame;
|
|||
import java.awt.TextArea;
|
||||
import java.awt.Toolkit;
|
||||
import java.util.Vector;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.media.Format;
|
||||
import javax.media.PlugInManager;
|
||||
import javax.media.Renderer;
|
||||
import javax.media.format.AudioFormat;
|
||||
|
||||
import org.jivesoftware.smackx.jingle.SmackLogger;
|
||||
|
||||
import com.sun.media.ExclusiveUse;
|
||||
import com.sun.media.util.Registry;
|
||||
|
||||
|
@ -33,7 +34,7 @@ public class JMFInit extends Frame implements Runnable {
|
|||
|
||||
private static final long serialVersionUID = 6476412003260641680L;
|
||||
|
||||
private static final SmackLogger LOGGER = SmackLogger.getLogger(JMFInit.class);
|
||||
private static final Logger LOGGER = Logger.getLogger(JMFInit.class.getName());
|
||||
|
||||
private String tempDir = "/tmp";
|
||||
|
||||
|
@ -271,7 +272,7 @@ public class JMFInit extends Frame implements Runnable {
|
|||
}
|
||||
|
||||
private void message(String mesg) {
|
||||
LOGGER.debug(mesg);
|
||||
LOGGER.fine(mesg);
|
||||
}
|
||||
|
||||
private void createGUI() {
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
/**
|
||||
* <p/>
|
||||
*
|
||||
* Copyright 2003-2006 Jive Software.
|
||||
* <p/>
|
||||
*
|
||||
* 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
|
||||
* <p/>
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* <p/>
|
||||
*
|
||||
* 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.
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
/**
|
||||
* <p/>
|
||||
*
|
||||
* Copyright 2003-2006 Jive Software.
|
||||
* <p/>
|
||||
*
|
||||
* 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
|
||||
* <p/>
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* <p/>
|
||||
*
|
||||
* 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.
|
||||
|
@ -21,6 +21,7 @@ import java.net.InetAddress;
|
|||
import java.net.UnknownHostException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.media.Codec;
|
||||
import javax.media.Controller;
|
||||
|
@ -45,7 +46,6 @@ import javax.media.rtp.RTPManager;
|
|||
import javax.media.rtp.SendStream;
|
||||
import javax.media.rtp.SessionAddress;
|
||||
|
||||
import org.jivesoftware.smackx.jingle.SmackLogger;
|
||||
import org.jivesoftware.smackx.jingle.media.JingleMediaSession;
|
||||
|
||||
/**
|
||||
|
@ -68,7 +68,7 @@ import org.jivesoftware.smackx.jingle.media.JingleMediaSession;
|
|||
*/
|
||||
public class AudioChannel {
|
||||
|
||||
private static final SmackLogger LOGGER = SmackLogger.getLogger(AudioChannel.class);
|
||||
private static final Logger LOGGER = Logger.getLogger(AudioChannel.class.getName());
|
||||
|
||||
private MediaLocator locator;
|
||||
private String localIpAddress;
|
||||
|
@ -249,8 +249,7 @@ public class AudioChannel {
|
|||
}
|
||||
if (chosen != null) {
|
||||
tracks[i].setFormat(chosen);
|
||||
LOGGER.error("Track " + i + " is set to transmit as:");
|
||||
LOGGER.error(" " + chosen);
|
||||
LOGGER.severe("Track " + i + " is set to transmit as: " + chosen);
|
||||
|
||||
if (tracks[i].getFormat() instanceof AudioFormat) {
|
||||
int packetRate = 20;
|
||||
|
@ -385,7 +384,7 @@ public class AudioChannel {
|
|||
|
||||
rtpMgrs[i].addTarget(destAddr);
|
||||
|
||||
LOGGER.error("Created RTP session at " + localPort + " to: " + remoteIpAddress + " " + port);
|
||||
LOGGER.severe("Created RTP session at " + localPort + " to: " + remoteIpAddress + " " + port);
|
||||
|
||||
sendStream = rtpMgrs[i].createSendStream(dataOutput, i);
|
||||
|
||||
|
@ -414,11 +413,11 @@ public class AudioChannel {
|
|||
try {
|
||||
if (active) {
|
||||
sendStream.start();
|
||||
LOGGER.debug("START");
|
||||
LOGGER.fine("START");
|
||||
}
|
||||
else {
|
||||
sendStream.stop();
|
||||
LOGGER.debug("STOP");
|
||||
LOGGER.fine("STOP");
|
||||
}
|
||||
}
|
||||
catch (IOException e) {
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
/**
|
||||
* <p/>
|
||||
*
|
||||
* Copyright 2003-2006 Jive Software.
|
||||
* <p/>
|
||||
*
|
||||
* 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
|
||||
* <p/>
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* <p/>
|
||||
*
|
||||
* 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.
|
||||
|
|
|
@ -1,29 +1,28 @@
|
|||
/**
|
||||
* <p/>
|
||||
*
|
||||
* Copyright 2003-2006 Jive Software.
|
||||
* <p/>
|
||||
*
|
||||
* 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
|
||||
* <p/>
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* <p/>
|
||||
*
|
||||
* 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.mediaimpl.jmf;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.ServerSocket;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.media.MediaLocator;
|
||||
|
||||
import org.jivesoftware.smackx.jingle.JingleSession;
|
||||
import org.jivesoftware.smackx.jingle.SmackLogger;
|
||||
import org.jivesoftware.smackx.jingle.media.JingleMediaSession;
|
||||
import org.jivesoftware.smackx.jingle.media.PayloadType;
|
||||
import org.jivesoftware.smackx.jingle.nat.TransportCandidate;
|
||||
|
@ -40,7 +39,7 @@ import org.jivesoftware.smackx.jingle.nat.TransportCandidate;
|
|||
*/
|
||||
public class AudioMediaSession extends JingleMediaSession {
|
||||
|
||||
private static final SmackLogger LOGGER = SmackLogger.getLogger(AudioMediaSession.class);
|
||||
private static final Logger LOGGER = Logger.getLogger(AudioMediaSession.class.getName());
|
||||
|
||||
private AudioChannel audioChannel;
|
||||
|
||||
|
@ -74,7 +73,7 @@ public class AudioMediaSession extends JingleMediaSession {
|
|||
localPort = getFreePort();
|
||||
remotePort = this.getLocal().getSymmetric().getPort();
|
||||
|
||||
LOGGER.debug(this.getLocal().getConnection() + " " + ip + ": " + localPort + "->" + remotePort);
|
||||
LOGGER.fine(this.getLocal().getConnection() + " " + ip + ": " + localPort + "->" + remotePort);
|
||||
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -1,22 +1,23 @@
|
|||
/**
|
||||
* <p/>
|
||||
*
|
||||
* Copyright 2003-2006 Jive Software.
|
||||
* <p/>
|
||||
*
|
||||
* 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
|
||||
* <p/>
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* <p/>
|
||||
*
|
||||
* 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.mediaimpl.jmf;
|
||||
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.media.ControllerErrorEvent;
|
||||
import javax.media.ControllerEvent;
|
||||
import javax.media.ControllerListener;
|
||||
|
@ -36,7 +37,6 @@ import javax.media.rtp.event.RemotePayloadChangeEvent;
|
|||
import javax.media.rtp.event.SessionEvent;
|
||||
import javax.media.rtp.event.StreamMappedEvent;
|
||||
|
||||
import org.jivesoftware.smackx.jingle.SmackLogger;
|
||||
import org.jivesoftware.smackx.jingle.media.JingleMediaSession;
|
||||
|
||||
/**
|
||||
|
@ -47,7 +47,7 @@ import org.jivesoftware.smackx.jingle.media.JingleMediaSession;
|
|||
public class AudioReceiver implements ReceiveStreamListener, SessionListener,
|
||||
ControllerListener {
|
||||
|
||||
private static final SmackLogger LOGGER = SmackLogger.getLogger(AudioReceiver.class);
|
||||
private static final Logger LOGGER = Logger.getLogger(AudioReceiver.class.getName());
|
||||
|
||||
boolean dataReceived = false;
|
||||
|
||||
|
@ -65,7 +65,7 @@ public class AudioReceiver implements ReceiveStreamListener, SessionListener,
|
|||
public synchronized void update(SessionEvent evt) {
|
||||
if (evt instanceof NewParticipantEvent) {
|
||||
Participant p = ((NewParticipantEvent) evt).getParticipant();
|
||||
LOGGER.error(" - A new participant had just joined: " + p.getCNAME());
|
||||
LOGGER.fine(" - A new participant had just joined: " + p.getCNAME());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -78,8 +78,8 @@ public class AudioReceiver implements ReceiveStreamListener, SessionListener,
|
|||
ReceiveStream stream = evt.getReceiveStream(); // could be null.
|
||||
|
||||
if (evt instanceof RemotePayloadChangeEvent) {
|
||||
LOGGER.error(" - Received an RTP PayloadChangeEvent.");
|
||||
LOGGER.error("Sorry, cannot handle payload change.");
|
||||
LOGGER.severe(" - Received an RTP PayloadChangeEvent.");
|
||||
LOGGER.severe("Sorry, cannot handle payload change.");
|
||||
|
||||
}
|
||||
else if (evt instanceof NewReceiveStreamEvent) {
|
||||
|
@ -91,15 +91,15 @@ public class AudioReceiver implements ReceiveStreamListener, SessionListener,
|
|||
// Find out the formats.
|
||||
RTPControl ctl = (RTPControl) ds.getControl("javax.jmf.rtp.RTPControl");
|
||||
if (ctl != null) {
|
||||
LOGGER.error(" - Recevied new RTP stream: " + ctl.getFormat());
|
||||
LOGGER.severe(" - Recevied new RTP stream: " + ctl.getFormat());
|
||||
}
|
||||
else
|
||||
LOGGER.error(" - Recevied new RTP stream");
|
||||
LOGGER.severe(" - Recevied new RTP stream");
|
||||
|
||||
if (participant == null)
|
||||
LOGGER.error(" The sender of this stream had yet to be identified.");
|
||||
LOGGER.severe(" The sender of this stream had yet to be identified.");
|
||||
else {
|
||||
LOGGER.error(" The stream comes from: " + participant.getCNAME());
|
||||
LOGGER.severe(" The stream comes from: " + participant.getCNAME());
|
||||
}
|
||||
|
||||
// create a player by passing datasource to the Media Manager
|
||||
|
@ -119,7 +119,7 @@ public class AudioReceiver implements ReceiveStreamListener, SessionListener,
|
|||
|
||||
}
|
||||
catch (Exception e) {
|
||||
LOGGER.error("NewReceiveStreamEvent exception " + e.getMessage());
|
||||
LOGGER.severe("NewReceiveStreamEvent exception " + e.getMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -130,15 +130,15 @@ public class AudioReceiver implements ReceiveStreamListener, SessionListener,
|
|||
DataSource ds = stream.getDataSource();
|
||||
// Find out the formats.
|
||||
RTPControl ctl = (RTPControl) ds.getControl("javax.jmf.rtp.RTPControl");
|
||||
LOGGER.error(" - The previously unidentified stream ");
|
||||
LOGGER.severe(" - The previously unidentified stream ");
|
||||
if (ctl != null)
|
||||
LOGGER.error(" " + ctl.getFormat());
|
||||
LOGGER.error(" had now been identified as sent by: " + participant.getCNAME());
|
||||
LOGGER.severe(" " + ctl.getFormat());
|
||||
LOGGER.severe(" had now been identified as sent by: " + participant.getCNAME());
|
||||
}
|
||||
}
|
||||
else if (evt instanceof ByeEvent) {
|
||||
|
||||
LOGGER.error(" - Got \"bye\" from: " + participant.getCNAME());
|
||||
LOGGER.severe(" - Got \"bye\" from: " + participant.getCNAME());
|
||||
|
||||
}
|
||||
|
||||
|
@ -161,7 +161,7 @@ public class AudioReceiver implements ReceiveStreamListener, SessionListener,
|
|||
|
||||
if (ce instanceof ControllerErrorEvent) {
|
||||
p.removeControllerListener(this);
|
||||
LOGGER.error("Receiver internal error: " + ce);
|
||||
LOGGER.severe("Receiver internal error: " + ce);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,29 +1,28 @@
|
|||
/**
|
||||
* <p/>
|
||||
*
|
||||
* Copyright 2003-2006 Jive Software.
|
||||
* <p/>
|
||||
*
|
||||
* 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
|
||||
* <p/>
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* <p/>
|
||||
*
|
||||
* 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.mediaimpl.jmf;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.jivesoftware.smackx.jingle.JingleSession;
|
||||
import org.jivesoftware.smackx.jingle.SmackLogger;
|
||||
import org.jivesoftware.smackx.jingle.media.JingleMediaManager;
|
||||
import org.jivesoftware.smackx.jingle.media.JingleMediaSession;
|
||||
import org.jivesoftware.smackx.jingle.media.PayloadType;
|
||||
|
@ -40,7 +39,7 @@ import org.jivesoftware.smackx.jingle.nat.TransportCandidate;
|
|||
*/
|
||||
public class JmfMediaManager extends JingleMediaManager {
|
||||
|
||||
private static final SmackLogger LOGGER = SmackLogger.getLogger(JmfMediaManager.class);
|
||||
private static final Logger LOGGER = Logger.getLogger(JmfMediaManager.class.getName());
|
||||
|
||||
public static final String MEDIA_NAME = "JMF";
|
||||
|
||||
|
@ -142,7 +141,7 @@ public class JmfMediaManager extends JingleMediaManager {
|
|||
jmfProperties.createNewFile();
|
||||
}
|
||||
catch (IOException ex) {
|
||||
LOGGER.debug("Failed to create jmf.properties");
|
||||
LOGGER.fine("Failed to create jmf.properties");
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,20 +1,19 @@
|
|||
/**
|
||||
* <p/>
|
||||
*
|
||||
* Copyright 2003-2006 Jive Software.
|
||||
* <p/>
|
||||
*
|
||||
* 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
|
||||
* <p/>
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* <p/>
|
||||
*
|
||||
* 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.mediaimpl.jspeex;
|
||||
|
||||
import java.io.IOException;
|
||||
|
@ -22,6 +21,7 @@ import java.net.DatagramSocket;
|
|||
import java.net.InetAddress;
|
||||
import java.net.ServerSocket;
|
||||
import java.security.GeneralSecurityException;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.media.NoProcessorException;
|
||||
import javax.media.format.UnsupportedFormatException;
|
||||
|
@ -34,7 +34,6 @@ import mil.jfcom.cie.media.session.StreamPlayer;
|
|||
import mil.jfcom.cie.media.srtp.packetizer.SpeexFormat;
|
||||
|
||||
import org.jivesoftware.smackx.jingle.JingleSession;
|
||||
import org.jivesoftware.smackx.jingle.SmackLogger;
|
||||
import org.jivesoftware.smackx.jingle.media.JingleMediaSession;
|
||||
import org.jivesoftware.smackx.jingle.media.PayloadType;
|
||||
import org.jivesoftware.smackx.jingle.nat.TransportCandidate;
|
||||
|
@ -52,7 +51,7 @@ import org.jivesoftware.smackx.jingle.nat.TransportCandidate;
|
|||
|
||||
public class AudioMediaSession extends JingleMediaSession implements MediaSessionListener {
|
||||
|
||||
private static final SmackLogger LOGGER = SmackLogger.getLogger(AudioMediaSession.class);
|
||||
private static final Logger LOGGER = Logger.getLogger(AudioMediaSession.class.getName());
|
||||
|
||||
private MediaSession mediaSession;
|
||||
|
||||
|
@ -125,7 +124,7 @@ public class AudioMediaSession extends JingleMediaSession implements MediaSessio
|
|||
localPort = getFreePort();
|
||||
remotePort = this.getLocal().getSymmetric().getPort();
|
||||
|
||||
LOGGER.debug(this.getLocal().getConnection() + " " + ip + ": " + localPort + "->" + remotePort);
|
||||
LOGGER.fine(this.getLocal().getConnection() + " " + ip + ": " + localPort + "->" + remotePort);
|
||||
|
||||
}
|
||||
else {
|
||||
|
@ -157,7 +156,7 @@ public class AudioMediaSession extends JingleMediaSession implements MediaSessio
|
|||
*/
|
||||
public void startTrasmit() {
|
||||
try {
|
||||
LOGGER.debug("start");
|
||||
LOGGER.fine("start");
|
||||
mediaSession.start(true);
|
||||
this.mediaReceived("");
|
||||
}
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
/**
|
||||
* <p/>
|
||||
*
|
||||
* Copyright 2003-2006 Jive Software.
|
||||
* <p/>
|
||||
*
|
||||
* 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
|
||||
* <p/>
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* <p/>
|
||||
*
|
||||
* 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.
|
||||
|
@ -20,9 +20,9 @@ import java.io.File;
|
|||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.jivesoftware.smackx.jingle.JingleSession;
|
||||
import org.jivesoftware.smackx.jingle.SmackLogger;
|
||||
import org.jivesoftware.smackx.jingle.media.JingleMediaManager;
|
||||
import org.jivesoftware.smackx.jingle.media.JingleMediaSession;
|
||||
import org.jivesoftware.smackx.jingle.media.PayloadType;
|
||||
|
@ -39,7 +39,7 @@ import org.jivesoftware.smackx.jingle.nat.TransportCandidate;
|
|||
*/
|
||||
public class SpeexMediaManager extends JingleMediaManager {
|
||||
|
||||
private static final SmackLogger LOGGER = SmackLogger.getLogger(SpeexMediaManager.class);
|
||||
private static final Logger LOGGER = Logger.getLogger(SpeexMediaManager.class.getName());
|
||||
|
||||
public static final String MEDIA_NAME = "Speex";
|
||||
|
||||
|
@ -106,7 +106,7 @@ public class SpeexMediaManager extends JingleMediaManager {
|
|||
jmfProperties.createNewFile();
|
||||
}
|
||||
catch (IOException ex) {
|
||||
LOGGER.debug("Failed to create jmf.properties");
|
||||
LOGGER.fine("Failed to create jmf.properties");
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,20 +1,19 @@
|
|||
/**
|
||||
* <p/>
|
||||
*
|
||||
* Copyright 2003-2006 Jive Software.
|
||||
* <p/>
|
||||
*
|
||||
* 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
|
||||
* <p/>
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* <p/>
|
||||
*
|
||||
* 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.mediaimpl.multi;
|
||||
|
||||
import org.jivesoftware.smackx.jingle.JingleSession;
|
||||
|
|
|
@ -1,20 +1,19 @@
|
|||
/**
|
||||
* <p/>
|
||||
*
|
||||
* Copyright 2003-2006 Jive Software.
|
||||
* <p/>
|
||||
*
|
||||
* 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
|
||||
* <p/>
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* <p/>
|
||||
*
|
||||
* 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.mediaimpl.sshare;
|
||||
|
||||
import org.jivesoftware.smackx.jingle.JingleSession;
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
/**
|
||||
* <p/>
|
||||
*
|
||||
* Copyright 2003-2006 Jive Software.
|
||||
* <p/>
|
||||
*
|
||||
* 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
|
||||
* <p/>
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* <p/>
|
||||
*
|
||||
* 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.
|
||||
|
@ -24,12 +24,12 @@ import java.net.DatagramSocket;
|
|||
import java.net.InetAddress;
|
||||
import java.net.ServerSocket;
|
||||
import java.net.UnknownHostException;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JPanel;
|
||||
|
||||
import org.jivesoftware.smackx.jingle.JingleSession;
|
||||
import org.jivesoftware.smackx.jingle.SmackLogger;
|
||||
import org.jivesoftware.smackx.jingle.media.JingleMediaSession;
|
||||
import org.jivesoftware.smackx.jingle.media.PayloadType;
|
||||
import org.jivesoftware.smackx.jingle.mediaimpl.sshare.api.ImageDecoder;
|
||||
|
@ -49,7 +49,7 @@ import org.jivesoftware.smackx.jingle.nat.TransportCandidate;
|
|||
*/
|
||||
public class ScreenShareSession extends JingleMediaSession {
|
||||
|
||||
private static final SmackLogger LOGGER = SmackLogger.getLogger(ScreenShareSession.class);
|
||||
private static final Logger LOGGER = Logger.getLogger(ScreenShareSession.class.getName());
|
||||
|
||||
private ImageTransmitter transmitter = null;
|
||||
private ImageReceiver receiver = null;
|
||||
|
@ -104,7 +104,7 @@ public class ScreenShareSession extends JingleMediaSession {
|
|||
try {
|
||||
receiver = new ImageReceiver(InetAddress.getByName("0.0.0.0"), getRemote().getPort(), getLocal().getPort(), width,
|
||||
height);
|
||||
LOGGER.debug("Receiving on:" + receiver.getLocalPort());
|
||||
LOGGER.fine("Receiving on:" + receiver.getLocalPort());
|
||||
} catch (UnknownHostException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
/*
|
||||
Copyright 2006 Jerry Huxtable
|
||||
|
||||
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.
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* Copyright 2006 Jerry Huxtable
|
||||
*
|
||||
* 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.mediaimpl.sshare.api;
|
||||
|
||||
import java.awt.*;
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
/**
|
||||
*
|
||||
* Copyright the original author or authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
/**
|
||||
*
|
||||
* Copyright the original author or authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
/**
|
||||
*
|
||||
* Copyright the original author or authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
/**
|
||||
*
|
||||
* Copyright the original author or authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
/**
|
||||
*
|
||||
* Copyright the original author or authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
/**
|
||||
*
|
||||
* Copyright the original author or authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -25,8 +27,7 @@ import java.net.DatagramPacket;
|
|||
import java.net.DatagramSocket;
|
||||
import java.net.InetAddress;
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.jivesoftware.smackx.jingle.SmackLogger;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
/**
|
||||
* UDP Image Receiver.
|
||||
|
@ -36,7 +37,7 @@ import org.jivesoftware.smackx.jingle.SmackLogger;
|
|||
*/
|
||||
public class ImageTransmitter implements Runnable {
|
||||
|
||||
private static final SmackLogger LOGGER = SmackLogger.getLogger(ImageTransmitter.class);
|
||||
private static final Logger LOGGER = Logger.getLogger(ImageTransmitter.class.getName());
|
||||
|
||||
private Robot robot;
|
||||
private InetAddress localHost;
|
||||
|
@ -100,7 +101,7 @@ public class ImageTransmitter implements Runnable {
|
|||
if (++keyframe > KEYFRAME) {
|
||||
keyframe = 0;
|
||||
}
|
||||
LOGGER.debug("KEYFRAME:" + keyframe);
|
||||
LOGGER.fine("KEYFRAME:" + keyframe);
|
||||
|
||||
for (int i = 0; i < maxI; i++) {
|
||||
for (int j = 0; j < maxJ; j++) {
|
||||
|
@ -130,7 +131,7 @@ public class ImageTransmitter implements Runnable {
|
|||
byte[] bytesOut = baos.toByteArray();
|
||||
|
||||
if (bytesOut.length > 1000)
|
||||
LOGGER.error("Bytes out > 1000. Equals " + bytesOut.length);
|
||||
LOGGER.severe("Bytes out > 1000. Equals " + bytesOut.length);
|
||||
|
||||
p.setData(bytesOut);
|
||||
p.setAddress(remoteHost);
|
||||
|
@ -162,7 +163,7 @@ public class ImageTransmitter implements Runnable {
|
|||
}
|
||||
|
||||
trace = (System.currentTimeMillis() - trace);
|
||||
LOGGER.debug("Loop Time:" + trace);
|
||||
LOGGER.fine("Loop Time:" + trace);
|
||||
|
||||
if (trace < 500) {
|
||||
try {
|
||||
|
|
|
@ -1,25 +1,24 @@
|
|||
/*
|
||||
Copyright 2006 Jerry Huxtable
|
||||
|
||||
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.
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* Copyright 2006 Jerry Huxtable
|
||||
*
|
||||
* 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.mediaimpl.sshare.api;
|
||||
|
||||
import java.io.PrintStream;
|
||||
import java.util.Vector;
|
||||
|
||||
import org.jivesoftware.smackx.jingle.SmackLogger;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
/**
|
||||
* An image Quantizer based on the Octree algorithm. This is a very basic implementation
|
||||
|
@ -28,7 +27,7 @@ import org.jivesoftware.smackx.jingle.SmackLogger;
|
|||
*/
|
||||
public class OctTreeQuantizer implements Quantizer {
|
||||
|
||||
private static final SmackLogger LOGGER = SmackLogger.getLogger(OctTreeQuantizer.class);
|
||||
private static final Logger LOGGER = Logger.getLogger(OctTreeQuantizer.class.getName());
|
||||
|
||||
/**
|
||||
* The greatest depth the tree is allowed to reach
|
||||
|
@ -58,9 +57,9 @@ public class OctTreeQuantizer implements Quantizer {
|
|||
for (int i = 0; i < level; i++)
|
||||
indentStr += " ";
|
||||
if (count == 0)
|
||||
LOGGER.debug(indentStr + index + ": count=" + count);
|
||||
LOGGER.fine(indentStr + index + ": count=" + count);
|
||||
else
|
||||
LOGGER.debug(indentStr + index + ": count=" + count + " red=" + (totalRed/count) + " green=" + (totalGreen / count) + " blue=" + (totalBlue / count));
|
||||
LOGGER.fine(indentStr + index + ": count=" + count + " red=" + (totalRed/count) + " green=" + (totalGreen / count) + " blue=" + (totalBlue / count));
|
||||
for (int i = 0; i < 8; i++)
|
||||
if (leaf[i] != null)
|
||||
leaf[i].list(s, level+2);
|
||||
|
@ -138,7 +137,7 @@ public class OctTreeQuantizer implements Quantizer {
|
|||
else
|
||||
node = child;
|
||||
}
|
||||
LOGGER.debug("getIndexForColor failed");
|
||||
LOGGER.fine("getIndexForColor failed");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -149,7 +148,7 @@ public class OctTreeQuantizer implements Quantizer {
|
|||
|
||||
OctTreeNode node = root;
|
||||
|
||||
// LOGGER.debug("insertColor="+Integer.toHexString(rgb));
|
||||
// LOGGER.fine("insertColor="+Integer.toHexString(rgb));
|
||||
for (int level = 0; level <= MAX_LEVEL; level++) {
|
||||
OctTreeNode child;
|
||||
int bit = 0x80 >> level;
|
||||
|
@ -195,7 +194,7 @@ public class OctTreeQuantizer implements Quantizer {
|
|||
} else
|
||||
node = child;
|
||||
}
|
||||
LOGGER.debug("insertColor failed");
|
||||
LOGGER.fine("insertColor failed");
|
||||
}
|
||||
|
||||
private void reduceTree(int numColors) {
|
||||
|
@ -209,7 +208,7 @@ public class OctTreeQuantizer implements Quantizer {
|
|||
OctTreeNode child = node.leaf[i];
|
||||
if (child != null) {
|
||||
if (!child.isLeaf)
|
||||
LOGGER.debug("not a leaf!");
|
||||
LOGGER.fine("not a leaf!");
|
||||
node.count += child.count;
|
||||
node.totalRed += child.totalRed;
|
||||
node.totalGreen += child.totalGreen;
|
||||
|
@ -230,7 +229,7 @@ public class OctTreeQuantizer implements Quantizer {
|
|||
}
|
||||
}
|
||||
|
||||
LOGGER.debug("Unable to reduce the OctTree");
|
||||
LOGGER.fine("Unable to reduce the OctTree");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
/*
|
||||
Copyright 2006 Jerry Huxtable
|
||||
|
||||
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.
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* Copyright 2006 Jerry Huxtable
|
||||
*
|
||||
* 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.mediaimpl.sshare.api;
|
||||
|
||||
import java.awt.*;
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
/*
|
||||
Copyright 2006 Jerry Huxtable
|
||||
|
||||
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.
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* Copyright 2006 Jerry Huxtable
|
||||
*
|
||||
* 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.mediaimpl.sshare.api;
|
||||
|
||||
import java.awt.*;
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
/*
|
||||
Copyright 2006 Jerry Huxtable
|
||||
|
||||
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.
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* Copyright 2006 Jerry Huxtable
|
||||
*
|
||||
* 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.mediaimpl.sshare.api;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
/*
|
||||
Copyright 2006 Jerry Huxtable
|
||||
|
||||
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.
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* Copyright 2006 Jerry Huxtable
|
||||
*
|
||||
* 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.mediaimpl.sshare.api;
|
||||
|
||||
import java.awt.*;
|
||||
|
|
|
@ -1,20 +1,19 @@
|
|||
/**
|
||||
* <p/>
|
||||
*
|
||||
* Copyright 2003-2006 Jive Software.
|
||||
* <p/>
|
||||
*
|
||||
* 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
|
||||
* <p/>
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* <p/>
|
||||
*
|
||||
* 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.mediaimpl.test;
|
||||
|
||||
import org.jivesoftware.smackx.jingle.media.JingleMediaManager;
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
/**
|
||||
* <p/>
|
||||
*
|
||||
* Copyright 2003-2006 Jive Software.
|
||||
* <p/>
|
||||
*
|
||||
* 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
|
||||
* <p/>
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* <p/>
|
||||
*
|
||||
* 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.
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jivesoftware.smackx.jingle.nat;
|
||||
|
||||
import org.jivesoftware.smack.XMPPException;
|
||||
|
|
|
@ -1,7 +1,3 @@
|
|||
package org.jivesoftware.smackx.jingle.nat;
|
||||
|
||||
import org.jivesoftware.smackx.jingle.JingleSession;
|
||||
|
||||
/**
|
||||
*
|
||||
* Copyright 2003-2006 Jive Software.
|
||||
|
@ -10,7 +6,7 @@ import org.jivesoftware.smackx.jingle.JingleSession;
|
|||
* 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
|
||||
* 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,
|
||||
|
@ -18,6 +14,9 @@ import org.jivesoftware.smackx.jingle.JingleSession;
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.jivesoftware.smackx.jingle.nat;
|
||||
|
||||
import org.jivesoftware.smackx.jingle.JingleSession;
|
||||
|
||||
/**
|
||||
* A Basic Jingle Transport Manager implementation.
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* 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
|
||||
* 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,
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* 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
|
||||
* 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,
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* 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
|
||||
* 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,
|
||||
|
|
|
@ -1,12 +1,3 @@
|
|||
package org.jivesoftware.smackx.jingle.nat;
|
||||
|
||||
import org.jivesoftware.smack.XMPPException;
|
||||
import org.jivesoftware.smackx.jingle.ContentNegotiator;
|
||||
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;
|
||||
|
||||
/**
|
||||
*
|
||||
* Copyright 2003-2006 Jive Software.
|
||||
|
@ -15,7 +6,7 @@ import org.jivesoftware.smackx.jingle.media.PayloadType;
|
|||
* 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
|
||||
* 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,
|
||||
|
@ -23,6 +14,13 @@ import org.jivesoftware.smackx.jingle.media.PayloadType;
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.jivesoftware.smackx.jingle.nat;
|
||||
|
||||
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 Fixed Jingle Transport Manager implementation.
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
/**
|
||||
*
|
||||
* Copyright the original author or authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -12,7 +14,6 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jivesoftware.smackx.jingle.nat;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
|
@ -23,15 +24,15 @@ import java.io.OutputStream;
|
|||
import java.net.ServerSocket;
|
||||
import java.net.Socket;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
import org.jivesoftware.smackx.jingle.SmackLogger;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
/**
|
||||
* A very Simple HTTP Server
|
||||
*/
|
||||
public class HttpServer {
|
||||
|
||||
private static final SmackLogger LOGGER = SmackLogger.getLogger(HttpServer.class);
|
||||
private static final Logger LOGGER = Logger.getLogger(HttpServer.class.getName());
|
||||
|
||||
public HttpServer(int port) {
|
||||
ServerSocket server_socket;
|
||||
|
@ -39,12 +40,12 @@ public class HttpServer {
|
|||
try {
|
||||
|
||||
server_socket = new ServerSocket(port);
|
||||
LOGGER.debug("httpServer running on port " +
|
||||
LOGGER.fine("httpServer running on port " +
|
||||
server_socket.getLocalPort());
|
||||
|
||||
while (true) {
|
||||
Socket socket = server_socket.accept();
|
||||
LOGGER.debug("New connection accepted " +
|
||||
LOGGER.fine("New connection accepted " +
|
||||
socket.getInetAddress() +
|
||||
":" + socket.getPort());
|
||||
|
||||
|
@ -57,13 +58,13 @@ public class HttpServer {
|
|||
thread.start();
|
||||
}
|
||||
catch (Exception e) {
|
||||
LOGGER.debug("", e);
|
||||
LOGGER.log(Level.FINE, "Exception", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
catch (IOException e) {
|
||||
LOGGER.debug("", e);
|
||||
LOGGER.log(Level.FINE, "Exception", e);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -100,7 +101,7 @@ public class HttpServer {
|
|||
while (true) {
|
||||
|
||||
String headerLine = br.readLine();
|
||||
LOGGER.debug(headerLine);
|
||||
LOGGER.fine(headerLine);
|
||||
if (headerLine.equals(CRLF) || headerLine.equals("")) break;
|
||||
|
||||
StringTokenizer s = new StringTokenizer(headerLine);
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
/**
|
||||
*
|
||||
* Copyright the original author or authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -17,8 +19,7 @@ package org.jivesoftware.smackx.jingle.nat;
|
|||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
import java.util.List;
|
||||
|
||||
import org.jivesoftware.smackx.jingle.SmackLogger;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
/**
|
||||
* ICE Transport candidate.
|
||||
|
@ -30,7 +31,7 @@ import org.jivesoftware.smackx.jingle.SmackLogger;
|
|||
*/
|
||||
public class ICECandidate extends TransportCandidate implements Comparable<ICECandidate> {
|
||||
|
||||
private static final SmackLogger LOGGER = SmackLogger.getLogger(ICECandidate.class);
|
||||
private static final Logger LOGGER = Logger.getLogger(ICECandidate.class.getName());
|
||||
|
||||
private String id; // An identification
|
||||
|
||||
|
@ -240,7 +241,7 @@ public class ICECandidate extends TransportCandidate implements Comparable<ICECa
|
|||
public void testFinished(TestResult testResult, TransportCandidate candidate) {
|
||||
if (testResult.isReachable() && checkingCandidate.equals(candidate)) {
|
||||
result.setResult(true);
|
||||
LOGGER.debug("Candidate reachable: " + candidate.getIp() + ":" + candidate.getPort() + " from " + getIp() +":" + getPort());
|
||||
LOGGER.fine("Candidate reachable: " + candidate.getIp() + ":" + candidate.getPort() + " from " + getIp() +":" + getPort());
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -266,7 +267,7 @@ public class ICECandidate extends TransportCandidate implements Comparable<ICECa
|
|||
|
||||
for (int i = 0; i < 10 && !result.isReachable(); i++)
|
||||
try {
|
||||
LOGGER.error("ICE Candidate retry #" + i);
|
||||
LOGGER.severe("ICE Candidate retry #" + i);
|
||||
Thread.sleep(400);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jivesoftware.smackx.jingle.nat;
|
||||
|
||||
import java.net.InetAddress;
|
||||
|
@ -25,11 +24,11 @@ import java.util.Enumeration;
|
|||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.jivesoftware.smack.Connection;
|
||||
import org.jivesoftware.smack.XMPPException;
|
||||
import org.jivesoftware.smackx.jingle.JingleSession;
|
||||
import org.jivesoftware.smackx.jingle.SmackLogger;
|
||||
|
||||
import de.javawi.jstun.test.demo.ice.Candidate;
|
||||
import de.javawi.jstun.test.demo.ice.ICENegociator;
|
||||
|
@ -44,7 +43,7 @@ import de.javawi.jstun.util.UtilityException;
|
|||
*/
|
||||
public class ICEResolver extends TransportResolver {
|
||||
|
||||
private static final SmackLogger LOGGER = SmackLogger.getLogger(ICEResolver.class);
|
||||
private static final Logger LOGGER = Logger.getLogger(ICEResolver.class.getName());
|
||||
|
||||
Connection connection;
|
||||
Random random = new Random();
|
||||
|
@ -64,7 +63,7 @@ public class ICEResolver extends TransportResolver {
|
|||
|
||||
public void initialize() throws XMPPException {
|
||||
if (!isResolving() && !isResolved()) {
|
||||
LOGGER.debug("Initialized");
|
||||
LOGGER.fine("Initialized");
|
||||
|
||||
// Negotiation with a STUN server for a set of interfaces is quite slow, but the results
|
||||
// never change over then instance of a JVM. To increase connection performance considerably
|
||||
|
@ -147,7 +146,7 @@ public class ICEResolver extends TransportResolver {
|
|||
}
|
||||
this.addCandidate(transportCandidate);
|
||||
|
||||
LOGGER.debug("Candidate addr: " + candidate.getAddress().getInetAddress() + "|" + candidate.getBase().getAddress().getInetAddress() + " Priority:" + candidate.getPriority());
|
||||
LOGGER.fine("Candidate addr: " + candidate.getAddress().getInetAddress() + "|" + candidate.getBase().getAddress().getInetAddress() + " Priority:" + candidate.getPriority());
|
||||
|
||||
}
|
||||
catch (UtilityException e) {
|
||||
|
|
|
@ -1,3 +1,19 @@
|
|||
/**
|
||||
*
|
||||
* Copyright 2003-2006 Jive Software.
|
||||
*
|
||||
* 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;
|
||||
|
||||
import org.jivesoftware.smack.Connection;
|
||||
|
@ -7,22 +23,6 @@ import org.jivesoftware.smackx.jingle.listeners.CreatedJingleSessionListener;
|
|||
import org.jivesoftware.smackx.jingle.listeners.JingleSessionListener;
|
||||
import org.jivesoftware.smackx.jingle.media.PayloadType;
|
||||
|
||||
/**
|
||||
* <p/>
|
||||
* Copyright 2003-2006 Jive Software.
|
||||
* <p/>
|
||||
* 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
|
||||
* <p/>
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* <p/>
|
||||
* 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.
|
||||
*/
|
||||
public class ICETransportManager extends JingleTransportManager implements JingleSessionListener, CreatedJingleSessionListener {
|
||||
|
||||
ICEResolver iceResolver = null;
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* 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
|
||||
* 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,
|
||||
|
|
|
@ -22,18 +22,17 @@ import java.net.NetworkInterface;
|
|||
import java.net.SocketException;
|
||||
import java.util.Enumeration;
|
||||
import java.util.Iterator;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.jivesoftware.smack.PacketCollector;
|
||||
import org.jivesoftware.smack.SmackConfiguration;
|
||||
import org.jivesoftware.smack.Connection;
|
||||
import org.jivesoftware.smack.XMPPException;
|
||||
import org.jivesoftware.smack.filter.PacketIDFilter;
|
||||
import org.jivesoftware.smack.packet.IQ;
|
||||
import org.jivesoftware.smack.provider.IQProvider;
|
||||
import org.jivesoftware.smack.provider.ProviderManager;
|
||||
import org.jivesoftware.smackx.ServiceDiscoveryManager;
|
||||
import org.jivesoftware.smackx.jingle.SmackLogger;
|
||||
import org.jivesoftware.smackx.packet.DiscoverInfo;
|
||||
import org.jivesoftware.smackx.disco.ServiceDiscoveryManager;
|
||||
import org.jivesoftware.smackx.disco.packet.DiscoverInfo;
|
||||
import org.xmlpull.v1.XmlPullParser;
|
||||
|
||||
/**
|
||||
|
@ -49,7 +48,7 @@ import org.xmlpull.v1.XmlPullParser;
|
|||
*/
|
||||
public class RTPBridge extends IQ {
|
||||
|
||||
private static final SmackLogger LOGGER = SmackLogger.getLogger(RTPBridge.class);
|
||||
private static final Logger LOGGER = Logger.getLogger(RTPBridge.class.getName());
|
||||
|
||||
private String sid;
|
||||
private String pass;
|
||||
|
@ -403,8 +402,7 @@ public class RTPBridge extends IQ {
|
|||
|
||||
connection.sendPacket(rtpPacket);
|
||||
|
||||
RTPBridge response = (RTPBridge) collector
|
||||
.nextResult(SmackConfiguration.getPacketReplyTimeout());
|
||||
RTPBridge response = (RTPBridge) collector.nextResult();
|
||||
|
||||
// Cancel the collector.
|
||||
collector.cancel();
|
||||
|
@ -424,7 +422,7 @@ public class RTPBridge extends IQ {
|
|||
return false;
|
||||
}
|
||||
|
||||
LOGGER.debug("Service listing");
|
||||
LOGGER.fine("Service listing");
|
||||
|
||||
ServiceDiscoveryManager disco = ServiceDiscoveryManager
|
||||
.getInstanceFor(connection);
|
||||
|
@ -483,8 +481,7 @@ public class RTPBridge extends IQ {
|
|||
|
||||
connection.sendPacket(rtpPacket);
|
||||
|
||||
RTPBridge response = (RTPBridge) collector
|
||||
.nextResult(SmackConfiguration.getPacketReplyTimeout());
|
||||
RTPBridge response = (RTPBridge) collector.nextResult();
|
||||
|
||||
// Cancel the collector.
|
||||
collector.cancel();
|
||||
|
@ -515,8 +512,7 @@ public class RTPBridge extends IQ {
|
|||
|
||||
xmppConnection.sendPacket(rtpPacket);
|
||||
|
||||
RTPBridge response = (RTPBridge) collector
|
||||
.nextResult(SmackConfiguration.getPacketReplyTimeout());
|
||||
RTPBridge response = (RTPBridge) collector.nextResult();
|
||||
|
||||
// Cancel the collector.
|
||||
collector.cancel();
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* 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
|
||||
* 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,
|
||||
|
@ -19,19 +19,18 @@ package org.jivesoftware.smackx.jingle.nat;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.jivesoftware.smack.PacketCollector;
|
||||
import org.jivesoftware.smack.SmackConfiguration;
|
||||
import org.jivesoftware.smack.Connection;
|
||||
import org.jivesoftware.smack.XMPPException;
|
||||
import org.jivesoftware.smack.filter.PacketIDFilter;
|
||||
import org.jivesoftware.smack.packet.IQ;
|
||||
import org.jivesoftware.smack.provider.IQProvider;
|
||||
import org.jivesoftware.smack.provider.ProviderManager;
|
||||
import org.jivesoftware.smackx.ServiceDiscoveryManager;
|
||||
import org.jivesoftware.smackx.jingle.SmackLogger;
|
||||
import org.jivesoftware.smackx.packet.DiscoverInfo;
|
||||
import org.jivesoftware.smackx.packet.DiscoverItems;
|
||||
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;
|
||||
|
||||
/**
|
||||
|
@ -45,7 +44,7 @@ import org.xmlpull.v1.XmlPullParser;
|
|||
*/
|
||||
public class STUN extends IQ {
|
||||
|
||||
private static final SmackLogger LOGGER = SmackLogger.getLogger(STUN.class);
|
||||
private static final Logger LOGGER = Logger.getLogger(STUN.class.getName());
|
||||
|
||||
private List<StunServerAddress> servers = new ArrayList<StunServerAddress>();
|
||||
|
||||
|
@ -199,8 +198,7 @@ public class STUN extends IQ {
|
|||
|
||||
connection.sendPacket(stunPacket);
|
||||
|
||||
STUN response = (STUN) collector
|
||||
.nextResult(SmackConfiguration.getPacketReplyTimeout());
|
||||
STUN response = (STUN) collector.nextResult();
|
||||
|
||||
// Cancel the collector.
|
||||
collector.cancel();
|
||||
|
@ -220,7 +218,7 @@ public class STUN extends IQ {
|
|||
return false;
|
||||
}
|
||||
|
||||
LOGGER.debug("Service listing");
|
||||
LOGGER.fine("Service listing");
|
||||
|
||||
ServiceDiscoveryManager disco = ServiceDiscoveryManager
|
||||
.getInstanceFor(connection);
|
||||
|
@ -240,7 +238,7 @@ public class STUN extends IQ {
|
|||
return true;
|
||||
}
|
||||
|
||||
LOGGER.debug(item.getName()+"-"+info.getType());
|
||||
LOGGER.fine(item.getName()+"-"+info.getType());
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* 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
|
||||
* 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,
|
||||
|
@ -23,10 +23,11 @@ import java.net.SocketException;
|
|||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Enumeration;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.jivesoftware.smack.XMPPException;
|
||||
import org.jivesoftware.smackx.jingle.JingleSession;
|
||||
import org.jivesoftware.smackx.jingle.SmackLogger;
|
||||
import org.xmlpull.mxp1.MXParser;
|
||||
import org.xmlpull.v1.XmlPullParser;
|
||||
import org.xmlpull.v1.XmlPullParserException;
|
||||
|
@ -44,7 +45,7 @@ import de.javawi.jstun.test.DiscoveryTest;
|
|||
*/
|
||||
public class STUNResolver extends TransportResolver {
|
||||
|
||||
private static final SmackLogger LOGGER = SmackLogger.getLogger(STUNResolver.class);
|
||||
private static final Logger LOGGER = Logger.getLogger(STUNResolver.class.getName());
|
||||
|
||||
// The filename where the STUN servers are stored.
|
||||
public final static String STUNSERVERS_FILENAME = "META-INF/stun-config.xml";
|
||||
|
@ -181,10 +182,10 @@ public class STUNResolver extends TransportResolver {
|
|||
|
||||
}
|
||||
catch (XmlPullParserException e) {
|
||||
LOGGER.error(e.getMessage(), e);
|
||||
LOGGER.log(Level.SEVERE, "Exception", e);
|
||||
}
|
||||
catch (IOException e) {
|
||||
LOGGER.error(e.getMessage(), e);
|
||||
LOGGER.log(Level.SEVERE, "Exception", e);
|
||||
}
|
||||
|
||||
currentServer = bestSTUNServer(serversList);
|
||||
|
@ -239,7 +240,7 @@ public class STUNResolver extends TransportResolver {
|
|||
}
|
||||
}
|
||||
catch (Exception e) {
|
||||
LOGGER.error(e.getMessage(), e);
|
||||
LOGGER.log(Level.SEVERE, "Exception", e);
|
||||
}
|
||||
|
||||
return serversList;
|
||||
|
@ -272,7 +273,7 @@ public class STUNResolver extends TransportResolver {
|
|||
resolvedPublicIP, getFreePort());
|
||||
candidate.setLocalIp(resolvedLocalIP);
|
||||
|
||||
LOGGER.debug("RESOLVING : " + resolvedPublicIP + ":" + candidate.getPort());
|
||||
LOGGER.fine("RESOLVING : " + resolvedPublicIP + ":" + candidate.getPort());
|
||||
|
||||
addCandidate(candidate);
|
||||
|
||||
|
@ -286,7 +287,7 @@ public class STUNResolver extends TransportResolver {
|
|||
* @throws XMPPException
|
||||
*/
|
||||
public void initialize() throws XMPPException {
|
||||
LOGGER.debug("Initialized");
|
||||
LOGGER.fine("Initialized");
|
||||
if (!isResolving()&&!isResolved()) {
|
||||
// Get the best STUN server available
|
||||
if (currentServer.isNull()) {
|
||||
|
@ -354,14 +355,14 @@ public class STUNResolver extends TransportResolver {
|
|||
}
|
||||
}
|
||||
catch (Exception e) {
|
||||
LOGGER.error(e.getMessage(), e);
|
||||
LOGGER.log(Level.SEVERE, "Exception", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (SocketException e) {
|
||||
LOGGER.error(e.getMessage(), e);
|
||||
LOGGER.log(Level.SEVERE, "Exception", e);
|
||||
}
|
||||
finally {
|
||||
setInitialized();
|
||||
|
@ -508,7 +509,7 @@ public class STUNResolver extends TransportResolver {
|
|||
}
|
||||
}
|
||||
catch (Exception e) {
|
||||
LOGGER.error(e.getMessage(), e);
|
||||
LOGGER.log(Level.SEVERE, "Exception in checkBinding", e);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* 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
|
||||
* 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,
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
/**
|
||||
*
|
||||
* Copyright the original author or authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -21,8 +23,7 @@ import java.net.DatagramPacket;
|
|||
import java.net.DatagramSocket;
|
||||
import java.net.InetAddress;
|
||||
import java.net.Socket;
|
||||
|
||||
import org.jivesoftware.smackx.jingle.SmackLogger;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
/**
|
||||
* A Simple and Experimental Bridge.
|
||||
|
@ -31,7 +32,7 @@ import org.jivesoftware.smackx.jingle.SmackLogger;
|
|||
*/
|
||||
public class TcpUdpBridgeClient {
|
||||
|
||||
private static final SmackLogger LOGGER = SmackLogger.getLogger(TcpUdpBridgeClient.class);
|
||||
private static final Logger LOGGER = Logger.getLogger(TcpUdpBridgeClient.class.getName());
|
||||
|
||||
private String remoteTcpHost = null;
|
||||
private String remoteUdpHost = null;
|
||||
|
@ -52,7 +53,7 @@ public class TcpUdpBridgeClient {
|
|||
localTcpSocket = new Socket(remoteTcpHost, remoteTcpPort);
|
||||
localUdpSocket = new DatagramSocket(0);
|
||||
localUdpPort = localUdpSocket.getLocalPort();
|
||||
LOGGER.debug("UDP: " + localUdpSocket.getLocalPort());
|
||||
LOGGER.fine("UDP: " + localUdpSocket.getLocalPort());
|
||||
}
|
||||
catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
|
@ -77,11 +78,11 @@ public class TcpUdpBridgeClient {
|
|||
localUdpSocket.receive(p);
|
||||
if (p.getLength() == 0) continue;
|
||||
|
||||
LOGGER.debug("UDP Client Received and Sending to TCP Server:"+new String(p.getData(),0,p.getLength(),"UTF-8"));
|
||||
LOGGER.fine("UDP Client Received and Sending to TCP Server:"+new String(p.getData(),0,p.getLength(),"UTF-8"));
|
||||
|
||||
out.write(p.getData(), 0, p.getLength());
|
||||
out.flush();
|
||||
LOGGER.debug("Client Flush");
|
||||
LOGGER.fine("Client Flush");
|
||||
|
||||
}
|
||||
|
||||
|
@ -108,7 +109,7 @@ public class TcpUdpBridgeClient {
|
|||
int s = in.read(b);
|
||||
//if (s == -1) continue;
|
||||
|
||||
LOGGER.debug("TCP Client:" +new String(b,0,s,"UTF-8"));
|
||||
LOGGER.fine("TCP Client:" +new String(b,0,s,"UTF-8"));
|
||||
|
||||
DatagramPacket udpPacket = new DatagramPacket(b, s);
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue