/** * 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 XMPPErrorException * @throws NoResponseException * @throws NotConnectedException * @throws InterruptedException */ public ReportedData sendSearchForm(XMPPConnection con, Form searchForm, DomainBareJid searchService) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { UserSearch search = new UserSearch(); search.setType(IQ.Type.set); search.setTo(searchService); search.addExtension(searchForm.getDataFormToSend()); IQ response = con.createStanzaCollectorAndSend(search).nextResultOrThrow(); return ReportedData.getReportedDataFrom(response); }
/** * Submits the completed form and returns the result of the transcript search. The result * will include all the data returned from the server so be careful with the amount of * data that the search may return. * * @param serviceJID the address of the workgroup service. * @param completedForm the filled out search form. * @return the result of the transcript search. * @throws XMPPErrorException * @throws NoResponseException * @throws NotConnectedException * @throws InterruptedException */ public ReportedData submitSearch(DomainBareJid serviceJID, Form completedForm) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { TranscriptSearch search = new TranscriptSearch(); search.setType(IQ.Type.get); search.setTo(serviceJID); search.addExtension(completedForm.getDataFormToSend()); TranscriptSearch response = connection.createStanzaCollectorAndSend( search).nextResultOrThrow(); return ReportedData.getReportedDataFrom(response); } }