Package org.jivesoftware.smackx.search
Class UserSearchManager
- java.lang.Object
-
- org.jivesoftware.smackx.search.UserSearchManager
-
public class UserSearchManager extends java.lang.Object
The UserSearchManager is a facade built upon Jabber Search Services (XEP-055) to allow for searching repositories on a Jabber Server. This implementation allows for transparency of implementation of searching (DataForms or No DataForms), but allows the user to simply use the DataForm model for both types of support.XMPPConnection con = new XMPPTCPConnection("jabber.org"); con.login("john", "doe"); UserSearchManager search = new UserSearchManager(con, "users.jabber.org"); Form searchForm = search.getSearchForm(); FillableForm answerForm = searchForm.getFillableForm() // Fill out the form. answerForm.setAnswer("last", "DeMoro"); ReportedData data = search.getSearchResults(answerForm); // Use Returned Data
-
-
Constructor Summary
Constructors Constructor Description UserSearchManager(org.jivesoftware.smack.XMPPConnection con)
Creates a new UserSearchManager.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Form
getSearchForm(org.jxmpp.jid.DomainBareJid searchService)
Returns the form to fill out to perform a search.ReportedData
getSearchResults(FillableForm searchForm, org.jxmpp.jid.DomainBareJid searchService)
Submits a search form to the server and returns the resulting information in the form ofReportedData
.java.util.List<org.jxmpp.jid.DomainBareJid>
getSearchServices()
Returns a collection of search services found on the server.
-
-
-
Method Detail
-
getSearchForm
public Form getSearchForm(org.jxmpp.jid.DomainBareJid searchService) throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
Returns the form to fill out to perform a search.- Parameters:
searchService
- the search service to query.- Returns:
- the form to fill out to perform a search.
- Throws:
org.jivesoftware.smack.XMPPException.XMPPErrorException
- if there was an XMPP error returned.org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the remote entity.org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.java.lang.InterruptedException
- if the calling thread was interrupted.
-
getSearchResults
public ReportedData getSearchResults(FillableForm searchForm, org.jxmpp.jid.DomainBareJid searchService) throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
Submits a search form to the server and returns the resulting information in the form ofReportedData
.- Parameters:
searchForm
- theForm
to submit for searching.searchService
- the name of the search service to use.- Returns:
- the ReportedData returned by the server.
- Throws:
org.jivesoftware.smack.XMPPException.XMPPErrorException
- if there was an XMPP error returned.org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the remote entity.org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.java.lang.InterruptedException
- if the calling thread was interrupted.
-
getSearchServices
public java.util.List<org.jxmpp.jid.DomainBareJid> getSearchServices() throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
Returns a collection of search services found on the server.- Returns:
- a Collection of search services found on the server.
- Throws:
org.jivesoftware.smack.XMPPException.XMPPErrorException
- if there was an XMPP error returned.org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the remote entity.org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.java.lang.InterruptedException
- if the calling thread was interrupted.
-
-