* @param sessionID the sessionID of the chat session.
* @return the <code>ChatNote</code> associated with a given chat session.
* @throws XMPPException if an error occurs while retrieving the ChatNote.
*/
public ChatNotes getNote(String sessionID) throws XMPPException {
ChatNotes request = new ChatNotes();
request.setType(IQ.Type.GET);
request.setTo(workgroupJID);
request.setSessionID(sessionID);
PacketCollector collector = connection.createPacketCollector(new PacketIDFilter(request.getPacketID()));
connection.sendPacket(request);
ChatNotes response = (ChatNotes)collector.nextResult(SmackConfiguration.getPacketReplyTimeout());
// Cancel the collector.
collector.cancel();
if (response == null) {
throw new XMPPException("No response from server.");
}
if (response.getError() != null) {
throw new XMPPException(response.getError());
}
return response;
}