|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecttigase.cluster.strategy.SMNonCachingAllNodes
public class SMNonCachingAllNodes
Created: May 13, 2009 9:53:44 AM
| Constructor Summary | |
|---|---|
SMNonCachingAllNodes()
|
|
| Method Summary | |
|---|---|
boolean |
containsJid(java.lang.String jid)
|
java.util.List<java.lang.String> |
getAllNodes()
The method retutns all cluster nodes currently connected to the cluster. |
java.lang.String[] |
getConnectionIdsForJid(java.lang.String jid)
|
java.util.Map<java.lang.String,java.lang.Object> |
getDefaults(java.util.Map<java.lang.String,java.lang.Object> params)
This method is used for configuration purpose. |
java.util.List<java.lang.String> |
getNodesForJid(java.lang.String jid)
Returns a List of all cluster nodes on which the given user session
can exist. |
void |
getStatistics(StatisticsList list)
Add the strategy statistics to the List. |
boolean |
hasCompleteJidsInfo()
|
boolean |
needsSync()
This method returns 'true' if it needs online users syncronization
upon the node connection to the cluster. |
void |
nodeConnected(java.lang.String jid)
This is a handler method which is called when a new node connects to the cluster. |
void |
nodeDisconnected(java.lang.String jid)
This is a handler method which is called when a node disconnects from the cluster. |
void |
setProperties(java.util.Map<java.lang.String,java.lang.Object> props)
Method used to pass configuration parameters to the class. |
void |
userDisconnected(java.lang.String jid,
java.lang.String sm,
java.util.Queue<Packet> results)
This is a handler method which is called when a user disconnects from some node in the cluster. |
void |
usersConnected(java.lang.String sm,
java.util.Queue<Packet> results,
java.lang.String... jid)
This is a handler method which is called when a user connects to some node in the cluster. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SMNonCachingAllNodes()
| Method Detail |
|---|
public java.util.Map<java.lang.String,java.lang.Object> getDefaults(java.util.Map<java.lang.String,java.lang.Object> params)
ClusteringStrategyIfcsetProperties
method.
getDefaults in interface ClusteringStrategyIfcparams - a Map with properties loaded from
init.properties file which should be used for generating defaults.
Map with all the class default configuration
parameters.public void setProperties(java.util.Map<java.lang.String,java.lang.Object> props)
ClusteringStrategyIfcMap which contains compiles set of defaults overwriten
by parameters loaded from configuration file.
If he implementation took a good care of providing defaults for all
parameters no parameter should be missing.
setProperties in interface ClusteringStrategyIfcprops - a Map with all configuration parameters for the class.public java.util.List<java.lang.String> getNodesForJid(java.lang.String jid)
ClusteringStrategyIfcList of all cluster nodes on which the given user session
can exist. In the simplest scenario it can always return all cluster nodes
as in theory the user can connect to any node if it is not on the local node.
More specialized implementation can know kind of hashing algorithm which is
used for binding a specific user to a specific node or the implementation
can keep track of all connected users to all nodes and 'know' where is
the user connected at any given time.
In theory it can also return 'null' it it 'knows' the user is
offline.
getNodesForJid in interface ClusteringStrategyIfcjid - is a user full JID.
public void nodeConnected(java.lang.String jid)
ClusteringStrategyIfc
nodeConnected in interface ClusteringStrategyIfcjid - is a cluster node id.public void nodeDisconnected(java.lang.String jid)
ClusteringStrategyIfc
nodeDisconnected in interface ClusteringStrategyIfcjid - is a cluster node id.
public void usersConnected(java.lang.String sm,
java.util.Queue<Packet> results,
java.lang.String... jid)
ClusteringStrategyIfc
usersConnected in interface ClusteringStrategyIfcsm - is a cluster node id where the jid is connected to.results - is a collection of packets which can be generated upon the
user connection by the implementation.jid - is a list of full user JIDs which just connected to the cluster.
Normally there is only one JID provided, however, in some cases
(during syncronization) there might be more than one.
public void userDisconnected(java.lang.String jid,
java.lang.String sm,
java.util.Queue<Packet> results)
ClusteringStrategyIfc
userDisconnected in interface ClusteringStrategyIfcjid - us a user full JID just disconnected from the cluster.sm - is a cluster node id from which the user disconnected.results - is a collection of packets which can be generated upon the
user disconnection by the implementation.public java.util.List<java.lang.String> getAllNodes()
ClusteringStrategyIfc
getAllNodes in interface ClusteringStrategyIfcpublic boolean needsSync()
ClusteringStrategyIfc'true' if it needs online users syncronization
upon the node connection to the cluster. Normally it should return 'false'.
It it return 'true' then the synchronization starts. All online users
from all other nodes would sent in batches and the synchronization can take
any amount of time.
needsSync in interface ClusteringStrategyIfcpublic void getStatistics(StatisticsList list)
ClusteringStrategyIfc
getStatistics in interface ClusteringStrategyIfcpublic boolean hasCompleteJidsInfo()
hasCompleteJidsInfo in interface OnlineJidsReporterpublic boolean containsJid(java.lang.String jid)
containsJid in interface OnlineJidsReporterpublic java.lang.String[] getConnectionIdsForJid(java.lang.String jid)
getConnectionIdsForJid in interface OnlineJidsReporter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||