tigase.cluster.strategy

## Class SMNonCachingAllNodes

- java.lang.Object
- - tigase.cluster.strategy.SMNonCachingAllNodes

- All Implemented Interfaces:
    ClusteringStrategyIfc<ConnectionRecord>, StatisticHolder, OnlineJidsReporter

      public abstract class SMNonCachingAllNodes
      extends Object
      implements ClusteringStrategyIfc<ConnectionRecord>

  Created: May 13, 2009 9:53:44 AM
  Version:
    $Rev$
  Author:
    Artur Hefczyc

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SMNonCachingAllNodes()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `containsJid(BareJID jid)` The method checks whether the given JID is known to the installation, either user connected to local machine or any of the cluster nodes.
    `JID[]` | `getConnectionIdsForJid(BareJID jid)` Retrieve all connection IDs (CIDs) for the given user.
    `Set<ConnectionRecord>` | `getConnectionRecords(BareJID bareJID)` Returns a set with all ConnectionRecords found in the cache for a given user ID, that is BareJID.
    `Object` | `getInternalCacheData()` Deprecated.
    `List<JID>` | `getNodesConnected()` The method returns all cluster nodes currently connected to the cluster node.
    `List<JID>` | `getNodesForJid(JID jid)` Method description
    `List<JID>` | `getNodesForPacketForward(JID fromNode, Set<JID> visitedNodes, Packet packet)` Method description
    `List<JID>` | `getNodesForUserConnect(JID jid)` Method description
    `List<JID>` | `getNodesForUserDisconnect(JID jid)` Method description
    `void` | `getStatistics(StatisticsList list)` Add the strategy statistics to the List.
    `boolean` | `hasCompleteJidsInfo()` Method checks whether the clustering strategy has a complete JIDs info.
    `protected boolean` | `isSuitableForForward(Packet packet)` Method description
    `void` | `nodeConnected(JID jid)` This is a handler method which is called when a new node connects to the cluster.
    `void` | `nodeDisconnected(JID jid)` This is a handler method which is called when a node disconnects from the cluster.
    `void` | `setProperties(Map<String,Object> props)` Method used to pass configuration parameters to the class.
    `void` | `setSessionManagerHandler(SessionManagerClusteredIfc sm)` Method description

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

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

    - ### Methods inherited from interface tigase.cluster.strategy.ClusteringStrategyIfc

      `getConnectionRecord, getConnectionRecordInstance, getDefaults, getInfo, handleLocalPacket, handleLocalPresenceSet, handleLocalResourceBind, handleLocalUserChangedConnId, handleLocalUserLogin, handleLocalUserLogout, processPacket, setClusterController`

    - ### Methods inherited from interface tigase.sys.OnlineJidsReporter

      `containsJidLocally, containsJidLocally`

    - ### Methods inherited from interface tigase.stats.StatisticHolder

      `everyHour, everyMinute, everySecond, getStatistics, setStatisticsPrefix, statisticExecutedIn`

- - ### Constructor Detail

    - #### SMNonCachingAllNodes

          public SMNonCachingAllNodes()

  - ### Method Detail

    - #### containsJid

          public boolean containsJid(BareJID jid)

      Description copied from interface: `OnlineJidsReporter`
      The method checks whether the given JID is known to the installation, either user connected to local machine or any of the cluster nodes. False result does not mean the user is not connected. It means the method does not know anything about the JID. Some clustering strategies may not cache online users information.
      Specified by:
        `containsJid` in interface `OnlineJidsReporter`
      Parameters:
        `jid` - a user's JID for whom we query information.
      Returns:
        true if the user is known as online to the installation, false if the method does not know.

    - #### nodeConnected

          public void nodeConnected(JID jid)

      Description copied from interface: `ClusteringStrategyIfc`
      This is a handler method which is called when a new node connects to the cluster.
      Specified by:
        `nodeConnected` in interface `ClusteringStrategyIfc<ConnectionRecord>`
      Parameters:
        `jid` - is a cluster node id.

    - #### nodeDisconnected

          public void nodeDisconnected(JID jid)

      Description copied from interface: `ClusteringStrategyIfc`
      This is a handler method which is called when a node disconnects from the cluster.
      Specified by:
        `nodeDisconnected` in interface `ClusteringStrategyIfc<ConnectionRecord>`
      Parameters:
        `jid` - is a cluster node id.

    - #### getNodesConnected

          public List<JID> getNodesConnected()

      Description copied from interface: `ClusteringStrategyIfc`
      The method returns all cluster nodes currently connected to the cluster node.
      Specified by:
        `getNodesConnected` in interface `ClusteringStrategyIfc<ConnectionRecord>`
      Returns:
        List of all cluster nodes currently connected to the cluster node.

    - #### getConnectionIdsForJid

          public JID[] getConnectionIdsForJid(BareJID jid)

      Description copied from interface: `OnlineJidsReporter`
      Retrieve all connection IDs (CIDs) for the given user.
      Specified by:
        `getConnectionIdsForJid` in interface `OnlineJidsReporter`
      Parameters:
        `jid` - id of the user for which we want to retrieve the list.
      Returns:
        an array of `JID` containing all Connection IDs (CIDs) for the given user.

    - #### getConnectionRecords

          public Set<ConnectionRecord> getConnectionRecords(BareJID bareJID)

      Description copied from interface: `ClusteringStrategyIfc`
      Returns a set with all ConnectionRecords found in the cache for a given user ID, that is BareJID. In other words all user's resources/connectionIDs found in the cache associated with user's account.
      Specified by:
        `getConnectionRecords` in interface `ClusteringStrategyIfc<ConnectionRecord>`
      Parameters:
        `bareJID` - is an instance of the user's BareJID, that is account ID.
      Returns:
        a Set instance with all ConnectionRecords found for a given BareJID. Note, the result may be null or it maybe an empty Set or non-empty set.

    - #### getInternalCacheData

          @Deprecated
          public Object getInternalCacheData()

      Deprecated.
      Description copied from interface: `ClusteringStrategyIfc`
      Note! This is not for a common use method. This is for debugging and diagnostic purposes only and maybe removed or changed at any time in the future. It returns a content of an internal cache from the strategy. Regardless of the cache data organization inside the strategy, it is returned here in a common format. It may be a copy or a direct reference to internal data. Therefore this is unmodifiable instance of the cache. Generating results of this structure may be a costly operation, therefore it must not be called frequently.
      Specified by:
        `getInternalCacheData` in interface `ClusteringStrategyIfc<ConnectionRecord>`
      Returns:
        an Object with content of an internal cache data.

    - #### getNodesForJid

          public List<JID> getNodesForJid(JID jid)

      Method description
      Parameters:
        `jid` -

    - #### getNodesForPacketForward

          public List<JID> getNodesForPacketForward(JID fromNode,
                                                    Set<JID> visitedNodes,
                                                    Packet packet)

      Method description
      Parameters:
        `fromNode` -
        `visitedNodes` -
        `packet` -

    - #### getNodesForUserConnect

          public List<JID> getNodesForUserConnect(JID jid)

      Method description
      Parameters:
        `jid` -

    - #### getNodesForUserDisconnect

          public List<JID> getNodesForUserDisconnect(JID jid)

      Method description
      Parameters:
        `jid` -

    - #### getStatistics

          public void getStatistics(StatisticsList list)

      Description copied from interface: `ClusteringStrategyIfc`
      Add the strategy statistics to the List.
      Specified by:
        `getStatistics` in interface `ClusteringStrategyIfc<ConnectionRecord>`

    - #### hasCompleteJidsInfo

          public boolean hasCompleteJidsInfo()

      Description copied from interface: `OnlineJidsReporter`
      Method checks whether the clustering strategy has a complete JIDs info. That is whether the strategy knows about all users connected to all nodes. Some strategies may choose not to share this information among nodes, hence the methods returns false. Other may synchronize this information and can provide it to further optimize cluster traffic.
      Specified by:
        `hasCompleteJidsInfo` in interface `OnlineJidsReporter`
      Returns:
        a true boolean value if the strategy has a complete information about all users connected to all cluster nodes.

    - #### setProperties

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

      Description copied from interface: `ClusteringStrategyIfc`
      Method used to pass configuration parameters to the class. Parameters are stored in `Map` which contains compiles set of defaults overwritten by parameters loaded from configuration file. If he implementation took a good care of providing defaults for all parameters no parameter should be missing.
      Specified by:
        `setProperties` in interface `ClusteringStrategyIfc<ConnectionRecord>`
      Parameters:
        `props` - a `Map` with all configuration parameters for the class.

    - #### setSessionManagerHandler

          public void setSessionManagerHandler(SessionManagerClusteredIfc sm)

      Method description
      Specified by:
        `setSessionManagerHandler` in interface `ClusteringStrategyIfc<ConnectionRecord>`
      Parameters:
        `sm` -

    - #### isSuitableForForward

          protected boolean isSuitableForForward(Packet packet)

      Method description
      Parameters:
        `packet` -

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