public 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 |
---|---|
static void |
addDiscoverInfoByNode(String nodeVer,
DiscoverInfo info)
Add DiscoverInfo to the database.
|
boolean |
areEntityCapsSupported(String 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(String 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(String jid) |
static String |
getNodeVersionByJid(String jid)
Get the Node version (node#ver) of a JID.
|
void |
removeUserCapsNode(String 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
|
void |
updateLocalEntityCaps()
Updates the local user Entity Caps information with the data provided
If we are connected and there was already a presence send, another
presence is send to inform others about your new Entity Caps node string.
|
static boolean |
verifyDiscoverInfoVersion(String ver,
String hash,
DiscoverInfo info)
Verify DisoverInfo and Caps Node as defined in XEP-0115 5.4 Processing
Method
|
protected static boolean |
verifyPacketExtensions(DiscoverInfo info) |
connection
public static final String NAMESPACE
public static final String ELEMENT
protected static EntityCapsPersistentCache persistentCache
public static void setDefaultEntityNode(String entityNode)
entityNode
- public static void addDiscoverInfoByNode(String nodeVer, DiscoverInfo info)
nodeVer
- The node and verification String (e.g.
"http://psi-im.org#q07IKJEyjvHSyhy//CH0CxmKi8w=").info
- DiscoverInfo for the specified node.public static String getNodeVersionByJid(String jid)
jid
- the user (Full JID)public static EntityCapsManager.NodeVerHash getNodeVerHashByJid(String jid)
public static DiscoverInfo getDiscoverInfoByUser(String 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) throws SmackException.NotConnectedException
public void removeUserCapsNode(String user)
user
- the user (Full JID)public CapsVersionAndHash getCapsVersionAndHash()
public String getLocalNodeVer()
public boolean areEntityCapsSupported(String jid) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException
jid
- XMPPException.XMPPErrorException
SmackException.NoResponseException
SmackException.NotConnectedException
public boolean areEntityCapsSupportedByServer() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException
XMPPException.XMPPErrorException
SmackException.NoResponseException
SmackException.NotConnectedException
public void updateLocalEntityCaps()
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