1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-09-10 17:49:38 +02:00

Commiting UserSearch

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@2855 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Derek DeMoro 2005-09-20 21:02:30 +00:00 committed by derek
parent c9342aa169
commit a5991bfa94
4 changed files with 24 additions and 8 deletions

View file

@ -44,28 +44,26 @@ import java.util.List;
public class UserSearchManager {
private XMPPConnection con;
private String searchService;
private UserSearch userSearch;
/**
* Creates a new UserSearchManager.
*
* @param con the XMPPConnection to use.
* @param searchService the name of the search service. (ex. search.jivesoftware.com)
*/
public UserSearchManager(XMPPConnection con, String searchService) {
public UserSearchManager(XMPPConnection con) {
this.con = con;
this.searchService = searchService;
userSearch = new UserSearch();
}
/**
* Returns the form to fill out to perform a search.
*
* @param searchService the search service to query.
* @return the form to fill out to perform a search.
* @throws XMPPException thrown if a server error has occurred.
*/
public Form getSearchForm() throws XMPPException {
public Form getSearchForm(String searchService) throws XMPPException {
return userSearch.getSearchForm(con, searchService);
}
@ -74,13 +72,15 @@ public class UserSearchManager {
* in the form of <code>ReportedData</code>
*
* @param searchForm the <code>Form</code> to submit for searching.
* @param searchService the name of the search service to use.
* @return the ReportedData returned by the server.
* @throws XMPPException thrown if a server error has occurred.
*/
public ReportedData getSearchResults(Form searchForm) throws XMPPException {
public ReportedData getSearchResults(Form searchForm, String searchService) throws XMPPException {
return userSearch.sendSearchForm(con, searchForm, searchService);
}
/**
* Returns a collection of search services found on the server.
*
@ -100,4 +100,5 @@ public class UserSearchManager {
}
return searchServices;
}
}