mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-10 17:49:38 +02:00
SMACK-279: The XMPPConnection extends the new abstract Connection class
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@11613 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
11a41e79ca
commit
127319a821
102 changed files with 1420 additions and 1194 deletions
|
@ -18,7 +18,7 @@ package org.jivesoftware.smackx.search;
|
|||
|
||||
import org.jivesoftware.smack.PacketCollector;
|
||||
import org.jivesoftware.smack.SmackConfiguration;
|
||||
import org.jivesoftware.smack.XMPPConnection;
|
||||
import org.jivesoftware.smack.Connection;
|
||||
import org.jivesoftware.smack.XMPPException;
|
||||
import org.jivesoftware.smack.filter.PacketIDFilter;
|
||||
import org.jivesoftware.smack.packet.IQ;
|
||||
|
@ -59,13 +59,13 @@ public class UserSearch extends IQ {
|
|||
/**
|
||||
* Returns the form for all search fields supported by the search service.
|
||||
*
|
||||
* @param con the current XMPPConnection.
|
||||
* @param con the current Connection.
|
||||
* @param searchService the search service to use. (ex. search.jivesoftware.com)
|
||||
* @return the search form received by the server.
|
||||
* @throws org.jivesoftware.smack.XMPPException
|
||||
* thrown if a server error has occurred.
|
||||
*/
|
||||
public Form getSearchForm(XMPPConnection con, String searchService) throws XMPPException {
|
||||
public Form getSearchForm(Connection con, String searchService) throws XMPPException {
|
||||
UserSearch search = new UserSearch();
|
||||
search.setType(IQ.Type.GET);
|
||||
search.setTo(searchService);
|
||||
|
@ -89,14 +89,14 @@ public class UserSearch extends IQ {
|
|||
/**
|
||||
* Sends the filled out answer form to be sent and queried by the search service.
|
||||
*
|
||||
* @param con the current XMPPConnection.
|
||||
* @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(XMPPConnection con, Form searchForm, String searchService) throws XMPPException {
|
||||
public ReportedData sendSearchForm(Connection con, Form searchForm, String searchService) throws XMPPException {
|
||||
UserSearch search = new UserSearch();
|
||||
search.setType(IQ.Type.SET);
|
||||
search.setTo(searchService);
|
||||
|
@ -124,14 +124,14 @@ public class UserSearch extends IQ {
|
|||
/**
|
||||
* Sends the filled out answer form to be sent and queried by the search service.
|
||||
*
|
||||
* @param con the current XMPPConnection.
|
||||
* @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 sendSimpleSearchForm(XMPPConnection con, Form searchForm, String searchService) throws XMPPException {
|
||||
public ReportedData sendSimpleSearchForm(Connection con, Form searchForm, String searchService) throws XMPPException {
|
||||
SimpleUserSearch search = new SimpleUserSearch();
|
||||
search.setForm(searchForm);
|
||||
search.setType(IQ.Type.SET);
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
package org.jivesoftware.smackx.search;
|
||||
|
||||
import org.jivesoftware.smack.XMPPConnection;
|
||||
import org.jivesoftware.smack.Connection;
|
||||
import org.jivesoftware.smack.XMPPException;
|
||||
import org.jivesoftware.smackx.Form;
|
||||
import org.jivesoftware.smackx.ReportedData;
|
||||
|
@ -35,7 +35,7 @@ import java.util.List;
|
|||
* searching (DataForms or No DataForms), but allows the user to simply use the DataForm model for both
|
||||
* types of support.
|
||||
* <pre>
|
||||
* XMPPConnection con = new XMPPConnection("jabber.org");
|
||||
* Connection con = new XMPPConnection("jabber.org");
|
||||
* con.login("john", "doe");
|
||||
* UserSearchManager search = new UserSearchManager(con, "users.jabber.org");
|
||||
* Form searchForm = search.getSearchForm();
|
||||
|
@ -49,15 +49,15 @@ import java.util.List;
|
|||
*/
|
||||
public class UserSearchManager {
|
||||
|
||||
private XMPPConnection con;
|
||||
private Connection con;
|
||||
private UserSearch userSearch;
|
||||
|
||||
/**
|
||||
* Creates a new UserSearchManager.
|
||||
*
|
||||
* @param con the XMPPConnection to use.
|
||||
* @param con the Connection to use.
|
||||
*/
|
||||
public UserSearchManager(XMPPConnection con) {
|
||||
public UserSearchManager(Connection con) {
|
||||
this.con = con;
|
||||
userSearch = new UserSearch();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue