/**
 * $RCSfile: ,v $
 * $Revision: $
 * $Date:  $
 *
 * Copyright (C) 1999-2005 Jive Software. All rights reserved.
 *
 * This software is the proprietary information of Jive Software.
 * Use is subject to license terms.
 */
package org.jivesoftware.smackx.search;

import org.jivesoftware.smack.XMPPConnection;
import org.jivesoftware.smack.XMPPException;
import org.jivesoftware.smackx.Form;
import org.jivesoftware.smackx.ReportedData;

public class UserSearchManager {

    private XMPPConnection con;
    private String serviceName;
    private UserSearch userSearch;

    public UserSearchManager(XMPPConnection con, String serviceName) {
        this.con = con;
        this.serviceName = serviceName;

        userSearch = new UserSearch();
    }

    public Form getSearchForm() {
        try {
            return userSearch.getSearchForm(con, serviceName);
        }
        catch (XMPPException e) {
            e.printStackTrace();
        }
        return null;
    }

    public ReportedData sendSearchForm(Form searchForm) {
        ReportedData data = null;
        try {
            data = userSearch.sendSearchForm(con, searchForm, serviceName);
        }
        catch (XMPPException e) {
            e.printStackTrace();
        }

        return data;
    }

    public static void main(String args[]) throws Exception {
        XMPPConnection.DEBUG_ENABLED = true;
        XMPPConnection con = new XMPPConnection("jabber.org");
        con.login("ddman", "whocares");

        UserSearchManager manager = new UserSearchManager(con, "users.jabber.org");
        Form f = manager.getSearchForm();

        Form answers = f.createAnswerForm();
        answers.setAnswer("first", "Matt");

        ReportedData data = manager.sendSearchForm(answers);
        System.out.println(data);

    }


}

@@ -1276,540 +1276,7 @@
    %7D
-%0A%0A    public static void main(String args%5B%5D) throws Exception %7B%0A        XMPPConnection.DEBUG_ENABLED = true;%0A        XMPPConnection con = new XMPPConnection(%22jabber.org%22);%0A        con.login(%22ddman%22, %22whocares%22);%0A%0A        UserSearchManager manager = new UserSearchManager(con, %22users.jabber.org%22);%0A        Form f = manager.getSearchForm();%0A%0A        Form answers = f.createAnswerForm();%0A        answers.setAnswer(%22first%22, %22Matt%22);%0A%0A        ReportedData data = manager.sendSearchForm(answers);%0A        System.out.println(data);%0A%0A    %7D%0A%0A
 %0A%7D%0A

Remove bogus test.