Package org.jivesoftware.smack

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



        // Wait up to 5 seconds for a result.
        IQ result = (IQ) collector.nextResult(SmackConfiguration
                .getPacketReplyTimeout());
        collector.cancel();
        if( dialog.cancelled ) return;

        if (result != null && result.getType() == IQ.Type.RESULT) {
            Time t = (Time) result;
View Full Code Here


            {
                search = (Search) reply;
                returnVal = true;
            }
        }
        packetCollector.cancel();
        return returnVal;
    }

    /**
     * "Search" button handler
View Full Code Here

                    resultsTableModel.fireTableStructureChanged();
                    resultsTableModel.fireTableDataChanged();
                }
            });
        }
        packetCollector.cancel();
    }

    /**
     *  Description of the Method
     *
 
View Full Code Here

        IQ iqPacket = (IQ) iterator.next();
        iqPacket.setFrom(connection.getUser());
        PacketCollector collector = connection.createPacketCollector(new PacketIDFilter(iqPacket.getPacketID()));
        connection.sendPacket(iqPacket);
        IQ response = (IQ) collector.nextResult(SmackConfiguration.getPacketReplyTimeout());
        collector.cancel();
       
        if (response == null) {
          throw new XMPPException("No response from server on status set.");
        }
        if (response.getError() != null) {
View Full Code Here

    try {
      packet.setFrom(con.getUser());
      PacketCollector collector = con.createPacketCollector(new PacketIDFilter(packet.getPacketID()));
      con.sendPacket(packet);
      IQ response = (IQ) collector.nextResult(SmackConfiguration.getPacketReplyTimeout());
      collector.cancel();
     
      if (response == null) {
        // OLAT-5383: error happens frequently, lowering to WARN
        log.warn("Error while trying to create/delete user at IM server. Response was null!");
        return false;
View Full Code Here

    try {
      packet.setFrom(con.getUser());
      PacketCollector collector = con.createPacketCollector(new PacketIDFilter(packet.getPacketID()));
      con.sendPacket(packet);
      IQ response = (IQ) collector.nextResult(SmackConfiguration.getPacketReplyTimeout());
      collector.cancel();
     
      if (response == null) {
        log.error("Error while trying to create/delete group at IM server. Response was null! packet type: "+packet.getClass());
        return false;
      }
View Full Code Here

        IQ packet = new SessionCount();
        packet.setFrom(con.getUser());
        PacketCollector collector = con.createPacketCollector(new PacketIDFilter(packet.getPacketID()));
        con.sendPacket(packet);
        response = (SessionCount) collector.nextResult(SmackConfiguration.getPacketReplyTimeout());
        collector.cancel();
        if (response == null) {
          log.warn("Error while trying to count sessions at IM server. Response was null!");
          return sessionCount;
        }
        if (response.getError() != null) {
View Full Code Here

    try {
      packet.setFrom(con.getUser());
      PacketCollector collector = con.createPacketCollector(new PacketIDFilter(packet.getPacketID()));
      con.sendPacket(packet);
      IQ response = (IQ) collector.nextResult(SmackConfiguration.getPacketReplyTimeout());
      collector.cancel();
     
      if (response == null) {
        log.error("Error while trying to get all sessions IM server. Response was null!");
        return null;
      }
View Full Code Here

        packet.setFrom(con.getUser());
        PacketCollector collector = con.createPacketCollector(new PacketIDFilter(packet.getPacketID()));
        //TODO:gs is sending packets over one connection thread save?
        con.sendPacket(packet);
        response = (PluginVersion) collector.nextResult(SmackConfiguration.getPacketReplyTimeout());
        collector.cancel();
        if (response == null) {
          log.error("Error while trying to get version at IM server. Response was null!");
          return version;
        }
        if (response.getError() != null) {
View Full Code Here

                PacketCollector collector = con.createPacketCollector(new PacketIDFilter(testIQ.getPacketID()));
                con.sendPacket(testIQ);
                // Wait 5 seconds.
                long start = System.currentTimeMillis();
                Packet result = collector.nextResult(5000);
                collector.cancel();
                // If we got a result, continue.
                if (result != null && result.getError() == null) {
                    System.out.println(" found reader. Starting packet flood.");
                    break;
                }
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.