1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-29 15: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/trunk@13686 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Florian Schmaus 2013-06-22 17:00:40 +00:00 committed by flow
parent 4cd53e4419
commit c7d468697f
3 changed files with 66 additions and 2 deletions

View 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>

View file

@ -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>

View file

@ -74,7 +74,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() {
} }