Package org.jivesoftware.smackx.workgroup.ext.notes

Examples of org.jivesoftware.smackx.workgroup.ext.notes.ChatNotes


     */
    public void setNote(String sessionID, String note) throws XMPPException {
        note = ChatNotes.replace(note, "\n", "\\n");
        note = StringUtils.escapeForXML(note);

        ChatNotes notes = new ChatNotes();
        notes.setType(IQ.Type.SET);
        notes.setTo(workgroupJID);
        notes.setSessionID(sessionID);
        notes.setNotes(note);
        PacketCollector collector = connection.createPacketCollector(new PacketIDFilter(notes.getPacketID()));
        // Send the request
        connection.sendPacket(notes);

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

View Full Code Here


     * @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;

    }
View Full Code Here

     */
    public void setNote(String sessionID, String note) throws XMPPException {
        note = ChatNotes.replace(note, "\n", "\\n");
        note = StringUtils.escapeForXML(note);

        ChatNotes notes = new ChatNotes();
        notes.setType(IQ.Type.SET);
        notes.setTo(workgroupJID);
        notes.setSessionID(sessionID);
        notes.setNotes(note);
        PacketCollector collector = connection.createPacketCollector(new PacketIDFilter(notes.getPacketID()));
        // Send the request
        connection.sendPacket(notes);

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

View Full Code Here

     * @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;

    }
View Full Code Here

     */
    public void setNote(String sessionID, String note) throws XMPPException {
        note = ChatNotes.replace(note, "\n", "\\n");
        note = StringUtils.escapeForXML(note);

        ChatNotes notes = new ChatNotes();
        notes.setType(IQ.Type.SET);
        notes.setTo(workgroupJID);
        notes.setSessionID(sessionID);
        notes.setNotes(note);
        PacketCollector collector = connection.createPacketCollector(new PacketIDFilter(notes.getPacketID()));
        // Send the request
        connection.sendPacket(notes);

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

View Full Code Here

     * @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;

    }
View Full Code Here

TOP

Related Classes of org.jivesoftware.smackx.workgroup.ext.notes.ChatNotes

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.