E - public abstract class DefaultClusteringStrategyAbstract<E extends ConnectionRecordIfc> extends Object implements ClusteringStrategyIfc<E>
| Modifier and Type | Field and Description |
|---|---|
protected ClusterControllerIfc |
cluster
Field description
|
protected String |
comp |
protected String |
prefix |
protected SessionManagerClusteredIfc |
sm
Field description
|
| Constructor and Description |
|---|
DefaultClusteringStrategyAbstract()
Constructs ...
|
| Modifier and Type | Method and Description |
|---|---|
void |
addCommandListener(CommandListener cmd)
Method description
|
boolean |
containsJid(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.
|
boolean |
containsJidLocally(BareJID jid)
The method checks whether the given JID is known to local cluster node
as connected user.
|
boolean |
containsJidLocally(JID jid)
The method checks whether the given JID is known to local cluster node
as connected user.
|
void |
everyHour() |
void |
everyMinute() |
void |
everySecond() |
JID[] |
getConnectionIdsForJid(BareJID jid)
Retrieve all connection IDs (CIDs) for the given user.
|
E |
getConnectionRecord(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.
|
E |
getConnectionRecordInstance()
Method description
|
Set<E> |
getConnectionRecords(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)
This method is used for configuration purpose.
|
String |
getInfo()
Method description
|
Object |
getInternalCacheData()
Deprecated.
|
List<JID> |
getNodesConnected()
The method returns all cluster nodes currently connected to the cluster node.
|
List<JID> |
getNodesForPacketForward(JID fromNode,
Set<JID> visitedNodes,
Packet packet)
Method description
|
SessionManagerClusteredIfc |
getSM() |
void |
getStatistics(StatisticsList list)
Add the strategy statistics to the List.
|
void |
getStatistics(String compName,
StatisticsList list) |
void |
handleLocalPacket(Packet packet,
XMPPResourceConnection conn)
Method description
|
void |
handleLocalPresenceSet(XMPPResourceConnection conn)
Method description
|
void |
handleLocalResourceBind(XMPPResourceConnection conn)
Method description
|
void |
handleLocalUserChangedConnId(BareJID userId,
XMPPResourceConnection conn,
JID oldConnId,
JID newConnId) |
void |
handleLocalUserLogin(BareJID userId,
XMPPResourceConnection conn)
Method description
|
void |
handleLocalUserLogout(BareJID userId,
XMPPResourceConnection conn)
Method description
|
boolean |
hasCompleteJidsInfo()
Method checks whether the clustering strategy has a complete JIDs info.
|
protected boolean |
isSuitableForForward(Packet packet)
Method description
|
boolean |
processPacket(Packet packet,
XMPPResourceConnection conn)
Method description
|
boolean |
sendToNextNode(JID fromNode,
Set<JID> visitedNodes,
Map<String,String> data,
Packet packet)
Method attempts to send the packet to the next cluster node.
|
void |
setClusterController(ClusterControllerIfc clComp)
Method description
|
void |
setProperties(Map<String,Object> props)
Method used to pass configuration parameters to the class.
|
void |
setSessionManagerHandler(SessionManagerClusteredIfc sm)
The method allows to obtain SessionManagerHandler object by the strategy.
|
void |
setStatisticsPrefix(String prefix) |
void |
statisticExecutedIn(long executionTime) |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitnodeConnected, nodeDisconnectedprotected String comp
protected String prefix
protected ClusterControllerIfc cluster
protected SessionManagerClusteredIfc sm
public DefaultClusteringStrategyAbstract()
public void statisticExecutedIn(long executionTime)
statisticExecutedIn in interface StatisticHolderpublic void everyHour()
everyHour in interface StatisticHolderpublic void everyMinute()
everyMinute in interface StatisticHolderpublic void everySecond()
everySecond in interface StatisticHolderpublic void getStatistics(String compName, StatisticsList list)
getStatistics in interface StatisticHolderpublic void setStatisticsPrefix(String prefix)
setStatisticsPrefix in interface StatisticHolderpublic final void addCommandListener(CommandListener cmd)
cmd - public boolean containsJid(BareJID jid)
OnlineJidsReportercontainsJid in interface OnlineJidsReporterjid - a user's JID for whom we query information.public boolean containsJidLocally(BareJID jid)
OnlineJidsReportercontainsJidLocally in interface OnlineJidsReporterjid - a user's JID for whom we query informationpublic boolean containsJidLocally(JID jid)
OnlineJidsReportercontainsJidLocally in interface OnlineJidsReporterjid - a user's JID for whom we query informationpublic void handleLocalPacket(Packet packet, XMPPResourceConnection conn)
ClusteringStrategyIfchandleLocalPacket in interface ClusteringStrategyIfc<E extends ConnectionRecordIfc>public void handleLocalPresenceSet(XMPPResourceConnection conn)
ClusteringStrategyIfchandleLocalPresenceSet in interface ClusteringStrategyIfc<E extends ConnectionRecordIfc>public void handleLocalResourceBind(XMPPResourceConnection conn)
ClusteringStrategyIfchandleLocalResourceBind in interface ClusteringStrategyIfc<E extends ConnectionRecordIfc>public void handleLocalUserLogin(BareJID userId, XMPPResourceConnection conn)
ClusteringStrategyIfchandleLocalUserLogin in interface ClusteringStrategyIfc<E extends ConnectionRecordIfc>public void handleLocalUserLogout(BareJID userId, XMPPResourceConnection conn)
ClusteringStrategyIfchandleLocalUserLogout in interface ClusteringStrategyIfc<E extends ConnectionRecordIfc>public void handleLocalUserChangedConnId(BareJID userId, XMPPResourceConnection conn, JID oldConnId, JID newConnId)
handleLocalUserChangedConnId in interface ClusteringStrategyIfc<E extends ConnectionRecordIfc>public boolean processPacket(Packet packet, XMPPResourceConnection conn)
ClusteringStrategyIfcprocessPacket in interface ClusteringStrategyIfc<E extends ConnectionRecordIfc>booleanpublic boolean sendToNextNode(JID fromNode, Set<JID> visitedNodes, Map<String,String> data, Packet packet)
fromNode - data - packet - to be sent to a next cluster nodevisitedNodes - a list of nodes already visited by the packet.public List<JID> getNodesConnected()
ClusteringStrategyIfcgetNodesConnected in interface ClusteringStrategyIfc<E extends ConnectionRecordIfc>public JID[] getConnectionIdsForJid(BareJID jid)
OnlineJidsReportergetConnectionIdsForJid in interface OnlineJidsReporterjid - id of the user for which we want to retrieve the list.JID containing all Connection IDs (CIDs) for
the given user.public E getConnectionRecord(JID jid)
ClusteringStrategyIfcgetConnectionRecord in interface ClusteringStrategyIfc<E extends ConnectionRecordIfc>jid - is an instance of the user's full JID.public E getConnectionRecordInstance()
ClusteringStrategyIfcgetConnectionRecordInstance in interface ClusteringStrategyIfc<E extends ConnectionRecordIfc>Epublic Set<E> getConnectionRecords(BareJID bareJID)
ClusteringStrategyIfcgetConnectionRecords in interface ClusteringStrategyIfc<E extends ConnectionRecordIfc>bareJID - is an instance of the user's BareJID, that is account ID.public Map<String,Object> getDefaults(Map<String,Object> params)
ClusteringStrategyIfcsetProperties
method.getDefaults in interface ClusteringStrategyIfc<E extends ConnectionRecordIfc>params - 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 String getInfo()
ClusteringStrategyIfcgetInfo in interface ClusteringStrategyIfc<E extends ConnectionRecordIfc>String@Deprecated public Object getInternalCacheData()
ClusteringStrategyIfcgetInternalCacheData in interface ClusteringStrategyIfc<E extends ConnectionRecordIfc>public List<JID> getNodesForPacketForward(JID fromNode, Set<JID> visitedNodes, Packet packet)
fromNode - visitedNodes - packet - List<JID>public void getStatistics(StatisticsList list)
ClusteringStrategyIfcgetStatistics in interface ClusteringStrategyIfc<E extends ConnectionRecordIfc>public boolean hasCompleteJidsInfo()
OnlineJidsReporterhasCompleteJidsInfo in interface OnlineJidsReporterpublic void setClusterController(ClusterControllerIfc clComp)
ClusteringStrategyIfcsetClusterController in interface ClusteringStrategyIfc<E extends ConnectionRecordIfc>public void setProperties(Map<String,Object> props)
ClusteringStrategyIfcMap which 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.setProperties in interface ClusteringStrategyIfc<E extends ConnectionRecordIfc>props - a Map with all configuration parameters for the
class.public void setSessionManagerHandler(SessionManagerClusteredIfc sm)
ClusteringStrategyIfcsetSessionManagerHandler in interface ClusteringStrategyIfc<E extends ConnectionRecordIfc>sm - is an instance of the SessionManagerHandler class.protected boolean isSuitableForForward(Packet packet)
packet - booleanpublic SessionManagerClusteredIfc getSM()
Copyright © 2018 "Tigase, Inc.". All rights reserved.