mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-22 22:32:06 +01:00
SMACK-431 Entity Capabilities are now enabled as default for new connections. Added an extensions documentation html page.
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/branches/smack_3_3_1@13689 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
30bc5afa2b
commit
cb5e1dc94b
3 changed files with 66 additions and 2 deletions
63
documentation/extensions/caps.html
Normal file
63
documentation/extensions/caps.html
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Entity Capabilities</title>
|
||||||
|
<link rel="stylesheet" type="text/css" href="style.css" />
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div class="header">Entity Capabilities</div><p>
|
||||||
|
This section details the usage of Smacks implementation of Entity Capabilities.
|
||||||
|
</p>
|
||||||
|
<b>XEP related:</b> <a href="http://xmpp.org/extensions/xep-0115.html">XEP-0115: Entity Capabilities</a>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<b>Description</b><p>
|
||||||
|
|
||||||
|
Entity Capabilities is an extension to the Service Discovery (<a href="http://xmpp.org/extensions/xep-0030.html">XEP-0030</a>), which, in order to minimize network impact, caches the capabilities information of XMPP entities.
|
||||||
|
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<b>Usage</b><p>
|
||||||
|
|
||||||
|
Entity Capabilities work silenty in background when enabled. If the remote XMPP entity does not support XEP-0115 but XEP-0030 then XEP-0030 mechanisms are transparently used. You can enable or disable Entity Capabilities by using <i><b>EntityCapsManager</b></i>.<br>
|
||||||
|
|
||||||
|
The cache used by Smack for Entity Capabilities is non-persistent as default. That is, the cache only uses memory. But it is also possible to set a persistent Entity Capabilities cache, which is recommended.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<b>Examples</b><p>
|
||||||
|
|
||||||
|
Enable Entity Capabilities
|
||||||
|
<br>
|
||||||
|
<blockquote>
|
||||||
|
<pre>
|
||||||
|
<font color="#3f7f5f">// Get an instance of entity caps manager for the specified connection</font>
|
||||||
|
Entity CapabilitiesManager mgr = new EntityCapsManager.getInstanceFor(con);
|
||||||
|
|
||||||
|
<font color="#3f7f5f">// Enable entity capabilities</font>
|
||||||
|
mgr.enableEntityCaps();
|
||||||
|
</pre>
|
||||||
|
</blockquote>
|
||||||
|
|
||||||
|
Configure a persistent cache for Entity Capabilities
|
||||||
|
<br>
|
||||||
|
<blockquote>
|
||||||
|
<pre>
|
||||||
|
<font color="#3f7f5f">// Get an instance of entity caps manager for the specified connection</font>
|
||||||
|
Entity CapabilitiesManager mgr = new EntityCapsManager.getInstanceFor(con);
|
||||||
|
|
||||||
|
<font color="#3f7f5f">// Create an cache, see smackx.entitycaps.cache for pre-defined cache implementations</font>
|
||||||
|
EntityCapsPersistentCache cache = new SimpleDirectoryPersistentCache(new File("/foo/cachedir"));
|
||||||
|
|
||||||
|
<font color="#3f7f5f">// Set the cache</font>
|
||||||
|
mgr.setPersistentCache(cache);
|
||||||
|
</pre>
|
||||||
|
</blockquote>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
|
@ -22,6 +22,7 @@
|
||||||
<a href="disco.html">Service Discovery</a><br>
|
<a href="disco.html">Service Discovery</a><br>
|
||||||
<a href="filetransfer.html">File Transfer</a><br>
|
<a href="filetransfer.html">File Transfer</a><br>
|
||||||
<a href="pubsub.html">PubSub</a><br>
|
<a href="pubsub.html">PubSub</a><br>
|
||||||
|
<a href="caps.html">Entity Capabilities</a><br>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -69,7 +69,7 @@ public final class SmackConfiguration {
|
||||||
/**
|
/**
|
||||||
* This automatically enables EntityCaps for new connections if it is set to true
|
* This automatically enables EntityCaps for new connections if it is set to true
|
||||||
*/
|
*/
|
||||||
private static boolean autoEnableEntityCaps = false;
|
private static boolean autoEnableEntityCaps = true;
|
||||||
|
|
||||||
private SmackConfiguration() {
|
private SmackConfiguration() {
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue