Class 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 of ReportedData.
      java.util.List<org.jxmpp.jid.DomainBareJid> getSearchServices()
      Returns a collection of search services found on the server.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • UserSearchManager

        public UserSearchManager​(org.jivesoftware.smack.XMPPConnection con)
        Creates a new UserSearchManager.
        Parameters:
        con - the XMPPConnection to use.
    • 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 of ReportedData.
        Parameters:
        searchForm - the Form 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.