Package org.jivesoftware.smack.filter

Examples of org.jivesoftware.smack.filter.PacketIDFilter


        TranscriptSearch search = new TranscriptSearch();
        search.setType(IQ.Type.GET);
        search.setTo(serviceJID);

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

        TranscriptSearch response = (TranscriptSearch) collector.nextResult(
                SmackConfiguration.getPacketReplyTimeout());
View Full Code Here


        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.
View Full Code Here

     * @throws XMPPException if an error occurs while getting the information.
     */
    public Transcript getTranscript(String workgroupJID, String sessionID) throws XMPPException {
        Transcript request = new Transcript(sessionID);
        request.setTo(workgroupJID);
        PacketCollector collector = connection.createPacketCollector(new PacketIDFilter(request.getPacketID()));
        // Send the request
        connection.sendPacket(request);

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

View Full Code Here

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

View Full Code Here

        MUCOwner iq = new MUCOwner();
        iq.setTo(room);
        iq.setType(IQ.Type.GET);

        // Filter packets looking for an answer from the server.
        PacketFilter responseFilter = new PacketIDFilter(iq.getPacketID());
        PacketCollector response = connection.createPacketCollector(responseFilter);
        // Request the configuration form to the server.
        connection.sendPacket(iq);
        // Wait up to a certain number of seconds for a reply.
        IQ answer = (IQ) response.nextResult(SmackConfiguration.getPacketReplyTimeout());
View Full Code Here

        iq.setTo(room);
        iq.setType(IQ.Type.SET);
        iq.addExtension(form.getDataFormToSend());

        // Filter packets looking for an answer from the server.
        PacketFilter responseFilter = new PacketIDFilter(iq.getPacketID());
        PacketCollector response = connection.createPacketCollector(responseFilter);
        // Send the completed configuration form to the server.
        connection.sendPacket(iq);
        // Wait up to a certain number of seconds for a reply.
        IQ answer = (IQ) response.nextResult(SmackConfiguration.getPacketReplyTimeout());
View Full Code Here

        Registration reg = new Registration();
        reg.setType(IQ.Type.GET);
        reg.setTo(room);

        PacketFilter filter =
            new AndFilter(new PacketIDFilter(reg.getPacketID()), new PacketTypeFilter(IQ.class));
        PacketCollector collector = connection.createPacketCollector(filter);
        connection.sendPacket(reg);
        IQ result = (IQ) collector.nextResult(SmackConfiguration.getPacketReplyTimeout());
        collector.cancel();
        if (result == null) {
View Full Code Here

        reg.setType(IQ.Type.SET);
        reg.setTo(room);
        reg.addExtension(form.getDataFormToSend());

        PacketFilter filter =
            new AndFilter(new PacketIDFilter(reg.getPacketID()), new PacketTypeFilter(IQ.class));
        PacketCollector collector = connection.createPacketCollector(filter);
        connection.sendPacket(reg);
        IQ result = (IQ) collector.nextResult(SmackConfiguration.getPacketReplyTimeout());
        collector.cancel();
        if (result == null) {
View Full Code Here

        destroy.setReason(reason);
        destroy.setJid(alternateJID);
        iq.setDestroy(destroy);

        // Wait for a presence packet back from the server.
        PacketFilter responseFilter = new PacketIDFilter(iq.getPacketID());
        PacketCollector response = connection.createPacketCollector(responseFilter);
        // Send the room destruction request.
        connection.sendPacket(iq);
        // Wait up to a certain number of seconds for a reply.
        IQ answer = (IQ) response.nextResult(SmackConfiguration.getPacketReplyTimeout());
View Full Code Here

        MUCOwner.Item item = new MUCOwner.Item(affiliation);
        item.setJid(jid);
        iq.addItem(item);

        // Wait for a response packet back from the server.
        PacketFilter responseFilter = new PacketIDFilter(iq.getPacketID());
        PacketCollector response = connection.createPacketCollector(responseFilter);
        // Send the change request to the server.
        connection.sendPacket(iq);
        // Wait up to a certain number of seconds for a reply.
        IQ answer = (IQ) response.nextResult(SmackConfiguration.getPacketReplyTimeout());
View Full Code Here

TOP

Related Classes of org.jivesoftware.smack.filter.PacketIDFilter

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.