当前位置: 首页>>代码示例>>Java>>正文


Java ReportedData.getReportedDataFrom方法代码示例

本文整理汇总了Java中org.jivesoftware.smackx.ReportedData.getReportedDataFrom方法的典型用法代码示例。如果您正苦于以下问题:Java ReportedData.getReportedDataFrom方法的具体用法?Java ReportedData.getReportedDataFrom怎么用?Java ReportedData.getReportedDataFrom使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jivesoftware.smackx.ReportedData的用法示例。


在下文中一共展示了ReportedData.getReportedDataFrom方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: submitSearch

import org.jivesoftware.smackx.ReportedData; //导入方法依赖的package包/类
/**
 * Submits the completed form and returns the result of the transcript search. The result
 * will include all the data returned from the server so be careful with the amount of
 * data that the search may return.
 *
 * @param serviceJID    the address of the workgroup service.
 * @param completedForm the filled out search form.
 * @return the result of the transcript search.
 * @throws XMPPException if an error occurs while submiting the search to the server.
 */
public ReportedData submitSearch(String serviceJID, Form completedForm) throws XMPPException {
    TranscriptSearch search = new TranscriptSearch();
    search.setType(IQ.Type.GET);
    search.setTo(serviceJID);
    search.addExtension(completedForm.getDataFormToSend());

    PacketCollector collector = connection.createPacketCollector(new PacketIDFilter(search.getPacketID()));
    connection.sendPacket(search);

    TranscriptSearch response = (TranscriptSearch) collector.nextResult(SmackConfiguration.getPacketReplyTimeout());

    // Cancel the collector.
    collector.cancel();
    if (response == null) {
        throw new XMPPException("No response from server on status set.");
    }
    if (response.getError() != null) {
        throw new XMPPException(response.getError());
    }
    return ReportedData.getReportedDataFrom(response);
}
 
开发者ID:ice-coffee,项目名称:EIM,代码行数:32,代码来源:TranscriptSearchManager.java

示例2: sendSearchForm

import org.jivesoftware.smackx.ReportedData; //导入方法依赖的package包/类
/**
 * Sends the filled out answer form to be sent and queried by the search service.
 *
 * @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(Connection con, Form searchForm, String searchService) throws XMPPException {
    UserSearch search = new UserSearch();
    search.setType(IQ.Type.SET);
    search.setTo(searchService);
    search.addExtension(searchForm.getDataFormToSend());

    PacketCollector collector = con.createPacketCollector(new PacketIDFilter(search.getPacketID()));

    con.sendPacket(search);

    IQ response = (IQ) collector.nextResult(SmackConfiguration.getPacketReplyTimeout());

    // Cancel the collector.
    collector.cancel();
    if (response == null) {
        throw new XMPPException("No response from server on status set.");
    }
    if (response.getError() != null) {
        return sendSimpleSearchForm(con, searchForm, searchService);
    }


    return ReportedData.getReportedDataFrom(response);
}
 
开发者ID:ice-coffee,项目名称:EIM,代码行数:35,代码来源:UserSearch.java

示例3: submitSearch

import org.jivesoftware.smackx.ReportedData; //导入方法依赖的package包/类
/**
 * Submits the completed form and returns the result of the transcript
 * search. The result will include all the data returned from the server so
 * be careful with the amount of data that the search may return.
 * 
 * @param serviceJID
 *            the address of the workgroup service.
 * @param completedForm
 *            the filled out search form.
 * @return the result of the transcript search.
 * @throws XMPPException
 *             if an error occurs while submiting the search to the server.
 */
public ReportedData submitSearch(String serviceJID, Form completedForm)
		throws XMPPException {
	TranscriptSearch search = new TranscriptSearch();
	search.setType(IQ.Type.GET);
	search.setTo(serviceJID);
	search.addExtension(completedForm.getDataFormToSend());

	PacketCollector collector = connection
			.createPacketCollector(new PacketIDFilter(search.getPacketID()));
	connection.sendPacket(search);

	TranscriptSearch response = (TranscriptSearch) collector
			.nextResult(SmackConfiguration.getPacketReplyTimeout());

	// Cancel the collector.
	collector.cancel();
	if (response == null) {
		throw new XMPPException("No response from server on status set.");
	}
	if (response.getError() != null) {
		throw new XMPPException(response.getError());
	}
	return ReportedData.getReportedDataFrom(response);
}
 
开发者ID:ikantech,项目名称:xmppsupport_v2,代码行数:38,代码来源:TranscriptSearchManager.java

示例4: sendSearchForm

import org.jivesoftware.smackx.ReportedData; //导入方法依赖的package包/类
/**
 * Sends the filled out answer form to be sent and queried by the search
 * service.
 * 
 * @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(Connection con, Form searchForm,
		String searchService) throws XMPPException {
	UserSearch search = new UserSearch();
	search.setType(IQ.Type.SET);
	search.setTo(searchService);
	search.addExtension(searchForm.getDataFormToSend());

	PacketCollector collector = con
			.createPacketCollector(new PacketIDFilter(search.getPacketID()));

	con.sendPacket(search);

	IQ response = (IQ) collector.nextResult(SmackConfiguration
			.getPacketReplyTimeout());

	// Cancel the collector.
	collector.cancel();
	if (response == null) {
		throw new XMPPException("No response from server on status set.");
	}
	if (response.getError() != null) {
		return sendSimpleSearchForm(con, searchForm, searchService);
	}

	return ReportedData.getReportedDataFrom(response);
}
 
开发者ID:ikantech,项目名称:xmppsupport_v2,代码行数:41,代码来源:UserSearch.java


注:本文中的org.jivesoftware.smackx.ReportedData.getReportedDataFrom方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。