Class SeeOtherHostDualIP

All Implemented Interfaces:
Initializable, RegistrarBean, UnregisterAware, Lifecycle, SeeOtherHostIfc

@Bean(name="seeOtherHost", parent=ClientConnectionManager.class, active=true) @ClusterModeRequired(active=true) public class SeeOtherHostDualIP extends SeeOtherHostHashed implements Initializable, RegistrarBean, UnregisterAware
Extended implementation of SeeOtherHost using redirect information from database based on cluster_nodes table.
  • Field Details

    • SEE_OTHER_HOST_FALLBACK_REDIRECTION_KEY

      public static final String SEE_OTHER_HOST_FALLBACK_REDIRECTION_KEY
      See Also:
    • SEE_OTHER_HOST_DATA_SOURCE_KEY

      public static final String SEE_OTHER_HOST_DATA_SOURCE_KEY
      See Also:
    • SEE_OTHER_HOST_DATA_SOURCE_VALUE

      public static final String SEE_OTHER_HOST_DATA_SOURCE_VALUE
    • SEE_OTHER_HOST_DB_URL_KEY

      public static final String SEE_OTHER_HOST_DB_URL_KEY
      See Also:
  • Constructor Details

    • SeeOtherHostDualIP

      public SeeOtherHostDualIP()
  • Method Details

    • findHostForJID

      public BareJID findHostForJID(BareJID jid, BareJID host)
      Description copied from interface: SeeOtherHostIfc
      Finds an appropriate host for a given JID
      Specified by:
      findHostForJID in interface SeeOtherHostIfc
      Overrides:
      findHostForJID in class SeeOtherHostHashed
      Parameters:
      jid - is a user JID extracted from the stream open attributes
      host - is "this" host to which the user is now connected and which calls the method
      Returns:
      BareJID of possible host to which the user should connect or NULL
    • clusterRepoItemEvent

      @HandleEvent public void clusterRepoItemEvent(ClusterRepoItemEvent event)
    • setNodes

      public void setNodes(List<JID> connectedNodes)
      Description copied from interface: SeeOtherHostIfc
      Sets list of available nodes in cluster environment
      Specified by:
      setNodes in interface SeeOtherHostIfc
      Overrides:
      setNodes in class SeeOtherHostHashed
      Parameters:
      connectedNodes - current list of nodes
    • isRedirectionRequired

      public boolean isRedirectionRequired(BareJID defaultHost, BareJID redirectionHost)
      Description copied from interface: SeeOtherHostIfc
      Method validates whether a redirection for a particular hostname and resulting redirection hastname is required
      Specified by:
      isRedirectionRequired in interface SeeOtherHostIfc
      Parameters:
      defaultHost - default hostname of the particular machine
      redirectionHost - destination hostname
      Returns:
      true if the redirection is required, otherwise false
    • register

      public void register(Kernel kernel)
      Description copied from interface: RegistrarBean
      Method called when bean is being registered allowing developer to programatically register other beans.
      Specified by:
      register in interface RegistrarBean
      Parameters:
      kernel - - instance from local scope
    • unregister

      public void unregister(Kernel kernel)
      Description copied from interface: RegistrarBean
      Method called while bean is being unregistered.
      Specified by:
      unregister in interface RegistrarBean
      Parameters:
      kernel - - instance from local scope
    • initialize

      public void initialize()
      Description copied from interface: Initializable
      Method will be called, when bean will be created, configured and ready to use.
      Specified by:
      initialize in interface Initializable
      Overrides:
      initialize in class SeeOtherHost
    • beforeUnregister

      public void beforeUnregister()
      Description copied from interface: UnregisterAware
      Method called before bean unregister.
      Specified by:
      beforeUnregister in interface UnregisterAware
    • reloadRedirection

      protected void reloadRedirection()