Package org.jivesoftware.smack

Examples of org.jivesoftware.smack.XMPPException


        IQ result = (IQ) collector.nextResult(timeout);
        collector.cancel();

        if (result == null || result.getType() == IQ.Type.ERROR) {
            if(result != null && result.getError() != null) {
                throw new XMPPException(result.getError());
            }
            throw new XMPPException("File transfer could not be initiated.");
        }

        IBBChunk chunk = null;
        int seq = 0;
        while ((chunk = readChunk()) != null) {
View Full Code Here


        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) {
          throw new XMPPException("Error . Cause: "+response.getError().getMessage());
        } else if (response.getType() == IQ.Type.ERROR) {
          System.out.println("could not create user....");
          throw new XMPPException("Error . Cause: "+response.getError().getMessage());
        }
        if (response instanceof SessionCount) {
          SessionCount sCount = (SessionCount) response;
          System.out.println("number of sessions: "+sCount.getNumberOfSessions());
        }
View Full Code Here

            return room;
        }

        Iterator<String> iterator = MultiUserChat.getServiceNames(connection).iterator();
        if (!iterator.hasNext()) {
            throw new XMPPException("Cannot find Multi User Chat service on connection: " + getConnectionMessage(connection));
        }

        String chatServer = iterator.next();
        if (LOG.isDebugEnabled()) {
            LOG.debug("Detected chat server: " + chatServer);
View Full Code Here

            return room;
        }

        Iterator<String> iterator = MultiUserChat.getServiceNames(connection).iterator();
        if (!iterator.hasNext()) {
            throw new XMPPException("Cannot find Multi User Chat service on connection: " + getConnectionMessage(connection));
        }

        String chatServer = iterator.next();
        if (LOG.isDebugEnabled()) {
            LOG.debug("Detected chat server: " + chatServer);
View Full Code Here

          Throwable t = e.getCause();
          String msg = "Error retrieving VCard";
          if(t != null)
            t = t.getCause();
          if(t != null && t instanceof XMPPException) {
            XMPPException x = (XMPPException)t;
            if(x.getXMPPError()!=null) {
              msg = msg + " - " + x.getXMPPError().getCode() + " " + JabberErrorConditionMapping.getMeaning(x.getXMPPError().getCode());
              if(x.getXMPPError().getMessage() != null)
                msg = msg + ": " + x.getXMPPError().getMessage();
            }
          }
          setMessage(msg,WARNING);
//          throw new RuntimeException(msg,e);
        }
View Full Code Here

        VCard result = null;
        try {
            result = (VCard) collector.nextResult(SmackConfiguration.getPacketReplyTimeout());

            if (result == null) {
                throw new XMPPException(new XMPPError(408, "Timeout getting VCard information"));
            }
            if (result.getError() != null) {
                throw new XMPPException(result.getError());
            }
        }
        catch (ClassCastException e) {
            System.out.println("No VCard for " + user);
        }
View Full Code Here

          // 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.");
          }
          if (result.getType() == IQ.Type.ERROR) {
              throw new XMPPException(result.getError());
          }

      return (BrowseIQ)result;
    }
View Full Code Here

    IQ result = (IQ) collector.nextResult(SmackConfiguration
        .getPacketReplyTimeout());
    // Stop queuing results
    collector.cancel();
        if (result == null) {
            throw new XMPPException("No response from server.");
        }
        else if (result.getType() == IQ.Type.ERROR) {
            throw new XMPPException(result.getError());
        }
    return result;
  }
View Full Code Here

     */
    public void startSession(
        HashMap<IProject, List<IResource>> projectResourcesMapping)
        throws XMPPException {
        if (!saros.getSarosNet().isConnected()) {
            throw new XMPPException(Messages.SarosSessionManager_no_connection);
        }

        this.sessionID.setValue(String.valueOf(sessionRandom
            .nextInt(Integer.MAX_VALUE)));

View Full Code Here

            // Server does not support JEP-33 so try to send the packet to each recipient
            if (noReply || (replyTo != null && replyTo.trim().length() > 0) ||
                    (replyRoom != null && replyRoom.trim().length() > 0)) {
                // Some specified JEP-33 features were requested so throw an exception alerting
                // the user that this features are not available
                throw new XMPPException("Extended Stanza Addressing not supported by server");
            }
            // Send the packet to each individual recipient
            sendToIndividualRecipients(connection, packet, to, cc, bcc);
        }
    }
View Full Code Here

TOP

Related Classes of org.jivesoftware.smack.XMPPException

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.