|
Jitsi: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.java.sip.communicator.impl.protocol.jabber.extensions.caps.EntityCapsManager
public class EntityCapsManager
Keeps track of entity capabilities. This work is based on Jonas Adahl's smack fork.
| Nested Class Summary | |
|---|---|
static class |
EntityCapsManager.Caps
Implements an immutable value which stands for a specific node, a specific hash (algorithm) and a specific ver. |
| Constructor Summary | |
|---|---|
EntityCapsManager()
|
|
| Method Summary | |
|---|---|
void |
addCapsVerListener(CapsVerListener listener)
Adds listener to the list of CapsVerListeners that we
notify when new features occur and the version hash needs to be
regenerated. |
static void |
addDiscoverInfoByCaps(EntityCapsManager.Caps caps,
org.jivesoftware.smackx.packet.DiscoverInfo info)
Add DiscoverInfo to our caps database. |
void |
addPacketListener(org.jivesoftware.smack.XMPPConnection connection)
Registers this Manager's listener with connection. |
void |
addUserCapsNodeListener(UserCapsNodeListener listener)
Adds a specific UserCapsNodeListener to the list of UserCapsNodeListeners interested in events notifying about changes in the list of user caps nodes of this EntityCapsManager. |
void |
calculateEntityCapsVersion(org.jivesoftware.smackx.packet.DiscoverInfo discoverInfo)
Calculates the ver string for the specified discoverInfo, identity type, name features, and extendedInfo. |
EntityCapsManager.Caps |
getCapsByUser(String user)
Gets the Caps i.e. |
String |
getCapsVersion()
Get our own caps version. |
static org.jivesoftware.smackx.packet.DiscoverInfo |
getDiscoverInfoByCaps(EntityCapsManager.Caps caps)
Retrieve DiscoverInfo for a specific node. |
org.jivesoftware.smackx.packet.DiscoverInfo |
getDiscoverInfoByUser(String user)
Get the discover info given a user name. |
String |
getNode()
Get our own entity node. |
void |
removeCapsVerListener(CapsVerListener listener)
Removes listener from the list of currently registered CapsVerListeners. |
void |
removeContactCapsNode(Contact contact)
Remove records telling what entity caps node a contact has. |
void |
removeUserCapsNode(String user)
Remove a record telling what entity caps node a user has. |
void |
removeUserCapsNodeListener(UserCapsNodeListener listener)
Removes a specific UserCapsNodeListener from the list of UserCapsNodeListeners interested in events notifying about changes in the list of user caps nodes of this EntityCapsManager. |
void |
setCurrentCapsVersion(org.jivesoftware.smackx.packet.DiscoverInfo discoverInfo,
String capsVersion)
Set our own caps version. |
void |
setNode(String node)
Set our own entity node. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public EntityCapsManager()
| Method Detail |
|---|
public static void addDiscoverInfoByCaps(EntityCapsManager.Caps caps,
org.jivesoftware.smackx.packet.DiscoverInfo info)
DiscoverInfo to our caps database.
Warning: The specified DiscoverInfo is trusted to be valid with respect to the specified Caps for performance reasons because the DiscoverInfo should have already been validated in order to be used elsewhere anyway.
caps - the Caps i.e. the node, the hash and the ver for
which a DiscoverInfo is to be added to our caps database.info - DiscoverInfo for the specified Caps.public void addUserCapsNodeListener(UserCapsNodeListener listener)
listener - the UserCapsNodeListener which is interested in
events notifying about changes in the list of user caps nodes of this
EntityCapsManagerpublic void removeContactCapsNode(Contact contact)
contact - the contactpublic void removeUserCapsNode(String user)
user - the user (Full JID)public void removeUserCapsNodeListener(UserCapsNodeListener listener)
listener - the UserCapsNodeListener which is no longer
interested in events notifying about changes in the list of user caps
nodes of this EntityCapsManagerpublic EntityCapsManager.Caps getCapsByUser(String user)
user - the user (Full JID)
public org.jivesoftware.smackx.packet.DiscoverInfo getDiscoverInfoByUser(String user)
user - user name (Full JID)
public String getCapsVersion()
public String getNode()
public void setNode(String node)
node - the new nodepublic static org.jivesoftware.smackx.packet.DiscoverInfo getDiscoverInfoByCaps(EntityCapsManager.Caps caps)
caps - the Caps i.e. the node, the hash and the ver
public void addPacketListener(org.jivesoftware.smack.XMPPConnection connection)
connection - the connection that we'd like this manager to register
with.public void addCapsVerListener(CapsVerListener listener)
CapsVerListeners that we
notify when new features occur and the version hash needs to be
regenerated. The method would also notify listener if our
current caps version has been generated and is different than
null.
listener - the CapsVerListener we'd like to register.public void removeCapsVerListener(CapsVerListener listener)
CapsVerListeners.
listener - the CapsVerListener we'd like to unregister.public void calculateEntityCapsVersion(org.jivesoftware.smackx.packet.DiscoverInfo discoverInfo)
discoverInfo - the DiscoverInfo we'd be creating a ver
String for
public void setCurrentCapsVersion(org.jivesoftware.smackx.packet.DiscoverInfo discoverInfo,
String capsVersion)
discoverInfo - the DiscoverInfo that we'd like to map to the
capsVersion.capsVersion - the new caps version
|
Jitsi: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||