Class SeeOtherHost

    • Constructor Detail

      • SeeOtherHost

        public SeeOtherHost()
    • Method Detail

      • 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
        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
      • 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
      • setDefaultHost

        public void setDefaultHost​(java.util.List<BareJID> defaultHost)
      • setNodes

        public void setNodes​(java.util.List<JID> nodes)
        Description copied from interface: SeeOtherHostIfc
        Sets list of available nodes in cluster environment
        Specified by:
        setNodes in interface SeeOtherHostIfc
        Parameters:
        nodes - current list of nodes
      • isEnabled

        public boolean isEnabled​(VHostItem vHost,
                                 SeeOtherHostIfc.Phase ph)
        Description copied from interface: SeeOtherHostIfc
        Performs check whether redirect is enabled in the given phase by default see-other-host redirect is only active in stream:open phase
        Specified by:
        isEnabled in interface SeeOtherHostIfc
        Parameters:
        vHost - vHost for which redirection should be performed
        ph - phase for which the check should be performed
        Returns:
        boolean value indicating whether to perform or not redirect for the phase passed as argument
      • start

        public void start()
        Specified by:
        start in interface Lifecycle
      • stop

        public void stop()
        Specified by:
        stop in interface Lifecycle
      • isNodeShutdown

        protected boolean isNodeShutdown​(BareJID jid)