1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-12-14 15:01:07 +01:00

Use Jid (and subclasses) from jxmpp-jid

Fixes SMACK-634
This commit is contained in:
Florian Schmaus 2015-02-14 17:15:02 +01:00
parent 0ee2d9ed1e
commit 5bb4727c57
180 changed files with 1510 additions and 1032 deletions

View file

@ -30,6 +30,7 @@ import org.jivesoftware.smack.util.PacketParserUtils;
import org.jivesoftware.smackx.xdata.Form;
import org.jivesoftware.smackx.xdata.FormField;
import org.jivesoftware.smackx.xdata.packet.DataForm;
import org.jxmpp.jid.DomainBareJid;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
@ -66,7 +67,7 @@ public class UserSearch extends SimpleIQ {
* @throws NotConnectedException
* @throws InterruptedException
*/
public Form getSearchForm(XMPPConnection con, String searchService) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
public Form getSearchForm(XMPPConnection con, DomainBareJid searchService) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
UserSearch search = new UserSearch();
search.setType(IQ.Type.get);
search.setTo(searchService);
@ -87,7 +88,7 @@ public class UserSearch extends SimpleIQ {
* @throws NotConnectedException
* @throws InterruptedException
*/
public ReportedData sendSearchForm(XMPPConnection con, Form searchForm, String searchService) throws NoResponseException, XMPPErrorException, NotConnectedException, 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);
@ -109,7 +110,7 @@ public class UserSearch extends SimpleIQ {
* @throws NotConnectedException
* @throws InterruptedException
*/
public ReportedData sendSimpleSearchForm(XMPPConnection con, Form searchForm, String searchService) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
public ReportedData sendSimpleSearchForm(XMPPConnection con, Form searchForm, DomainBareJid searchService) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
SimpleUserSearch search = new SimpleUserSearch();
search.setForm(searchForm);
search.setType(IQ.Type.set);

View file

@ -22,6 +22,7 @@ import org.jivesoftware.smack.XMPPConnection;
import org.jivesoftware.smack.XMPPException.XMPPErrorException;
import org.jivesoftware.smackx.disco.ServiceDiscoveryManager;
import org.jivesoftware.smackx.xdata.Form;
import org.jxmpp.jid.DomainBareJid;
import java.util.List;
@ -68,7 +69,7 @@ public class UserSearchManager {
* @throws NotConnectedException
* @throws InterruptedException
*/
public Form getSearchForm(String searchService) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
public Form getSearchForm(DomainBareJid searchService) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
return userSearch.getSearchForm(con, searchService);
}
@ -84,7 +85,7 @@ public class UserSearchManager {
* @throws NotConnectedException
* @throws InterruptedException
*/
public ReportedData getSearchResults(Form searchForm, String searchService) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
public ReportedData getSearchResults(Form searchForm, DomainBareJid searchService) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
return userSearch.sendSearchForm(con, searchForm, searchService);
}
@ -98,7 +99,7 @@ public class UserSearchManager {
* @throws NotConnectedException
* @throws InterruptedException
*/
public List<String> getSearchServices() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
public List<DomainBareJid> getSearchServices() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
ServiceDiscoveryManager discoManager = ServiceDiscoveryManager.getInstanceFor(con);
return discoManager.findServices(UserSearch.NAMESPACE, false, false);
}