mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2025-09-10 18:59:41 +02:00
merged branch improve_bytestreams in trunk
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@11821 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
ef74695a1b
commit
8b54f34153
74 changed files with 11866 additions and 1902 deletions
|
@ -0,0 +1,46 @@
|
|||
/**
|
||||
* 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.smack;
|
||||
|
||||
/**
|
||||
* The AbstractConnectionListener class provides an empty implementation for all
|
||||
* methods defined by the {@link ConnectionListener} interface. This is a
|
||||
* convenience class which should be used in case you do not need to implement
|
||||
* all methods.
|
||||
*
|
||||
* @author Henning Staib
|
||||
*/
|
||||
public class AbstractConnectionListener implements ConnectionListener {
|
||||
|
||||
public void connectionClosed() {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
public void connectionClosedOnError(Exception e) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
public void reconnectingIn(int seconds) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
public void reconnectionFailed(Exception e) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
public void reconnectionSuccessful() {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
}
|
|
@ -50,6 +50,9 @@ public final class SmackConfiguration {
|
|||
private static int keepAliveInterval = 30000;
|
||||
private static Vector<String> defaultMechs = new Vector<String>();
|
||||
|
||||
private static boolean localSocks5ProxyEnabled = true;
|
||||
private static int localSocks5ProxyPort = 7777;
|
||||
|
||||
private SmackConfiguration() {
|
||||
}
|
||||
|
||||
|
@ -90,6 +93,12 @@ public final class SmackConfiguration {
|
|||
}
|
||||
else if (parser.getName().equals("mechName")) {
|
||||
defaultMechs.add(parser.nextText());
|
||||
} else if (parser.getName().equals("localSocks5ProxyEnabled")) {
|
||||
localSocks5ProxyEnabled = Boolean.parseBoolean(parser
|
||||
.nextText());
|
||||
} else if (parser.getName().equals("localSocks5ProxyPort")) {
|
||||
localSocks5ProxyPort = parseIntProperty(parser,
|
||||
localSocks5ProxyPort);
|
||||
}
|
||||
}
|
||||
eventType = parser.next();
|
||||
|
@ -230,6 +239,43 @@ public final class SmackConfiguration {
|
|||
return defaultMechs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the local Socks5 proxy should be started. Default is true.
|
||||
*
|
||||
* @return if the local Socks5 proxy should be started
|
||||
*/
|
||||
public static boolean isLocalSocks5ProxyEnabled() {
|
||||
return localSocks5ProxyEnabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets if the local Socks5 proxy should be started. Default is true.
|
||||
*
|
||||
* @param localSocks5ProxyEnabled if the local Socks5 proxy should be started
|
||||
*/
|
||||
public static void setLocalSocks5ProxyEnabled(boolean localSocks5ProxyEnabled) {
|
||||
SmackConfiguration.localSocks5ProxyEnabled = localSocks5ProxyEnabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the port of the local Socks5 proxy. Default is 7777.
|
||||
*
|
||||
* @return the port of the local Socks5 proxy
|
||||
*/
|
||||
public static int getLocalSocks5ProxyPort() {
|
||||
return localSocks5ProxyPort;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the port of the local Socks5 proxy. Default is 7777. If you set the port to a negative
|
||||
* value Smack tries the absolute value and all following until it finds an open port.
|
||||
*
|
||||
* @param localSocks5ProxyPort the port of the local Socks5 proxy to set
|
||||
*/
|
||||
public static void setLocalSocks5ProxyPort(int localSocks5ProxyPort) {
|
||||
SmackConfiguration.localSocks5ProxyPort = localSocks5ProxyPort;
|
||||
}
|
||||
|
||||
private static void parseClassToLoad(XmlPullParser parser) throws Exception {
|
||||
String className = parser.nextText();
|
||||
// Attempt to load the class so that the class can get initialized
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue