Commit 7adf708d authored by guus's avatar guus

Update Client Capabilities implementation to match the XEP (OF-339).

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@11580 b35dd754-fafc-0310-a699-88a17e54d16e
parent 75926ddb
......@@ -38,6 +38,7 @@ import java.util.Set;
* @author Armando Jagucki
*
*/
// TODO: Instances of this class should not be cached in distributed caches. The overhead of distributing data is a lot higher than recalculating the hash on every cluster node. We should remove the Externalizable interface, and turn this class into an immutable class.
public class EntityCapabilities implements Cacheable, Externalizable {
/**
......@@ -57,6 +58,11 @@ public class EntityCapabilities implements Cacheable, Externalizable {
*/
private String verAttribute;
/**
* The hash algorithm that was used to create the hash string.
*/
private String hashAttribute;
/**
* Adds an identity to the entity capabilities.
*
......@@ -102,13 +108,22 @@ public class EntityCapabilities implements Cacheable, Externalizable {
return features.contains(feature);
}
/**
* @param verAttribute the verAttribute to set
*/
void setVerAttribute(String verAttribute) {
this.verAttribute = verAttribute;
}
String getVerAttribute() {
return this.verAttribute;
}
void setHashAttribute(String hashAttribute) {
this.hashAttribute = hashAttribute;
}
String getHashAttribute() {
return this.hashAttribute;
}
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
ExternalizableUtil.getInstance().readStrings(in, identities);
ExternalizableUtil.getInstance().readStrings(in, features);
......
......@@ -126,7 +126,6 @@ public class CacheFactory {
cacheNames.put("Remote Server Configurations", "serversConfigurations");
cacheNames.put("Entity Capabilities", "entityCapabilities");
cacheNames.put("Entity Capabilities Users", "entityCapabilitiesUsers");
cacheNames.put("Entity Capabilities Pending Hashes", "entityCapabilitiesPendingHashes");
cacheNames.put("Clearspace SSO Nonce", "clearspaceSSONonce");
cacheNames.put("PEPServiceManager", "pepServiceManager");
......@@ -194,8 +193,6 @@ public class CacheFactory {
cacheProps.put("cache.entityCapabilities.maxLifetime", JiveConstants.DAY * 2);
cacheProps.put("cache.entityCapabilitiesUsers.size", -1l);
cacheProps.put("cache.entityCapabilitiesUsers.maxLifetime", JiveConstants.DAY * 2);
cacheProps.put("cache.entityCapabilitiesPendingHashes.size", -1l);
cacheProps.put("cache.entityCapabilitiesPendingHashes.maxLifetime", JiveConstants.DAY * 2);
cacheProps.put("cache.pluginCacheInfo.size", -1l);
cacheProps.put("cache.pluginCacheInfo.maxLifetime", -1l);
cacheProps.put("cache.clearspaceSSONonce.size", -1l);
......
......@@ -864,25 +864,6 @@ http://www.tangosol.com/UserGuide-Reference-CacheConfig.jsp
</init-params>
</cache-mapping>
<cache-mapping>
<cache-name>Entity Capabilities Pending Hashes</cache-name>
<scheme-name>near-distributed</scheme-name>
<init-params>
<init-param>
<param-name>back-size-high</param-name>
<param-value>0</param-value>
</init-param>
<init-param>
<param-name>back-expiry</param-name>
<param-value>48h</param-value>
</init-param>
<init-param>
<param-name>back-size-low</param-name>
<param-value>0</param-value>
</init-param>
</init-params>
</cache-mapping>
<cache-mapping>
<cache-name>PEPServiceManager</cache-name>
<scheme-name>near-distributed</scheme-name>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment