use of org.jivesoftware.smackx.workgroup.packet.Transcripts in project Smack by igniterealtime.
the class TranscriptManager method getTranscripts.
/**
* Returns the transcripts of a given user. The answer will contain the complete history of
* conversations that a user had.
*
* @param userID the id of the user to get his conversations.
* @param workgroupJID the JID of the workgroup that will process the request.
* @return the transcripts of a given user.
* @throws XMPPErrorException
* @throws NoResponseException
* @throws NotConnectedException
* @throws InterruptedException
*/
public Transcripts getTranscripts(Jid workgroupJID, Jid userID) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
Transcripts request = new Transcripts(userID);
request.setTo(workgroupJID);
Transcripts response = (Transcripts) connection.createStanzaCollectorAndSend(request).nextResultOrThrow();
return response;
}
use of org.jivesoftware.smackx.workgroup.packet.Transcripts in project ecf by eclipse.
the class TranscriptManager method getTranscripts.
/**
* Returns the transcripts of a given user. The answer will contain the complete history of
* conversations that a user had.
*
* @param userID the id of the user to get his conversations.
* @param workgroupJID the JID of the workgroup that will process the request.
* @return the transcripts of a given user.
* @throws XMPPException if an error occurs while getting the information.
*/
public Transcripts getTranscripts(String workgroupJID, String userID) throws XMPPException {
Transcripts request = new Transcripts(userID);
request.setTo(workgroupJID);
PacketCollector collector = connection.createPacketCollector(new PacketIDFilter(request.getPacketID()));
// Send the request
connection.sendPacket(request);
Transcripts response = (Transcripts) 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 response;
}
use of org.jivesoftware.smackx.workgroup.packet.Transcripts in project Smack by igniterealtime.
the class TranscriptManager method getTranscripts.
/**
* Returns the transcripts of a given user. The answer will contain the complete history of
* conversations that a user had.
*
* @param userID the id of the user to get his conversations.
* @param workgroupJID the JID of the workgroup that will process the request.
* @return the transcripts of a given user.
* @throws XMPPErrorException if there was an XMPP error returned.
* @throws NoResponseException if there was no response from the remote entity.
* @throws NotConnectedException if the XMPP connection is not connected.
* @throws InterruptedException if the calling thread was interrupted.
*/
public Transcripts getTranscripts(EntityBareJid workgroupJID, Jid userID) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
Transcripts request = new Transcripts(userID);
request.setTo(workgroupJID);
Transcripts response = connection.sendIqRequestAndWaitForResponse(request);
return response;
}
use of org.jivesoftware.smackx.workgroup.packet.Transcripts in project Spark by igniterealtime.
the class UserHistory method loadHistory.
public void loadHistory() {
SwingWorker transcriptThread = new SwingWorker() {
final List<TranscriptSummary> transcriptList = new ArrayList<>();
public Object construct() {
try {
Transcripts transcripts = FastpathPlugin.getAgentSession().getTranscripts(userID);
transcriptList.addAll(transcripts.getSummaries());
} catch (XMPPException | SmackException | InterruptedException e) {
Log.error("Error getting transcripts.", e);
}
transcriptList.sort(timeComparator);
return transcriptList;
}
public void finished() {
init(transcriptList);
}
};
transcriptThread.start();
}
Aggregations