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 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.PubSubConfigconfigprotected tigase.eventbus.EventBuseventBusprotected tigase.xmpp.jid.JIDlocalNodeJidprotected static StringNODE_ATTRprotected Set<String>nodeConfigureElemNamesprotected static String[]PUBSUB_PATHprotected PubSubComponentClusteredIfcpubSubComponent
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated 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)List<tigase.xmpp.jid.JID>getNodesConnected()List<tigase.xmpp.jid.JID>getNodesConnectedWithLocal()voidinitialize()protected booleanisNodeConfigure(tigase.xml.Element pubsubElem)voidnodeConnected(tigase.xmpp.jid.JID jid)voidnodeDisconnected(tigase.xmpp.jid.JID jid)voidonItemPublishedEvent(tigase.pubsub.modules.PublishItemModule.ItemPublishedEvent event)Deprecated.voidonItemRetractedEvent(tigase.pubsub.modules.RetractItemModule.ItemRetractedEvent event)Deprecated.voidpacketProcessed()protected Map<String,String>prepareCommandData(tigase.xmpp.jid.BareJID serviceJid, String nodeName)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, String nodeName, tigase.pubsub.AbstractNodeConfig config)tigase.pubsub.repository.cached.NodeSubscriptionswrapNodeSubscriptions(tigase.pubsub.repository.NodeSubscriptions nodeSubscriptions)-
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
filterOutPacket, getNodesForPacket, isLocalNode, isOnlineLocally, nodeAddedToCollection, nodeAddedToRootCollection, nodeAffiliationsChanged, nodeConfigurationChanged, nodeRemovedFromCollection, nodeRemovedFromRootCollection, nodeSubscriptionsChanged, userRemoved
-
-
-
-
Field Detail
-
NODE_ATTR
protected static final String NODE_ATTR
- See Also:
- Constant Field Values
-
PUBSUB_PATH
protected static final String[] PUBSUB_PATH
-
cl_controller
protected tigase.cluster.api.ClusterControllerIfc cl_controller
-
config
@Inject protected tigase.pubsub.PubSubConfig 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 List<tigase.xmpp.jid.JID> getNodesConnected()
- Specified by:
getNodesConnectedin interfaceStrategyIfc
-
getNodesConnectedWithLocal
public 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 jid)
- Specified by:
nodeConnectedin interfaceStrategyIfc
-
nodeDisconnected
public void nodeDisconnected(tigase.xmpp.jid.JID jid)
- Specified by:
nodeDisconnectedin interfaceStrategyIfc
-
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, String nodeName, tigase.pubsub.AbstractNodeConfig config)- Specified by:
wrapNodeConfigin interfaceStrategyIfc
-
wrapNodeSubscriptions
public tigase.pubsub.repository.cached.NodeSubscriptions wrapNodeSubscriptions(tigase.pubsub.repository.NodeSubscriptions nodeSubscriptions)
- Specified by:
wrapNodeSubscriptionsin 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 Map<String,String> prepareCommandData(tigase.xmpp.jid.BareJID serviceJid, String nodeName)
-
isNodeConfigure
protected boolean isNodeConfigure(tigase.xml.Element pubsubElem)
-
onItemPublishedEvent
@Deprecated public void onItemPublishedEvent(tigase.pubsub.modules.PublishItemModule.ItemPublishedEvent event)
Deprecated.
-
onItemRetractedEvent
@Deprecated public void onItemRetractedEvent(tigase.pubsub.modules.RetractItemModule.ItemRetractedEvent event)
Deprecated.
-
-