E
- public abstract class DefaultClusteringStrategyAbstract<E extends ConnectionRecordIfc> extends Object implements ClusteringStrategyIfc<E>
Modifier and Type | Field and Description |
---|---|
protected ClusterControllerIfc |
cluster |
protected String |
comp |
protected EventBus |
eventBus |
protected String |
prefix |
protected SessionManagerClusteredIfc |
sm |
Constructor and Description |
---|
DefaultClusteringStrategyAbstract() |
Modifier and Type | Method and Description |
---|---|
void |
addCommandListener(CommandListener cmd) |
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() |
void |
fireEvent(Object event) |
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() |
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() |
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) |
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) |
void |
handleLocalPresenceSet(XMPPResourceConnection conn) |
void |
handleLocalResourceBind(XMPPResourceConnection conn) |
void |
handleLocalUserChangedConnId(BareJID userId,
XMPPResourceConnection conn,
JID oldConnId,
JID newConnId) |
void |
handleLocalUserLogin(BareJID userId,
XMPPResourceConnection conn) |
void |
handleLocalUserLogout(BareJID userId,
XMPPResourceConnection conn) |
boolean |
hasCompleteJidsInfo()
Method checks whether the clustering strategy has a complete JIDs info.
|
protected boolean |
isSuitableForForward(Packet packet) |
boolean |
processPacket(Packet packet,
XMPPResourceConnection conn) |
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) |
void |
setProperties(Map<String,Object> props)
Method used to pass configuration parameters to the class.
|
void |
setStatisticsPrefix(String prefix) |
void |
statisticExecutedIn(long executionTime) |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
nodeConnected, nodeDisconnected
@Inject protected ClusterControllerIfc cluster
protected String comp
protected String prefix
@Inject protected SessionManagerClusteredIfc sm
public void statisticExecutedIn(long executionTime)
statisticExecutedIn
in interface StatisticHolder
public void everyHour()
everyHour
in interface StatisticHolder
public void everyMinute()
everyMinute
in interface StatisticHolder
public void everySecond()
everySecond
in interface StatisticHolder
public void getStatistics(String compName, StatisticsList list)
getStatistics
in interface StatisticHolder
public void setStatisticsPrefix(String prefix)
setStatisticsPrefix
in interface StatisticHolder
public final void addCommandListener(CommandListener cmd)
public boolean containsJid(BareJID jid)
OnlineJidsReporter
containsJid
in interface OnlineJidsReporter
jid
- a user's JID for whom we query information.public boolean containsJidLocally(BareJID jid)
OnlineJidsReporter
containsJidLocally
in interface OnlineJidsReporter
jid
- a user's JID for whom we query informationpublic boolean containsJidLocally(JID jid)
OnlineJidsReporter
containsJidLocally
in interface OnlineJidsReporter
jid
- a user's JID for whom we query informationpublic void handleLocalPacket(Packet packet, XMPPResourceConnection conn)
handleLocalPacket
in interface ClusteringStrategyIfc<E extends ConnectionRecordIfc>
public void handleLocalPresenceSet(XMPPResourceConnection conn)
handleLocalPresenceSet
in interface ClusteringStrategyIfc<E extends ConnectionRecordIfc>
public void handleLocalResourceBind(XMPPResourceConnection conn)
handleLocalResourceBind
in interface ClusteringStrategyIfc<E extends ConnectionRecordIfc>
public void handleLocalUserLogin(BareJID userId, XMPPResourceConnection conn)
handleLocalUserLogin
in interface ClusteringStrategyIfc<E extends ConnectionRecordIfc>
public void handleLocalUserLogout(BareJID userId, XMPPResourceConnection conn)
handleLocalUserLogout
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)
processPacket
in interface ClusteringStrategyIfc<E extends ConnectionRecordIfc>
public 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()
ClusteringStrategyIfc
getNodesConnected
in interface ClusteringStrategyIfc<E extends ConnectionRecordIfc>
public JID[] getConnectionIdsForJid(BareJID jid)
OnlineJidsReporter
getConnectionIdsForJid
in interface OnlineJidsReporter
jid
- 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)
ClusteringStrategyIfc
getConnectionRecord
in interface ClusteringStrategyIfc<E extends ConnectionRecordIfc>
jid
- is an instance of the user's full JID.public E getConnectionRecordInstance()
getConnectionRecordInstance
in interface ClusteringStrategyIfc<E extends ConnectionRecordIfc>
public Set<E> getConnectionRecords(BareJID bareJID)
ClusteringStrategyIfc
getConnectionRecords
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)
ClusteringStrategyIfc
setProperties
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()
getInfo
in interface ClusteringStrategyIfc<E extends ConnectionRecordIfc>
@Deprecated public Object getInternalCacheData()
ClusteringStrategyIfc
getInternalCacheData
in interface ClusteringStrategyIfc<E extends ConnectionRecordIfc>
public List<JID> getNodesForPacketForward(JID fromNode, Set<JID> visitedNodes, Packet packet)
public void getStatistics(StatisticsList list)
ClusteringStrategyIfc
getStatistics
in interface ClusteringStrategyIfc<E extends ConnectionRecordIfc>
public boolean hasCompleteJidsInfo()
OnlineJidsReporter
hasCompleteJidsInfo
in interface OnlineJidsReporter
public void setClusterController(ClusterControllerIfc clComp)
setClusterController
in interface ClusteringStrategyIfc<E extends ConnectionRecordIfc>
public void setProperties(Map<String,Object> props)
ClusteringStrategyIfc
Map
which
contains compiles set of defaults overwritten by parameters loaded from configuration file.
setProperties
in interface ClusteringStrategyIfc<E extends ConnectionRecordIfc>
props
- a Map
with all configuration parameters for the class.public SessionManagerClusteredIfc getSM()
public void fireEvent(Object event)
protected boolean isSuitableForForward(Packet packet)
Copyright © 2004–2019 "Tigase, Inc.". All rights reserved.