本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}