Package tigase.pubsub.cluster
Class AbstractStrategy
- java.lang.Object
-
- tigase.pubsub.cluster.AbstractStrategy
-
- All Implemented Interfaces:
tigase.kernel.beans.Initializable,tigase.kernel.beans.UnregisterAware,StrategyIfc
- Direct Known Subclasses:
ClusteredNodeStrategy,PartitionedStrategy
public abstract class AbstractStrategy extends java.lang.Object implements StrategyIfc, tigase.kernel.beans.Initializable, tigase.kernel.beans.UnregisterAware
- Author:
- andrzej
-
-
Field Summary
Fields Modifier and Type Field Description protected tigase.cluster.api.ClusterControllerIfccl_controllerprotected tigase.pubsub.IPubSubConfigconfigprotected tigase.eventbus.EventBuseventBusprotected tigase.xmpp.jid.JIDlocalNodeJidprotected static java.lang.StringNODE_ATTRprotected java.util.Set<java.lang.String>nodeConfigureElemNamesprotected static java.lang.String[]PUBSUB_PATHprotected PubSubComponentClusteredIfcpubSubComponent
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbeforeUnregister()tigase.xmpp.jid.JIDgetLocalNodeJid()protected tigase.xmpp.jid.JIDgetNodeForHashCode(int hashCode)tigase.xmpp.jid.JIDgetNodeForServiceJid(tigase.xmpp.jid.JID serviceJid)java.util.List<tigase.xmpp.jid.JID>getNodesConnected()java.util.List<tigase.xmpp.jid.JID>getNodesConnectedWithLocal()voidinitialize()protected booleanisNodeConfigure(tigase.xml.Element pubsubElem)tigase.pubsub.repository.cached.ISubscriptionsCachednewNodeSubscriptions(tigase.xmpp.jid.BareJID serviceJid, java.lang.String nodeName, java.lang.Object nodeId, java.util.Map<tigase.xmpp.jid.BareJID,tigase.pubsub.repository.stateless.UsersSubscription> nodeSubscriptions)voidnodeConnected(tigase.xmpp.jid.JID nodeJid)voidnodeDisconnected(tigase.xmpp.jid.JID jid)voidpacketProcessed()protected java.util.Map<java.lang.String,java.lang.String>prepareCommandData(tigase.xmpp.jid.BareJID serviceJid, java.lang.String nodeName)protected voidrequestSync(tigase.xmpp.jid.JID jid)booleansendException(tigase.server.Packet packet, tigase.component.exceptions.ComponentException ex)voidsetClusterController(tigase.cluster.api.ClusterControllerIfc cl_controller)voidsetConfig(tigase.pubsub.PubSubConfig config)protected voidsetLocalNodeJid(tigase.xmpp.jid.JID jid)voidsetPubSubComponent(PubSubComponentClusteredIfc pubSubComponent)tigase.pubsub.AbstractNodeConfigwrapNodeConfig(tigase.xmpp.jid.BareJID serviceJid, java.lang.String nodeName, tigase.pubsub.AbstractNodeConfig config)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface tigase.pubsub.cluster.StrategyIfc
broadcastNotification, filterOutPacket, getNodesForPacket, isLocalNode, isOnlineLocally, nodeAddedToCollection, nodeAddedToRootCollection, nodeAffiliationsChanged, nodeConfigurationChanged, nodeRemovedFromCollection, nodeRemovedFromRootCollection, nodeSubscriptionsChanged, presenceCapsChanged, presenceCapsRemoved, shouldBroadcastNotificationLocallyFor, userRemoved
-
-
-
-
Field Detail
-
NODE_ATTR
protected static final java.lang.String NODE_ATTR
- See Also:
- Constant Field Values
-
PUBSUB_PATH
protected static final java.lang.String[] PUBSUB_PATH
-
nodeConfigureElemNames
protected final java.util.Set<java.lang.String> nodeConfigureElemNames
-
cl_controller
protected tigase.cluster.api.ClusterControllerIfc cl_controller
-
config
@Inject protected tigase.pubsub.IPubSubConfig config
-
eventBus
@Inject protected tigase.eventbus.EventBus eventBus
-
localNodeJid
protected tigase.xmpp.jid.JID localNodeJid
-
pubSubComponent
@Inject(bean="service") protected PubSubComponentClusteredIfc pubSubComponent
-
-
Method Detail
-
getNodesConnected
public java.util.List<tigase.xmpp.jid.JID> getNodesConnected()
- Specified by:
getNodesConnectedin interfaceStrategyIfc
-
getNodesConnectedWithLocal
public java.util.List<tigase.xmpp.jid.JID> getNodesConnectedWithLocal()
- Specified by:
getNodesConnectedWithLocalin interfaceStrategyIfc
-
getLocalNodeJid
public tigase.xmpp.jid.JID getLocalNodeJid()
- Specified by:
getLocalNodeJidin interfaceStrategyIfc
-
setLocalNodeJid
protected void setLocalNodeJid(tigase.xmpp.jid.JID jid)
-
getNodeForServiceJid
public tigase.xmpp.jid.JID getNodeForServiceJid(tigase.xmpp.jid.JID serviceJid)
-
nodeConnected
public void nodeConnected(tigase.xmpp.jid.JID nodeJid)
- Specified by:
nodeConnectedin interfaceStrategyIfc
-
nodeDisconnected
public void nodeDisconnected(tigase.xmpp.jid.JID jid)
- Specified by:
nodeDisconnectedin interfaceStrategyIfc
-
requestSync
protected void requestSync(tigase.xmpp.jid.JID jid)
-
setClusterController
public void setClusterController(tigase.cluster.api.ClusterControllerIfc cl_controller)
- Specified by:
setClusterControllerin interfaceStrategyIfc
-
setConfig
public void setConfig(tigase.pubsub.PubSubConfig config)
- Specified by:
setConfigin interfaceStrategyIfc
-
setPubSubComponent
public void setPubSubComponent(PubSubComponentClusteredIfc pubSubComponent)
- Specified by:
setPubSubComponentin interfaceStrategyIfc
-
packetProcessed
public void packetProcessed()
- Specified by:
packetProcessedin interfaceStrategyIfc
-
sendException
public boolean sendException(tigase.server.Packet packet, tigase.component.exceptions.ComponentException ex)- Specified by:
sendExceptionin interfaceStrategyIfc
-
wrapNodeConfig
public tigase.pubsub.AbstractNodeConfig wrapNodeConfig(tigase.xmpp.jid.BareJID serviceJid, java.lang.String nodeName, tigase.pubsub.AbstractNodeConfig config)- Specified by:
wrapNodeConfigin interfaceStrategyIfc
-
newNodeSubscriptions
public tigase.pubsub.repository.cached.ISubscriptionsCached newNodeSubscriptions(tigase.xmpp.jid.BareJID serviceJid, java.lang.String nodeName, java.lang.Object nodeId, java.util.Map<tigase.xmpp.jid.BareJID,tigase.pubsub.repository.stateless.UsersSubscription> nodeSubscriptions)- Specified by:
newNodeSubscriptionsin interfaceStrategyIfc
-
initialize
public void initialize()
- Specified by:
initializein interfacetigase.kernel.beans.Initializable
-
beforeUnregister
public void beforeUnregister()
- Specified by:
beforeUnregisterin interfacetigase.kernel.beans.UnregisterAware
-
getNodeForHashCode
protected tigase.xmpp.jid.JID getNodeForHashCode(int hashCode)
-
prepareCommandData
protected java.util.Map<java.lang.String,java.lang.String> prepareCommandData(tigase.xmpp.jid.BareJID serviceJid, java.lang.String nodeName)
-
isNodeConfigure
protected boolean isNodeConfigure(tigase.xml.Element pubsubElem)
-
-