public class CacheContener extends Object implements tigase.sys.OnlineJidsReporter, CacheContenerIfc
Constructor and Description |
---|
CacheContener() |
Modifier and Type | Method and Description |
---|---|
int |
connectionsSize()
Returns number of all cached connections (all/total CIDs for all connected users)
|
boolean |
containsJid(tigase.xmpp.jid.BareJID jid) |
boolean |
containsJidLocally(tigase.xmpp.jid.BareJID jid) |
boolean |
containsJidLocally(tigase.xmpp.jid.JID jid) |
tigase.xmpp.jid.JID[] |
getConnectionIdsForJid(tigase.xmpp.jid.BareJID jid) |
ConnectionRecordExt |
getConnectionRecord(tigase.xmpp.jid.JID jid)
Retrieves a
ConnectionRecordExt for the particular, specific JID |
Set<ConnectionRecordExt> |
getConnectionRecords(tigase.xmpp.jid.BareJID bareJID)
Method retrieves all
ConnectionRecordExt records for the particular BareJID |
Object |
getInternalData()
Method allows retrieval internal structure underlying cache.
|
List<tigase.xmpp.jid.JID> |
getNodesForJid(tigase.xmpp.jid.JID jid)
Method retrieves all nodes on which particular user has it's connections.
|
boolean |
hasCompleteJidsInfo() |
int |
mapSize()
Return number of connected users
|
boolean |
needsSync()
Allow obtaining information whether cache needs synching with other nodes.
|
void |
removeAllForNode(tigase.xmpp.jid.JID node)
Method removes all cached connections which were related to the given node (e.g. when the node was disconnected)
as well as decreases count of all connections stored in cache.
|
void |
setSync(boolean sync)
Set the state of synchronisation.
|
void |
updatePresence(tigase.xml.Element presence,
ConnectionRecordExt rec)
Method updates given connection in the cache with the information about presence for the given connection.
|
void |
userDisconnected(ConnectionRecordExt rec)
Method responsible for user disconnection events.
|
void |
usersConnected(ConnectionRecordExt... recs)
Method responsible for user connection events.
|
public int connectionsSize()
public boolean containsJid(tigase.xmpp.jid.BareJID jid)
containsJid
in interface CacheContenerIfc
containsJid
in interface tigase.sys.OnlineJidsReporter
public boolean containsJidLocally(tigase.xmpp.jid.BareJID jid)
containsJidLocally
in interface tigase.sys.OnlineJidsReporter
public boolean containsJidLocally(tigase.xmpp.jid.JID jid)
containsJidLocally
in interface tigase.sys.OnlineJidsReporter
public int mapSize()
public boolean needsSync()
true
if cache is out of synch, false
otherwise.public void setSync(boolean sync)
setSync
in interface CacheContenerIfc
sync
- boolean value denoting sync state.public void removeAllForNode(tigase.xmpp.jid.JID node)
removeAllForNode
in interface CacheContenerIfc
node
- JID
of the node for which cached items will be removed.public void updatePresence(tigase.xml.Element presence, ConnectionRecordExt rec)
presence
- Element
containing presence informationrec
- ConnectionRecordExt
for which presence should be updatedpublic void userDisconnected(ConnectionRecordExt rec)
userDisconnected
in interface CacheContenerIfc
rec
- ConnectionRecordExt
for which presence should be updatedpublic void usersConnected(ConnectionRecordExt... recs)
usersConnected
in interface CacheContenerIfc
recs
- ConnectionRecordExt
for which presence should be updatedpublic tigase.xmpp.jid.JID[] getConnectionIdsForJid(tigase.xmpp.jid.BareJID jid)
getConnectionIdsForJid
in interface tigase.sys.OnlineJidsReporter
public ConnectionRecordExt getConnectionRecord(tigase.xmpp.jid.JID jid)
ConnectionRecordExt
for the particular, specific JID
getConnectionRecord
in interface CacheContenerIfc
jid
- for which ConnectionRecordExt
should be retrievedConnectionRecordExt
for the given JID
public Set<ConnectionRecordExt> getConnectionRecords(tigase.xmpp.jid.BareJID bareJID)
ConnectionRecordExt
records for the particular BareJID
bareJID
- for which all ConnectionRecordExt
should be retrievedSet
containing all ConnectionRecordExt
objects for the given JID
public Object getInternalData()
Object
with internal structure of underlying cache.public List<tigase.xmpp.jid.JID> getNodesForJid(tigase.xmpp.jid.JID jid)
jid
- for which list of cluster nodes should be returned.public boolean hasCompleteJidsInfo()
hasCompleteJidsInfo
in interface tigase.sys.OnlineJidsReporter
Copyright © 2004–2020 Tigase. All rights reserved.