Smack

org.jivesoftware.smack
Class SmackConfiguration

java.lang.Object
  extended by org.jivesoftware.smack.SmackConfiguration

public final class SmackConfiguration
extends java.lang.Object

Represents the configuration of Smack. The configuration is used for:

Configuration settings are stored in META-INF/smack-config.xml (typically inside the smack.jar file).

Author:
Gaston Dombiak

Method Summary
static void addSaslMech(java.lang.String mech)
          Add a SASL mechanism to the list to be used.
static void addSaslMechs(java.util.Collection<java.lang.String> mechs)
          Add a Collection of SASL mechanisms to the list to be used.
static boolean autoEnableEntityCaps()
          Check if Entity Caps are enabled as default for every new connection
static int getKeepAliveInterval()
          Returns the number of milleseconds delay between sending keep-alive requests to the server.
static int getLocalSocks5ProxyPort()
          Return the port of the local Socks5 proxy.
static int getPacketCollectorSize()
          Gets the default max size of a packet collector before it will delete the older packets.
static int getPacketReplyTimeout()
          Returns the number of milliseconds to wait for a response from the server.
static java.util.List<java.lang.String> getSaslMechs()
          Returns the list of SASL mechanisms to be used.
static java.lang.String getVersion()
          Returns the Smack version information, eg "1.3.0".
static boolean isLocalSocks5ProxyEnabled()
          Returns true if the local Socks5 proxy should be started.
static void removeSaslMech(java.lang.String mech)
          Remove a SASL mechanism from the list to be used.
static void removeSaslMechs(java.util.Collection<java.lang.String> mechs)
          Remove a Collection of SASL mechanisms to the list to be used.
static void setAutoEnableEntityCaps(boolean b)
          Set if Entity Caps are enabled or disabled for every new connection
static void setKeepAliveInterval(int interval)
          Sets the number of milleseconds delay between sending keep-alive requests to the server.
static void setLocalSocks5ProxyEnabled(boolean localSocks5ProxyEnabled)
          Sets if the local Socks5 proxy should be started.
static void setLocalSocks5ProxyPort(int localSocks5ProxyPort)
          Sets the port of the local Socks5 proxy.
static void setPacketCollectorSize(int collectorSize)
          Sets the default max size of a packet collector before it will delete the older packets.
static void setPacketReplyTimeout(int timeout)
          Sets the number of milliseconds to wait for a response from the server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getVersion

public static java.lang.String getVersion()
Returns the Smack version information, eg "1.3.0".

Returns:
the Smack version information.

getPacketReplyTimeout

public static int getPacketReplyTimeout()
Returns the number of milliseconds to wait for a response from the server. The default value is 5000 ms.

Returns:
the milliseconds to wait for a response from the server

setPacketReplyTimeout

public static void setPacketReplyTimeout(int timeout)
Sets the number of milliseconds to wait for a response from the server.

Parameters:
timeout - the milliseconds to wait for a response from the server

getKeepAliveInterval

public static int getKeepAliveInterval()
Returns the number of milleseconds delay between sending keep-alive requests to the server. The default value is 30000 ms. A value of -1 mean no keep-alive requests will be sent to the server.

Returns:
the milliseconds to wait between keep-alive requests, or -1 if no keep-alive should be sent.

setKeepAliveInterval

public static void setKeepAliveInterval(int interval)
Sets the number of milleseconds delay between sending keep-alive requests to the server. The default value is 30000 ms. A value of -1 mean no keep-alive requests will be sent to the server.

Parameters:
interval - the milliseconds to wait between keep-alive requests, or -1 if no keep-alive should be sent.

getPacketCollectorSize

public static int getPacketCollectorSize()
Gets the default max size of a packet collector before it will delete the older packets.

Returns:
The number of packets to queue before deleting older packets.

setPacketCollectorSize

public static void setPacketCollectorSize(int collectorSize)
Sets the default max size of a packet collector before it will delete the older packets.

Parameters:
The - number of packets to queue before deleting older packets.

addSaslMech

public static void addSaslMech(java.lang.String mech)
Add a SASL mechanism to the list to be used.

Parameters:
mech - the SASL mechanism to be added

addSaslMechs

public static void addSaslMechs(java.util.Collection<java.lang.String> mechs)
Add a Collection of SASL mechanisms to the list to be used.

Parameters:
mechs - the Collection of SASL mechanisms to be added

removeSaslMech

public static void removeSaslMech(java.lang.String mech)
Remove a SASL mechanism from the list to be used.

Parameters:
mech - the SASL mechanism to be removed

removeSaslMechs

public static void removeSaslMechs(java.util.Collection<java.lang.String> mechs)
Remove a Collection of SASL mechanisms to the list to be used.

Parameters:
mechs - the Collection of SASL mechanisms to be removed

getSaslMechs

public static java.util.List<java.lang.String> getSaslMechs()
Returns the list of SASL mechanisms to be used. If a SASL mechanism is listed here it does not guarantee it will be used. The server may not support it, or it may not be implemented.

Returns:
the list of SASL mechanisms to be used.

isLocalSocks5ProxyEnabled

public static boolean isLocalSocks5ProxyEnabled()
Returns true if the local Socks5 proxy should be started. Default is true.

Returns:
if the local Socks5 proxy should be started

setLocalSocks5ProxyEnabled

public static void setLocalSocks5ProxyEnabled(boolean localSocks5ProxyEnabled)
Sets if the local Socks5 proxy should be started. Default is true.

Parameters:
localSocks5ProxyEnabled - if the local Socks5 proxy should be started

getLocalSocks5ProxyPort

public static int getLocalSocks5ProxyPort()
Return the port of the local Socks5 proxy. Default is 7777.

Returns:
the port of the local Socks5 proxy

setLocalSocks5ProxyPort

public static void setLocalSocks5ProxyPort(int 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.

Parameters:
localSocks5ProxyPort - the port of the local Socks5 proxy to set

autoEnableEntityCaps

public static boolean autoEnableEntityCaps()
Check if Entity Caps are enabled as default for every new connection

Returns:

setAutoEnableEntityCaps

public static void setAutoEnableEntityCaps(boolean b)
Set if Entity Caps are enabled or disabled for every new connection

Parameters:
true - if Entity Caps should be auto enabled, false if not

Smack

Copyright © 2003-2007 Jive Software.