public final class EntityCapsManager extends Manager
Modifier and Type | Class and Description |
---|---|
static class |
EntityCapsManager.NodeVerHash |
Modifier and Type | Field and Description |
---|---|
static String |
ELEMENT |
static String |
NAMESPACE |
protected static EntityCapsPersistentCache |
persistentCache |
Modifier and Type | Method and Description |
---|---|
boolean |
areEntityCapsSupported(org.jxmpp.jid.Jid jid)
Returns true if Entity Caps are supported by a given JID.
|
boolean |
areEntityCapsSupportedByServer()
Returns true if Entity Caps are supported by the local service/server.
|
static void |
clearMemoryCache()
Clears the memory cache.
|
void |
disableEntityCaps() |
void |
enableEntityCaps() |
boolean |
entityCapsEnabled() |
protected static CapsVersionAndHash |
generateVerificationString(DiscoverInfo discoverInfo) |
protected static CapsVersionAndHash |
generateVerificationString(DiscoverInfo discoverInfo,
String hash)
Generates a XEP-115 Verification String
|
CapsVersionAndHash |
getCapsVersionAndHash()
Get our own caps version.
|
static DiscoverInfo |
getDiscoverInfoByUser(org.jxmpp.jid.Jid user)
Get the discover info given a user name.
|
static DiscoverInfo |
getDiscoveryInfoByNodeVer(String nodeVer)
Retrieve DiscoverInfo for a specific node.
|
static EntityCapsManager |
getInstanceFor(XMPPConnection connection) |
String |
getLocalNodeVer()
Returns the local entity's NodeVer (e.g.
|
static EntityCapsManager.NodeVerHash |
getNodeVerHashByJid(org.jxmpp.jid.Jid jid) |
static String |
getNodeVersionByJid(org.jxmpp.jid.Jid jid)
Get the Node version (node#ver) of a JID.
|
static void |
removeUserCapsNode(org.jxmpp.jid.Jid user)
Remove a record telling what entity caps node a user has.
|
static void |
setDefaultEntityNode(String entityNode)
Set the default entity node that will be used for new EntityCapsManagers.
|
void |
setEntityNode(String entityNode) |
static void |
setMaxsCacheSizes(int maxJidToNodeVerSize,
int maxCapsCacheSize)
Sets the maximum cache sizes.
|
static void |
setPersistentCache(EntityCapsPersistentCache cache)
Set the persistent cache implementation.
|
static boolean |
verifyDiscoverInfoVersion(String ver,
String hash,
DiscoverInfo info)
Verify DiscoverInfo and Caps Node as defined in XEP-0115 5.4 Processing
Method.
|
protected static boolean |
verifyPacketExtensions(DiscoverInfo info) |
connection, getAuthenticatedConnectionOrThrow, schedule
public static final String NAMESPACE
public static final String ELEMENT
protected static EntityCapsPersistentCache persistentCache
public static void setDefaultEntityNode(String entityNode)
entityNode
- public static String getNodeVersionByJid(org.jxmpp.jid.Jid jid)
jid
- the user (Full JID)public static EntityCapsManager.NodeVerHash getNodeVerHashByJid(org.jxmpp.jid.Jid jid)
public static DiscoverInfo getDiscoverInfoByUser(org.jxmpp.jid.Jid user)
user
- user name (Full JID)public static DiscoverInfo getDiscoveryInfoByNodeVer(String nodeVer)
nodeVer
- The node name (e.g.
"http://psi-im.org#q07IKJEyjvHSyhy//CH0CxmKi8w=").public static void setPersistentCache(EntityCapsPersistentCache cache)
cache
- public static void setMaxsCacheSizes(int maxJidToNodeVerSize, int maxCapsCacheSize)
maxJidToNodeVerSize
- maxCapsCacheSize
- public static void clearMemoryCache()
public static EntityCapsManager getInstanceFor(XMPPConnection connection)
public void enableEntityCaps()
public void disableEntityCaps()
public boolean entityCapsEnabled()
public void setEntityNode(String entityNode)
public static void removeUserCapsNode(org.jxmpp.jid.Jid user)
user
- the user (Full JID)public CapsVersionAndHash getCapsVersionAndHash()
public String getLocalNodeVer()
public boolean areEntityCapsSupported(org.jxmpp.jid.Jid jid) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException
jid
- XMPPException.XMPPErrorException
SmackException.NoResponseException
SmackException.NotConnectedException
InterruptedException
public boolean areEntityCapsSupportedByServer() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException
XMPPException.XMPPErrorException
SmackException.NoResponseException
SmackException.NotConnectedException
InterruptedException
public static boolean verifyDiscoverInfoVersion(String ver, String hash, DiscoverInfo info)
ver
- hash
- info
- protected static boolean verifyPacketExtensions(DiscoverInfo info)
info
- protected static CapsVersionAndHash generateVerificationString(DiscoverInfo discoverInfo)
protected static CapsVersionAndHash generateVerificationString(DiscoverInfo discoverInfo, String hash)
discoverInfo
- hash
- the used hash function, if null, default hash will be used