Class IQMuclumbusSearchHandler
- java.lang.Object
-
- org.jivesoftware.openfire.muc.spi.IQMuclumbusSearchHandler
-
public class IQMuclumbusSearchHandler extends Object
This class adds support for the search functionality for MUC rooms as identified by the 'https://xmlns.zombofant.net/muclumbus/search/1.0' namespace.- Author:
- Guus der Kinderen, guus.der.kinderen@gmail.com
- See Also:
-
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
IQMuclumbusSearchHandler.Key
-
Field Summary
Fields Modifier and Type Field Description static String
NAMESPACE
static SystemProperty<Boolean>
PROPERTY_ENABLED
static String
REQUEST_ELEMENT_NAME
static String
RESPONSE_ELEMENT_NAME
static String
VAR_KEY
static String
VAR_MIN_USERS
static String
VAR_Q
static String
VAR_SINDADDR
static String
VAR_SINDESCRIPTION
static String
VAR_SINNAME
-
Constructor Summary
Constructors Constructor Description IQMuclumbusSearchHandler(MultiUserChatService mucService)
Creates a new instance of the search provider.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.xmpp.packet.IQ
handleIQ(org.xmpp.packet.IQ iq)
Constructs an answer on a IQ stanza that contains a search request.protected List<MUCRoomSearchInfo>
searchForChatrooms(org.jivesoftware.openfire.muc.spi.IQMuclumbusSearchHandler.SearchParameters params)
static List<MUCRoomSearchInfo>
sortByAddress(List<MUCRoomSearchInfo> mucs)
Order the provided list by JID of the MUCstatic 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.
-
-
-
-
Field Detail
-
VAR_SINNAME
public static final String VAR_SINNAME
- See Also:
- Constant Field Values
-
VAR_Q
public static final String VAR_Q
- See Also:
- Constant Field Values
-
VAR_SINDESCRIPTION
public static final String VAR_SINDESCRIPTION
- See Also:
- Constant Field Values
-
VAR_SINDADDR
public static final String VAR_SINDADDR
- See Also:
- Constant Field Values
-
VAR_MIN_USERS
public static final String VAR_MIN_USERS
- See Also:
- Constant Field Values
-
VAR_KEY
public static final String VAR_KEY
- See Also:
- Constant Field Values
-
PROPERTY_ENABLED
public static SystemProperty<Boolean> PROPERTY_ENABLED
-
REQUEST_ELEMENT_NAME
public static final String REQUEST_ELEMENT_NAME
- See Also:
- Constant Field Values
-
RESPONSE_ELEMENT_NAME
public static final String RESPONSE_ELEMENT_NAME
- See Also:
- Constant Field Values
-
NAMESPACE
public static final String NAMESPACE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
IQMuclumbusSearchHandler
public IQMuclumbusSearchHandler(MultiUserChatService mucService)
Creates a new instance of the search provider.- Parameters:
mucService
- The server for which to return search results.
-
-
Method Detail
-
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.IQMuclumbusSearchHandler.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.- Parameters:
mucs
- The unordered list that will be sorted.- Returns:
- The sorted list of MUC rooms.
-
-