/** * Sends the filled out answer form to be sent and queried by the search service. * * @param con the current Connection. * @param searchForm the <code>Form</code> to send for querying. * @param searchService the search service to use. (ex. search.jivesoftware.com) * @return ReportedData the data found from the query. * @throws XMPPException * thrown if a server error has occurred. */ public ReportedData sendSearchForm(Connection con, Form searchForm, String searchService) throws XMPPException { UserSearch search = new UserSearch(); search.setType(Type.SET); search.setTo(searchService); search.addExtension(searchForm.getDataFormToSend()); PacketCollector collector = con.createPacketCollector(new PacketIDFilter(search.getPacketID())); con.sendPacket(search); IQ response = (IQ) collector.nextResult(SmackConfiguration.getPacketReplyTimeout()); // Cancel the collector. collector.cancel(); if (response == null) { throw new XMPPException("No response from server on status set."); } if (response.getError() != null) { return sendSimpleSearchForm(con, searchForm, searchService); } return ReportedData.getReportedDataFrom(response); }
/** * Sends the filled out answer form to be sent and queried by the search service. * * @param con the current Connection. * @param searchForm the <code>Form</code> to send for querying. * @param searchService the search service to use. (ex. search.jivesoftware.com) * @return ReportedData the data found from the query. * @throws org.jivesoftware.smack.XMPPException * thrown if a server error has occurred. */ public ReportedData sendSearchForm(Connection con, Form searchForm, String searchService) throws XMPPException { UserSearch search = new UserSearch(); search.setType(IQ.Type.SET); search.setTo(searchService); search.addExtension(searchForm.getDataFormToSend()); PacketCollector collector = con.createPacketCollector(new PacketIDFilter(search.getPacketID())); con.sendPacket(search); IQ response = (IQ) collector.nextResult(SmackConfiguration.getPacketReplyTimeout()); // Cancel the collector. collector.cancel(); if (response == null) { throw new XMPPException("No response from server on status set."); } if (response.getError() != null) { return sendSimpleSearchForm(con, searchForm, searchService); } return ReportedData.getReportedDataFrom(response); }
/** * Sends the filled out answer form to be sent and queried by the search service. * * @param con the current XMPPConnection. * @param searchForm the <code>Form</code> to send for querying. * @param searchService the search service to use. (ex. search.jivesoftware.com) * @return ReportedData the data found from the query. * @throws org.jivesoftware.smack.XMPPException * thrown if a server error has occurred. */ public ReportedData sendSearchForm(XMPPConnection con, Form searchForm, String searchService) throws XMPPException { UserSearch search = new UserSearch(); search.setType(IQ.Type.SET); search.setTo(searchService); search.addExtension(searchForm.getDataFormToSend()); PacketCollector collector = con.createPacketCollector(new PacketIDFilter(search.getPacketID())); con.sendPacket(search); IQ response = (IQ) collector.nextResult(SmackConfiguration.getPacketReplyTimeout()); // Cancel the collector. collector.cancel(); if (response == null) { throw new XMPPException("No response from server on status set."); } if (response.getError() != null) { return sendSimpleSearchForm(con, searchForm, searchService); } return ReportedData.getReportedDataFrom(response); }
/** * Sends the filled out answer form to be sent and queried by the search service. * * @param con the current Connection. * @param searchForm the <code>Form</code> to send for querying. * @param searchService the search service to use. (ex. search.jivesoftware.com) * @return ReportedData the data found from the query. * @throws org.jivesoftware.smack.XMPPException * thrown if a server error has occurred. */ public ReportedData sendSearchForm(Connection con, Form searchForm, String searchService) throws XMPPException { UserSearch search = new UserSearch(); search.setType(IQ.Type.SET); search.setTo(searchService); search.addExtension(searchForm.getDataFormToSend()); PacketCollector collector = con.createPacketCollector(new PacketIDFilter(search.getPacketID())); con.sendPacket(search); IQ response = (IQ) collector.nextResult(SmackConfiguration.getPacketReplyTimeout()); // Cancel the collector. collector.cancel(); if (response == null) { throw new XMPPException("No response from server on status set."); } if (response.getError() != null) { return sendSimpleSearchForm(con, searchForm, searchService); } return ReportedData.getReportedDataFrom(response); }