Class DefaultStrategy

java.lang.Object
tigase.meet.cluster.DefaultStrategy
All Implemented Interfaces:
StrategyIfc

@Bean(name="meetStrategy", parent=MeetComponentClustered.class, active=true) public class DefaultStrategy extends Object implements StrategyIfc
  • Constructor Details

    • DefaultStrategy

      public DefaultStrategy()
  • Method Details

    • acquireMeetCreationLock

      public CompletableFuture<Void> acquireMeetCreationLock(tigase.xmpp.jid.BareJID meetJid)
      Description copied from interface: StrategyIfc
      Creates cluster-wide meet creation lock for bare jid
      Specified by:
      acquireMeetCreationLock in interface StrategyIfc
      Returns:
    • releaseMeetCreationLock

      public void releaseMeetCreationLock(tigase.xmpp.jid.BareJID meetJid, boolean success)
      Description copied from interface: StrategyIfc
      Releases local meet creation lock and meet bare jid to node mapping on failure
      Specified by:
      releaseMeetCreationLock in interface StrategyIfc
    • getClusterController

      public tigase.cluster.api.ClusterControllerIfc getClusterController()
      Specified by:
      getClusterController in interface StrategyIfc
    • getCreationLockTimeout

      public long getCreationLockTimeout()
      Description copied from interface: StrategyIfc
      Method returns creation lock timeout
      Specified by:
      getCreationLockTimeout in interface StrategyIfc
      Returns:
    • getLocalNodeJid

      public tigase.xmpp.jid.JID getLocalNodeJid()
      Specified by:
      getLocalNodeJid in interface StrategyIfc
    • getNodeForPacket

      public tigase.xmpp.jid.JID getNodeForPacket(tigase.server.Packet packet) throws tigase.component.exceptions.ComponentException
      Description copied from interface: StrategyIfc
      Returns cluster node JID which should process this packet
      Specified by:
      getNodeForPacket in interface StrategyIfc
      Returns:
      Throws:
      tigase.component.exceptions.ComponentException
    • nodeConnected

      public void nodeConnected(tigase.xmpp.jid.JID nodeJid)
      Specified by:
      nodeConnected in interface StrategyIfc
    • streamLocalMeets

      public Stream<tigase.xmpp.jid.BareJID> streamLocalMeets()
      Description copied from interface: StrategyIfc
      Returns stream of bare jid's of local meets
      Specified by:
      streamLocalMeets in interface StrategyIfc
      Returns:
    • nodeDisconnected

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

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

      public void setMeetToNodeMapping(tigase.xmpp.jid.BareJID meetJid, tigase.xmpp.jid.JID jid)
      Description copied from interface: StrategyIfc
      Sets meet bare jid to cluster node mapping
      Specified by:
      setMeetToNodeMapping in interface StrategyIfc
    • removeMeetToNodeMapping

      public void removeMeetToNodeMapping(tigase.xmpp.jid.BareJID meetJid, tigase.xmpp.jid.JID jid)
      Description copied from interface: StrategyIfc
      Removes meet bare jid to cluster node mapping
      Specified by:
      removeMeetToNodeMapping in interface StrategyIfc
    • getNodeForMeet

      public tigase.xmpp.jid.JID getNodeForMeet(tigase.xmpp.jid.BareJID meetJid)
    • getComponent

      public tigase.server.AbstractMessageReceiver getComponent()
    • setComponent

      public void setComponent(tigase.server.AbstractMessageReceiver component)
    • createMeetCreationLock

      public boolean createMeetCreationLock(tigase.xmpp.jid.BareJID meetJid, long time, tigase.xmpp.jid.JID node)
      Description copied from interface: StrategyIfc
      Method creates local meet creation lock
      Specified by:
      createMeetCreationLock in interface StrategyIfc
      Returns:
    • acquiredMeetCreationLock

      public void acquiredMeetCreationLock(tigase.xmpp.jid.BareJID meetJid, tigase.xmpp.jid.JID node, boolean result)
      Description copied from interface: StrategyIfc
      Method notify future that meet creation lock was acquired at particular node
      Specified by:
      acquiredMeetCreationLock in interface StrategyIfc
    • releasedMeetCreationLock

      public void releasedMeetCreationLock(tigase.xmpp.jid.BareJID meetJid, tigase.xmpp.jid.JID node, boolean success)
      Description copied from interface: StrategyIfc
      Method releases meet creation lock and removes mapping of meet bare jid to node on failure
      Specified by:
      releasedMeetCreationLock in interface StrategyIfc
    • getMeetsCount

      public int getMeetsCount()
      Specified by:
      getMeetsCount in interface StrategyIfc