|
Smack | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jivesoftware.smack.SmackConfiguration
public final class SmackConfiguration
Represents the configuration of Smack. The configuration is used for:
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 ParsingExceptionCallback |
getDefaultParsingExceptionCallback()
Returns the default parsing exception callback |
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 |
setConfigFileStream(java.io.InputStream configFile)
Sets the InputStream representing the smack configuration file. |
static void |
setConfigFileUrl(java.lang.String configFileUrl,
java.lang.ClassLoader loader)
Sets the location of the config file on the classpath. |
static void |
setDefaultParsingExceptionCallback(ParsingExceptionCallback callback)
Set the default parsing exception callback for all newly created connections |
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 |
---|
public static void setConfigFileUrl(java.lang.String configFileUrl, java.lang.ClassLoader loader)
This method must be called before accessing any other class in Smack.
configFileUrl
- The location of the config file.loader
- The classloader to use if the URL has a protocol of classpath> and the file is not located on the default classpath.
This can be set to null to use defaults and is ignored for all other protocols.
java.lang.IllegalArgumentException
- If the config URL is invalid in that it cannot open an InputStream
public static void setConfigFileStream(java.io.InputStream configFile)
InputStream
representing the smack configuration file. This can be used to override the default with something that is not on the classpath.
This method must be called before accessing any other class in Smack.
configFile
- public static java.lang.String getVersion()
public static int getPacketReplyTimeout()
public static void setPacketReplyTimeout(int timeout)
timeout
- the milliseconds to wait for a response from the serverpublic static int getKeepAliveInterval()
public static void setKeepAliveInterval(int interval)
interval
- the milliseconds to wait between keep-alive requests,
or -1 if no keep-alive should be sent.public static int getPacketCollectorSize()
public static void setPacketCollectorSize(int collectorSize)
The
- number of packets to queue before deleting older packets.public static void addSaslMech(java.lang.String mech)
mech
- the SASL mechanism to be addedpublic static void addSaslMechs(java.util.Collection<java.lang.String> mechs)
mechs
- the Collection of SASL mechanisms to be addedpublic static void removeSaslMech(java.lang.String mech)
mech
- the SASL mechanism to be removedpublic static void removeSaslMechs(java.util.Collection<java.lang.String> mechs)
mechs
- the Collection of SASL mechanisms to be removedpublic static java.util.List<java.lang.String> getSaslMechs()
public static boolean isLocalSocks5ProxyEnabled()
public static void setLocalSocks5ProxyEnabled(boolean localSocks5ProxyEnabled)
localSocks5ProxyEnabled
- if the local Socks5 proxy should be startedpublic static int getLocalSocks5ProxyPort()
public static void setLocalSocks5ProxyPort(int localSocks5ProxyPort)
localSocks5ProxyPort
- the port of the local Socks5 proxy to setpublic static boolean autoEnableEntityCaps()
public static void setAutoEnableEntityCaps(boolean b)
true
- if Entity Caps should be auto enabled, false if notpublic static void setDefaultParsingExceptionCallback(ParsingExceptionCallback callback)
callback
- ParsingExceptionCallback
public static ParsingExceptionCallback getDefaultParsingExceptionCallback()
ParsingExceptionCallback
|
Smack | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |