Search in sources :

Example 6 with XmppResultSet

use of com.reucon.openfire.plugin.archive.xep0059.XmppResultSet in project Openfire by igniterealtime.

the class IQQueryHandler method sendFinalMessage.

/**
	 * Send final message back to client following query.
	 * @param session Client session to respond to
	 * @param queryRequest Received query request
	 */
private void sendFinalMessage(Session session, final QueryRequest queryRequest) {
    Message finalMessage = new Message();
    finalMessage.setTo(session.getAddress());
    Element fin = finalMessage.addChildElement("fin", NAMESPACE);
    if (queryRequest.getQueryid() != null) {
        fin.addAttribute("queryid", queryRequest.getQueryid());
    }
    XmppResultSet resultSet = queryRequest.getResultSet();
    if (resultSet != null) {
        fin.add(resultSet.createResultElement());
        if (resultSet.isComplete()) {
            fin.addAttribute("complete", "true");
        }
    }
    session.process(finalMessage);
}
Also used : ArchivedMessage(com.reucon.openfire.plugin.archive.model.ArchivedMessage) XmppResultSet(com.reucon.openfire.plugin.archive.xep0059.XmppResultSet)

Aggregations

XmppResultSet (com.reucon.openfire.plugin.archive.xep0059.XmppResultSet)6 ArchivedMessage (com.reucon.openfire.plugin.archive.model.ArchivedMessage)4 Conversation (com.reucon.openfire.plugin.archive.model.Conversation)3 Connection (java.sql.Connection)3 PreparedStatement (java.sql.PreparedStatement)3 ResultSet (java.sql.ResultSet)3 SQLException (java.sql.SQLException)3 Date (java.util.Date)2 Element (org.dom4j.Element)2 IQ (org.xmpp.packet.IQ)2 JID (org.xmpp.packet.JID)2 Statement (java.sql.Statement)1 LinkedList (java.util.LinkedList)1 TreeMap (java.util.TreeMap)1 MUCRoom (org.jivesoftware.openfire.muc.MUCRoom)1 MultiUserChatManager (org.jivesoftware.openfire.muc.MultiUserChatManager)1 MultiUserChatService (org.jivesoftware.openfire.muc.MultiUserChatService)1 Message (org.xmpp.packet.Message)1