Examples of nextResult()


Examples of org.jivesoftware.smack.PacketCollector.nextResult()

            connection.createPacketCollector(new PacketIDFilter(info.getPacketID()));

        connection.sendPacket(info);

        // Wait up to 5 seconds for a result.
        IQ result = (IQ) collector.nextResult(SmackConfiguration.getPacketReplyTimeout());
        // Stop queuing results
        collector.cancel();
        if (result == null) {
            throw new XMPPException("No response from the server.");
        }
View Full Code Here

Examples of org.jivesoftware.smack.PacketCollector.nextResult()

                return protocol.getResponses().poll();
            }
        };

        // mock nextResult method
        when(collector.nextResult(anyInt())).thenAnswer(answer);
        when(collector.nextResult()).thenAnswer(answer);

        // initialize service discovery manager for this connection
        new ServiceDiscoveryManager(connection);
View Full Code Here

Examples of org.jivesoftware.smack.PacketCollector.nextResult()

            }
        };

        // mock nextResult method
        when(collector.nextResult(anyInt())).thenAnswer(answer);
        when(collector.nextResult()).thenAnswer(answer);

        // initialize service discovery manager for this connection
        new ServiceDiscoveryManager(connection);

        return connection;
View Full Code Here

Examples of org.jivesoftware.smack.PacketCollector.nextResult()

        try {
            // Send the message with the form to fill out
            chat.sendMessage(msg);

            // Get the message with the form to fill out
            Message msg2 = (Message)collector2.nextResult(2000);
            assertNotNull("Messge not found", msg2);
            // Retrieve the form to fill out
            Form formToRespond = Form.getFormFrom(msg2);
            assertNotNull(formToRespond);
            assertNotNull(formToRespond.getField("name"));
View Full Code Here

Examples of org.jivesoftware.smack.PacketCollector.nextResult()

        open.setTo(targetConnection.getUser());

        PacketCollector collector = initiatorConnection.createPacketCollector(new PacketIDFilter(
                        open.getPacketID()));
        initiatorConnection.sendPacket(open);
        Packet result = collector.nextResult();

        assertNotNull(result.getError());
        assertEquals(XMPPError.Condition.no_acceptable.toString(), result.getError().getCondition());

    }
View Full Code Here

Examples of org.jivesoftware.smack.PacketCollector.nextResult()

        search.setTo(searchService);

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

Examples of org.jivesoftware.smack.PacketCollector.nextResult()

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

Examples of org.jivesoftware.smack.PacketCollector.nextResult()

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

Examples of org.jivesoftware.smack.PacketCollector.nextResult()

        } else if (answer.getError() != null) {
            throw new XMPPException(answer.getError());
        }

        // Collect the received offline messages
        Message message = (Message) messageCollector.nextResult(
                SmackConfiguration.getPacketReplyTimeout());
        while (message != null) {
            messages.add(message);
            message =
                    (Message) messageCollector.nextResult(
View Full Code Here

Examples of org.jivesoftware.smack.PacketCollector.nextResult()

        Message message = (Message) messageCollector.nextResult(
                SmackConfiguration.getPacketReplyTimeout());
        while (message != null) {
            messages.add(message);
            message =
                    (Message) messageCollector.nextResult(
                            SmackConfiguration.getPacketReplyTimeout());
        }
        // Stop queuing offline messages
        messageCollector.cancel();
        return messages.iterator();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.