Examples of XMPPException


Examples of org.jivesoftware.smack.XMPPException

            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

Examples of org.jivesoftware.smack.XMPPException

          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

Examples of org.jivesoftware.smack.XMPPException

        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

Examples of org.jivesoftware.smack.XMPPException

          // 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

Examples of org.jivesoftware.smack.XMPPException

    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

Examples of org.jivesoftware.smack.XMPPException

     */
    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

Examples of org.jivesoftware.smack.XMPPException

            // 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

Examples of org.jivesoftware.smack.XMPPException

     */
    public static void reply(Connection connection, Message original, Message reply)
            throws XMPPException {
        MultipleRecipientInfo info = getMultipleRecipientInfo(original);
        if (info == null) {
            throw new XMPPException("Original message does not contain multiple recipient info");
        }
        if (info.shouldNotReply()) {
            throw new XMPPException("Original message should not be replied");
        }
        if (info.getReplyRoom() != null) {
            throw new XMPPException("Reply should be sent through a room");
        }
        // Any <thread/> element from the initial message MUST be copied into the reply.
        if (original.getThread() != null) {
            reply.setThread(original.getThread());
        }
View Full Code Here

Examples of org.jivesoftware.smack.XMPPException

        Packet response = collector.nextResult(timeout);

        // Cancel the collector.
        collector.cancel();
        if (response == null) {
            throw new XMPPException("No response from server on status set.");
        }
        if (response.getError() != null) {
            throw new XMPPException(response.getError());
        }

        AdHocCommandData responseData = (AdHocCommandData) response;
        this.sessionID = responseData.getSessionID();
        super.setData(responseData);
View Full Code Here

Examples of org.jivesoftware.smack.XMPPException

        // Wait up to five seconds for a response from the server.
        IQ response = (IQ)collector.nextResult(SmackConfiguration.getPacketReplyTimeout());
        // Stop queuing results
        collector.cancel();
        if (response == null) {
            throw new XMPPException("No response from the server.");
        }
        // If the server replied with an error, throw an exception.
        else if (response.getType() == IQ.Type.ERROR) {
            throw new XMPPException(response.getError());
        }
        return ((PrivateDataResult)response).getPrivateData();
    }
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.