Class IQExtendedChannelSearchHandler

java.lang.Object
org.jivesoftware.openfire.muc.spi.IQExtendedChannelSearchHandler

public class IQExtendedChannelSearchHandler extends Object
This class adds support for the search functionality for MUC rooms as defined in XEP-0433: Extended Channel Search.
Author:
Guus der Kinderen, guus.der.kinderen@gmail.com
See Also:
  • Field Details

  • Constructor Details

    • IQExtendedChannelSearchHandler

      public IQExtendedChannelSearchHandler(MultiUserChatService mucService)
      Creates a new instance of the search provider.
      Parameters:
      mucService - The server for which to return search results.
  • Method Details

    • handleIQ

      public org.xmpp.packet.IQ handleIQ(org.xmpp.packet.IQ iq)
      Constructs an answer on a IQ stanza that contains a search request. The answer will be an IQ stanza of type 'result' or 'error'.
      Parameters:
      iq - The IQ stanza that is the search request.
      Returns:
      An answer to the provided request.
    • searchForChatrooms

      protected List<MUCRoomSearchInfo> searchForChatrooms(org.jivesoftware.openfire.muc.spi.IQExtendedChannelSearchHandler.SearchParameters params)
    • sortByAddress

      public static List<MUCRoomSearchInfo> sortByAddress(List<MUCRoomSearchInfo> mucs)
      Order the provided list by JID of the MUC
      Parameters:
      mucs - The unordered list that will be sorted.
      Returns:
      The order list of MUC rooms.
    • sortByUserAmount

      public static List<MUCRoomSearchInfo> sortByUserAmount(List<MUCRoomSearchInfo> mucs)
      Sorts the provided list in such a way that the MUC with the most users will be the first one in the list. Rooms with equal amounts of users are ordered by JID.
      Parameters:
      mucs - The unordered list that will be sorted.
      Returns:
      The sorted list of MUC rooms.