tigase.cluster.strategy
public class SMNonCachingAllNodes extends Object implements ClusteringStrategyIfc
Constructor and Description |
---|
SMNonCachingAllNodes() |
Modifier and Type | Method and Description |
---|---|
boolean |
containsJid(tigase.xmpp.BareJID jid)
Method description
|
List<tigase.xmpp.JID> |
getAllNodes()
Method description
|
tigase.xmpp.JID[] |
getConnectionIdsForJid(tigase.xmpp.BareJID jid)
Method description
|
ConnectionRecord |
getConnectionRecord(tigase.xmpp.JID jid)
Returns a ConnectionRecord object associated with this user's full JID if
it exists in the cache or null if it does not.
|
Set<ConnectionRecord> |
getConnectionRecords(tigase.xmpp.BareJID bareJID)
Returns a set with all ConnectionRecords found in the cache for a given
user ID, that is BareJID.
|
Map<String,Object> |
getDefaults(Map<String,Object> params)
Method description
|
Object |
getInternalCacheData()
Deprecated.
|
List<tigase.xmpp.JID> |
getNodesForJid(tigase.xmpp.JID jid)
Method description
|
List<tigase.xmpp.JID> |
getNodesForPacketForward(tigase.xmpp.JID fromNode,
Set<tigase.xmpp.JID> visitedNodes,
Packet packet)
The method allows the strategy implementation to control to which cluster
nodes forward the given packet.
|
List<tigase.xmpp.JID> |
getNodesForUserConnect(tigase.xmpp.JID jid)
The method allows the strategy implementation to control to which cluster
nodes send the notification about user's new connection event.
|
List<tigase.xmpp.JID> |
getNodesForUserDisconnect(tigase.xmpp.JID jid)
The method allows the strategy implementation to control to which cluster
nodes send the notification about user's disconnection event.
|
void |
getStatistics(StatisticsList list)
Method description
|
boolean |
hasCompleteJidsInfo()
Method description
|
protected boolean |
isSuitableForForward(Packet packet) |
boolean |
needsSync()
Method description
|
void |
nodeConnected(tigase.xmpp.JID jid)
Method description
|
void |
nodeDisconnected(tigase.xmpp.JID jid)
Method description
|
void |
presenceUpdate(tigase.xml.Element presence,
ConnectionRecord rec)
The method is called on user's presence update received from a remote
cluster node.
|
void |
setProperties(Map<String,Object> props)
Method description
|
void |
setSessionManagerHandler(SessionManagerHandler sm)
The method allows to obtain SessionManagerHandler object by the strategy.
|
void |
userDisconnected(Queue<Packet> results,
ConnectionRecord rec)
Method description
|
void |
usersConnected(Queue<Packet> results,
ConnectionRecord... rec)
Method description
|
public void setSessionManagerHandler(SessionManagerHandler sm)
ClusteringStrategyIfc
setSessionManagerHandler
in interface ClusteringStrategyIfc
sm
- is an instance of the SessionManagerHandler class.public boolean containsJid(tigase.xmpp.BareJID jid)
containsJid
in interface OnlineJidsReporter
jid
- public List<tigase.xmpp.JID> getAllNodes()
getAllNodes
in interface ClusteringStrategyIfc
public tigase.xmpp.JID[] getConnectionIdsForJid(tigase.xmpp.BareJID jid)
getConnectionIdsForJid
in interface OnlineJidsReporter
jid
- public Map<String,Object> getDefaults(Map<String,Object> params)
getDefaults
in interface ClusteringStrategyIfc
params
- public List<tigase.xmpp.JID> getNodesForJid(tigase.xmpp.JID jid)
getNodesForJid
in interface ClusteringStrategyIfc
jid
- public void getStatistics(StatisticsList list)
getStatistics
in interface ClusteringStrategyIfc
list
- public boolean hasCompleteJidsInfo()
hasCompleteJidsInfo
in interface OnlineJidsReporter
public boolean needsSync()
needsSync
in interface ClusteringStrategyIfc
public void nodeConnected(tigase.xmpp.JID jid)
nodeConnected
in interface ClusteringStrategyIfc
jid
- public void nodeDisconnected(tigase.xmpp.JID jid)
nodeDisconnected
in interface ClusteringStrategyIfc
jid
- public void setProperties(Map<String,Object> props)
setProperties
in interface ClusteringStrategyIfc
props
- public void userDisconnected(Queue<Packet> results, ConnectionRecord rec)
userDisconnected
in interface ClusteringStrategyIfc
sm
- results
- jid
- public void usersConnected(Queue<Packet> results, ConnectionRecord... rec)
usersConnected
in interface ClusteringStrategyIfc
sm
- results
- jid
- public List<tigase.xmpp.JID> getNodesForPacketForward(tigase.xmpp.JID fromNode, Set<tigase.xmpp.JID> visitedNodes, Packet packet)
ClusteringStrategyIfc
getNodesForPacketForward
in interface ClusteringStrategyIfc
fromNode
- a source address if the packet was forwarded from a different
node, this may be null if the packet was generated on this node.visitedNodes
- a list of cluster nodes through which the packet already traveled,
this parameter can be null if the packet was generated on this
nodepacket
- a packet which is supposed to be sent to other node.protected boolean isSuitableForForward(Packet packet)
public List<tigase.xmpp.JID> getNodesForUserConnect(tigase.xmpp.JID jid)
ClusteringStrategyIfc
getNodesForUserConnect
in interface ClusteringStrategyIfc
public List<tigase.xmpp.JID> getNodesForUserDisconnect(tigase.xmpp.JID jid)
ClusteringStrategyIfc
getNodesForUserDisconnect
in interface ClusteringStrategyIfc
@Deprecated public Object getInternalCacheData()
ClusteringStrategyIfc
getInternalCacheData
in interface ClusteringStrategyIfc
public Set<ConnectionRecord> getConnectionRecords(tigase.xmpp.BareJID bareJID)
ClusteringStrategyIfc
getConnectionRecords
in interface ClusteringStrategyIfc
bareJID
- is an instance of the user's BareJID, that is account ID.public ConnectionRecord getConnectionRecord(tigase.xmpp.JID jid)
ClusteringStrategyIfc
getConnectionRecord
in interface ClusteringStrategyIfc
jid
- is an instance of the user's full JID.public void presenceUpdate(tigase.xml.Element presence, ConnectionRecord rec)
ClusteringStrategyIfc
presenceUpdate
in interface ClusteringStrategyIfc
presence
- Packet received from a remote cluster node.rec
- is an instance of the user's ConnectionRecord.Copyright © 2013 Tigase. All rights reserved.