tigase.server.xmppclient

## Class SeeOtherHostDualIP

- java.lang.Object
- - tigase.server.xmppclient.SeeOtherHost
  - - tigase.server.xmppclient.SeeOtherHostHashed
    - - tigase.server.xmppclient.SeeOtherHostDualIP

- All Implemented Interfaces:
    EventHandler, SeeOtherHostIfc

      public class SeeOtherHostDualIP
      extends SeeOtherHostHashed
      implements EventHandler

  Extended implementation of SeeOtherHost using redirect information from database based on cluster_nodes table.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static interface` | `SeeOtherHostDualIP.DualIPRepository`

    - ### Nested classes/interfaces inherited from interface tigase.server.xmppclient.SeeOtherHostIfc

      `SeeOtherHostIfc.Phase`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected String` | `get_host_DB_url`
    `static String` | `SEE_OTHER_HOST_DATA_SOURCE_KEY`
    `static String` | `SEE_OTHER_HOST_DATA_SOURCE_VALUE`
    `static String` | `SEE_OTHER_HOST_DB_URL_KEY`
    `static String` | `SEE_OTHER_HOST_FALLBACK_REDIRECTION_KEY`

    - ### Fields inherited from class tigase.server.xmppclient.SeeOtherHostHashed

      `connectedNodes`

    - ### Fields inherited from class tigase.server.xmppclient.SeeOtherHost

      `defaultHost, REDIRECTION_ENABLED, vHostManager`

    - ### Fields inherited from interface tigase.server.xmppclient.SeeOtherHostIfc

      `CM_SEE_OTHER_HOST_ACTIVE, CM_SEE_OTHER_HOST_CLASS_PROP_DEF_VAL, CM_SEE_OTHER_HOST_CLASS_PROP_DEF_VAL_CLUSTER, CM_SEE_OTHER_HOST_CLASS_PROP_KEY, CM_SEE_OTHER_HOST_CLASS_PROPERTY, CM_SEE_OTHER_HOST_DEFAULT_HOST, CM_SEE_OTHER_HOST_DEFAULT_PORT`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SeeOtherHostDualIP()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `BareJID` | `findHostForJID(BareJID jid, BareJID host)` Finds an appropriate host for a given JID
    `void` | `getDefaults(Map<String,Object> defs, Map<String,Object> params)`
    `boolean` | `isRedirectionRequired(BareJID defaultHost, BareJID redirectionHost)` Method validates whether a redirection for a particular hostname and resulting redirection hastname is required
    `void` | `onEvent(String name, String xmlns, Element event)`
    `protected void` | `reloadRedirection()`
    `void` | `setNodes(List<JID> connectedNodes)` Sets list of available nodes in cluster environment
    `void` | `setProperties(Map<String,Object> props)`

    - ### Methods inherited from class tigase.server.xmppclient.SeeOtherHost

      `isEnabled`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface tigase.server.xmppclient.SeeOtherHostIfc

      `getStreamError`

- - ### Field Detail

    - #### SEE_OTHER_HOST_FALLBACK_REDIRECTION_KEY

          public static final String SEE_OTHER_HOST_FALLBACK_REDIRECTION_KEY

      See Also:
        Constant Field Values

    - #### SEE_OTHER_HOST_DATA_SOURCE_KEY

          public static final String SEE_OTHER_HOST_DATA_SOURCE_KEY

      See Also:
        Constant Field Values

    - #### 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:
        Constant Field Values

    - #### get_host_DB_url

          protected String get_host_DB_url

  - ### Constructor Detail

    - #### SeeOtherHostDualIP

          public SeeOtherHostDualIP()

  - ### 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`
      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

    - #### onEvent

          public void onEvent(String name,
                              String xmlns,
                              Element event)

      Specified by:
        `onEvent` in interface `EventHandler`

    - #### 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

    - #### getDefaults

          public void getDefaults(Map<String,Object> defs,
                                  Map<String,Object> params)

      Specified by:
        `getDefaults` in interface `SeeOtherHostIfc`
      Overrides:
        `getDefaults` in class `SeeOtherHost`

    - #### setProperties

          public void setProperties(Map<String,Object> props)

      Specified by:
        `setProperties` in interface `SeeOtherHostIfc`
      Overrides:
        `setProperties` in class `SeeOtherHost`

    - #### 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`

    - #### reloadRedirection

          protected void reloadRedirection()

Copyright © 2022 "Tigase, Inc.". All rights reserved.