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 Details

    • NODE_ATTR

      protected static final String NODE_ATTR
      See Also:
    • PUBSUB_PATH

      protected static final String[] PUBSUB_PATH
    • nodeConfigureElemNames

      protected final Set<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
  • Constructor Details

    • AbstractStrategy

      protected AbstractStrategy()
  • Method Details

    • getNodesConnected

      public List<tigase.xmpp.jid.JID> getNodesConnected()
      Specified by:
      getNodesConnected in interface StrategyIfc
    • getNodesConnectedWithLocal

      public List<tigase.xmpp.jid.JID> getNodesConnectedWithLocal()
      Specified by:
      getNodesConnectedWithLocal in interface StrategyIfc
    • getLocalNodeJid

      public tigase.xmpp.jid.JID getLocalNodeJid()
      Specified by:
      getLocalNodeJid in interface StrategyIfc
    • 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:
      nodeConnected in interface StrategyIfc
    • nodeDisconnected

      public void nodeDisconnected(tigase.xmpp.jid.JID jid)
      Specified by:
      nodeDisconnected in interface StrategyIfc
    • requestSync

      protected void requestSync(tigase.xmpp.jid.JID jid)
    • setClusterController

      public void setClusterController(tigase.cluster.api.ClusterControllerIfc cl_controller)
      Specified by:
      setClusterController in interface StrategyIfc
    • setConfig

      public void setConfig(tigase.pubsub.PubSubConfig config)
      Specified by:
      setConfig in interface StrategyIfc
    • setPubSubComponent

      public void setPubSubComponent(PubSubComponentClusteredIfc pubSubComponent)
      Specified by:
      setPubSubComponent in interface StrategyIfc
    • packetProcessed

      public void packetProcessed()
      Specified by:
      packetProcessed in interface StrategyIfc
    • sendException

      public boolean sendException(tigase.server.Packet packet, tigase.component.exceptions.ComponentException ex)
      Specified by:
      sendException in interface StrategyIfc
    • wrapNodeConfig

      public tigase.pubsub.AbstractNodeConfig wrapNodeConfig(tigase.xmpp.jid.BareJID serviceJid, String nodeName, tigase.pubsub.AbstractNodeConfig config)
      Specified by:
      wrapNodeConfig in interface StrategyIfc
    • newNodeSubscriptions

      public tigase.pubsub.repository.cached.ISubscriptionsCached newNodeSubscriptions(tigase.xmpp.jid.BareJID serviceJid, String nodeName, Object nodeId, Map<tigase.xmpp.jid.BareJID,tigase.pubsub.repository.stateless.UsersSubscription> nodeSubscriptions)
      Specified by:
      newNodeSubscriptions in interface StrategyIfc
    • initialize

      public void initialize()
      Specified by:
      initialize in interface tigase.kernel.beans.Initializable
    • beforeUnregister

      public void beforeUnregister()
      Specified by:
      beforeUnregister in interface tigase.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)