Class UserSearch

java.lang.Object
org.jivesoftware.smack.packet.Stanza
org.jivesoftware.smack.packet.IQ
org.jivesoftware.smack.packet.SimpleIQ
org.jivesoftware.smackx.search.UserSearch
All Implemented Interfaces:
org.jivesoftware.smack.packet.Element, org.jivesoftware.smack.packet.IqView, org.jivesoftware.smack.packet.NamedElement, org.jivesoftware.smack.packet.StanzaView, org.jivesoftware.smack.packet.TopLevelStreamElement, org.jivesoftware.smack.packet.XmlElement, org.jivesoftware.smack.packet.XmlLangElement

public class UserSearch extends org.jivesoftware.smack.packet.SimpleIQ
Implements the protocol currently used to search information repositories on the Jabber network. To date, the jabber:iq:search protocol has been used mainly to search for people who have registered with user directories (e.g., the "Jabber User Directory" hosted at users.jabber.org). However, the jabber:iq:search protocol is not limited to user directories, and could be used to search other Jabber information repositories (such as chatroom directories) or even to provide a Jabber interface to conventional search engines. The basic functionality is to query an information repository regarding the possible search fields, to send a search query, and to receive search results.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Internal Search service Provider.

    Nested classes/interfaces inherited from class org.jivesoftware.smack.packet.IQ

    org.jivesoftware.smack.packet.IQ.IQChildElementXmlStringBuilder, org.jivesoftware.smack.packet.IQ.ResponseType, org.jivesoftware.smack.packet.IQ.Type
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     

    Fields inherited from class org.jivesoftware.smack.packet.IQ

    IQ_ELEMENT, QUERY_ELEMENT

    Fields inherited from class org.jivesoftware.smack.packet.Stanza

    DEFAULT_LANGUAGE, ITEM, language, TEXT
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new instance of UserSearch.
  • Method Summary

    Modifier and Type
    Method
    Description
    getSearchForm(org.jivesoftware.smack.XMPPConnection con, org.jxmpp.jid.DomainBareJid searchService)
    Returns the form for all search fields supported by the search service.
    sendSearchForm(org.jivesoftware.smack.XMPPConnection con, DataForm searchForm, org.jxmpp.jid.DomainBareJid searchService)
    Sends the filled out answer form to be sent and queried by the search service.
    sendSimpleSearchForm(org.jivesoftware.smack.XMPPConnection con, DataForm searchForm, org.jxmpp.jid.DomainBareJid searchService)
    Sends the filled out answer form to be sent and queried by the search service.

    Methods inherited from class org.jivesoftware.smack.packet.SimpleIQ

    getIQChildElementBuilder

    Methods inherited from class org.jivesoftware.smack.packet.IQ

    createErrorResponse, createErrorResponse, createResultIQ, getChildElementName, getChildElementNamespace, getChildElementQName, getChildElementXML, getElementName, getType, setType, toString, toXML

    Methods inherited from class org.jivesoftware.smack.packet.Stanza

    addCommonAttributes, addExtension, addExtensions, appendErrorIfExists, getDefaultLanguage, getError, getExtension, getExtension, getExtensionElement, getExtensions, getExtensions, getExtensions, getExtensions, getExtensionsMap, getFrom, getLanguage, getNamespace, getStanzaId, getTo, hasExtension, hasExtension, hasStanzaIdSet, logCommonAttributes, overrideExtension, removeExtension, setError, setFrom, setNewStanzaId, setStanzaId, setTo, throwIfNoStanzaId

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.jivesoftware.smack.packet.Element

    toXML, toXML

    Methods inherited from interface org.jivesoftware.smack.packet.IqView

    isRequestIQ, isResponseIQ

    Methods inherited from interface org.jivesoftware.smack.packet.StanzaView

    getError, getExtension, getExtension, getExtensions, getExtensions, getExtensions, getFrom, getStanzaId, getTo, hasExtension, hasExtension, hasExtension

    Methods inherited from interface org.jivesoftware.smack.packet.XmlElement

    getQName
  • Field Details

  • Constructor Details

    • UserSearch

      public UserSearch()
      Creates a new instance of UserSearch.
  • Method Details

    • getSearchForm

      public DataForm getSearchForm(org.jivesoftware.smack.XMPPConnection con, org.jxmpp.jid.DomainBareJid searchService) throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, InterruptedException
      Returns the form for all search fields supported by the search service.
      Parameters:
      con - the current XMPPConnection.
      searchService - the search service to use. (ex. search.jivesoftware.com)
      Returns:
      the search form received 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.
      InterruptedException - if the calling thread was interrupted.
    • sendSearchForm

      public ReportedData sendSearchForm(org.jivesoftware.smack.XMPPConnection con, DataForm searchForm, org.jxmpp.jid.DomainBareJid searchService) throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, InterruptedException
      Sends the filled out answer form to be sent and queried by the search service.
      Parameters:
      con - the current XMPPConnection.
      searchForm - the Form to send for querying.
      searchService - the search service to use. (ex. search.jivesoftware.com)
      Returns:
      ReportedData the data found from the query.
      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.
      InterruptedException - if the calling thread was interrupted.
    • sendSimpleSearchForm

      public ReportedData sendSimpleSearchForm(org.jivesoftware.smack.XMPPConnection con, DataForm searchForm, org.jxmpp.jid.DomainBareJid searchService) throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, InterruptedException
      Sends the filled out answer form to be sent and queried by the search service.
      Parameters:
      con - the current XMPPConnection.
      searchForm - the Form to send for querying.
      searchService - the search service to use. (ex. search.jivesoftware.com)
      Returns:
      ReportedData the data found from the query.
      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.
      InterruptedException - if the calling thread was interrupted.