Package tigase.cluster.strategy
Class SMNonCachingAllNodes
java.lang.Object
tigase.cluster.strategy.SMNonCachingAllNodes
- All Implemented Interfaces:
ClusteringStrategyIfc<ConnectionRecord>,StatisticHolder,OnlineJidsReporter
public abstract class SMNonCachingAllNodes
extends Object
implements ClusteringStrategyIfc<ConnectionRecord>
Created: May 13, 2009 9:53:44 AM
- Author:
- Artur Hefczyc
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsJid(BareJID jid) The method checks whether the given JID is known to the installation, either user connected to local machine or any of the cluster nodes.JID[]Retrieve all connection IDs (CIDs) for the given user.getConnectionRecords(BareJID bareJID) Returns a set with all ConnectionRecords found in the cache for a given user ID, that is BareJID.The method returns all cluster nodes currently connected to the cluster node.getNodesForJid(JID jid) getNodesForPacketForward(JID fromNode, Set<JID> visitedNodes, Packet packet) voidgetStatistics(StatisticsList list) Add the strategy statistics to the List.booleanMethod checks whether the clustering strategy has a complete JIDs info.protected booleanisSuitableForForward(Packet packet) voidnodeConnected(JID jid) This is a handler method which is called when a new node connects to the cluster.voidnodeDisconnected(JID jid) This is a handler method which is called when a node disconnects from the cluster.voidsetProperties(Map<String, Object> props) Method used to pass configuration parameters to the class.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface tigase.cluster.strategy.ClusteringStrategyIfc
getConnectionRecord, getConnectionRecordInstance, getConnectionRecordsByCreationTime, getDefaults, getInfo, handleLocalPacket, handleLocalPresenceSet, handleLocalResourceBind, handleLocalUserChangedConnId, handleLocalUserLogin, handleLocalUserLogout, processPacket, setClusterControllerMethods inherited from interface tigase.sys.OnlineJidsReporter
containsJidLocally, containsJidLocallyMethods inherited from interface tigase.stats.StatisticHolder
everyHour, everyMinute, everySecond, getStatistics, setStatisticsPrefix, statisticExecutedIn
-
Constructor Details
-
SMNonCachingAllNodes
public SMNonCachingAllNodes()
-
-
Method Details
-
containsJid
Description copied from interface:OnlineJidsReporterThe method checks whether the given JID is known to the installation, either user connected to local machine or any of the cluster nodes. False result does not mean the user is not connected. It means the method does not know anything about the JID. Some clustering strategies may not cache online users information.- Specified by:
containsJidin interfaceOnlineJidsReporter- Parameters:
jid- a user's JID for whom we query information.- Returns:
- true if the user is known as online to the installation, false if the method does not know.
-
nodeConnected
Description copied from interface:ClusteringStrategyIfcThis is a handler method which is called when a new node connects to the cluster.- Specified by:
nodeConnectedin interfaceClusteringStrategyIfc<ConnectionRecord>- Parameters:
jid- is a cluster node id.
-
nodeDisconnected
Description copied from interface:ClusteringStrategyIfcThis is a handler method which is called when a node disconnects from the cluster.- Specified by:
nodeDisconnectedin interfaceClusteringStrategyIfc<ConnectionRecord>- Parameters:
jid- is a cluster node id.
-
getNodesConnected
Description copied from interface:ClusteringStrategyIfcThe method returns all cluster nodes currently connected to the cluster node.- Specified by:
getNodesConnectedin interfaceClusteringStrategyIfc<ConnectionRecord>- Returns:
- List of all cluster nodes currently connected to the cluster node.
-
getConnectionIdsForJid
Description copied from interface:OnlineJidsReporterRetrieve all connection IDs (CIDs) for the given user.- Specified by:
getConnectionIdsForJidin interfaceOnlineJidsReporter- Parameters:
jid- id of the user for which we want to retrieve the list.- Returns:
- an array of
JIDcontaining all Connection IDs (CIDs) for the given user.
-
getConnectionRecords
Description copied from interface:ClusteringStrategyIfcReturns a set with all ConnectionRecords found in the cache for a given user ID, that is BareJID. In other words all user's resources/connectionIDs found in the cache associated with user's account.- Specified by:
getConnectionRecordsin interfaceClusteringStrategyIfc<ConnectionRecord>- Parameters:
bareJID- is an instance of the user's BareJID, that is account ID.- Returns:
- a Set instance with all ConnectionRecords found for a given BareJID. Note, the result may be null or it maybe an empty Set or non-empty set.
-
getNodesForJid
-
getNodesForPacketForward
-
getNodesForUserConnect
-
getNodesForUserDisconnect
-
getStatistics
Description copied from interface:ClusteringStrategyIfcAdd the strategy statistics to the List.- Specified by:
getStatisticsin interfaceClusteringStrategyIfc<ConnectionRecord>
-
hasCompleteJidsInfo
public boolean hasCompleteJidsInfo()Description copied from interface:OnlineJidsReporterMethod checks whether the clustering strategy has a complete JIDs info. That is whether the strategy knows about all users connected to all nodes. Some strategies may choose not to share this information among nodes, hence the methods returns false. Other may synchronize this information and can provide it to further optimize cluster traffic.- Specified by:
hasCompleteJidsInfoin interfaceOnlineJidsReporter- Returns:
- a true boolean value if the strategy has a complete information about all users connected to all cluster nodes.
-
setProperties
Description copied from interface:ClusteringStrategyIfcMethod used to pass configuration parameters to the class. Parameters are stored inMapwhich contains compiles set of defaults overwritten by parameters loaded from configuration file.
If he implementation took a good care of providing defaults for all parameters no parameter should be missing.- Specified by:
setPropertiesin interfaceClusteringStrategyIfc<ConnectionRecord>- Parameters:
props- aMapwith all configuration parameters for the class.
-
isSuitableForForward
-