Class SMNonCachingAllNodes

    • 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.
      • 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 java.util.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.
      • getNodesForJid

        public java.util.List<JID> getNodesForJid​(JID jid)
      • getNodesForPacketForward

        public java.util.List<JID> getNodesForPacketForward​(JID fromNode,
                                                            java.util.Set<JID> visitedNodes,
                                                            Packet packet)
      • getNodesForUserConnect

        public java.util.List<JID> getNodesForUserConnect​(JID jid)
      • getNodesForUserDisconnect

        public java.util.List<JID> getNodesForUserDisconnect​(JID jid)
      • 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​(java.util.Map<java.lang.String,​java.lang.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.
      • isSuitableForForward

        protected boolean isSuitableForForward​(Packet packet)