Package org.jivesoftware.smack

Examples of org.jivesoftware.smack.XMPPException


        InputStream inputStream;
        try {
            inputStream = streamNegotiatorTask.get(15, TimeUnit.SECONDS);
        }
        catch (InterruptedException e) {
            throw new XMPPException("Interruption while executing", e);
        }
        catch (ExecutionException e) {
            throw new XMPPException("Error in execution", e);
        }
        catch (TimeoutException e) {
            throw new XMPPException("Request timed out", e);
        }
        finally {
            streamNegotiatorTask.cancel(true);
        }
        setStatus(Status.negotiated);
View Full Code Here


        do {
      // write to the output stream
      try {
        out.write(b, 0, count);
      } catch (IOException e) {
        throw new XMPPException("error writing to output stream", e);
      }

      amountWritten += count;

      // read more bytes from the input stream
      try {
        count = in.read(b);
      } catch (IOException e) {
        throw new XMPPException("error reading from input stream", e);
      }
    } while (count != -1 && !getStatus().equals(Status.cancelled));

    // the connection was likely terminated abrubtly if these are not equal
    if (!getStatus().equals(Status.cancelled) && getError() == Error.none
View Full Code Here

        public InputStream call() throws Exception {
            Packet streamInitiation = collector.nextResult(
                    SmackConfiguration.getPacketReplyTimeout() * 2);
            if (streamInitiation == null) {
                throw new XMPPException("No response from remote client");
            }
            StreamNegotiator negotiator = determineNegotiator(streamInitiation);
            return negotiator.negotiateIncomingStream(streamInitiation);
        }
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

        Assert.assertEquals("redirect:", mav.getViewName());
    }

    @Test
    public void failedLogin() throws XMPPException {
        Mockito.doThrow(new XMPPException()).when(connection).login(ENTITY, PASSWORD);
       
        ModelAndView mav = controller.login(ENTITY, PASSWORD, session);
       
        Mockito.verify(connection).connect();
        Mockito.verify(connection).login(ENTITY, PASSWORD);
View Full Code Here

        Assert.assertNull(mav.getModel().get("authenticated"));
    }

    @Test
    public void failedConnect() throws XMPPException {
        Mockito.doThrow(new XMPPException()).when(connection).connect();
       
        ModelAndView mav = controller.login(ENTITY, PASSWORD, session);
       
        Mockito.verify(connection).connect();
       
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

            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();
        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();
        LOG.debug("Detected chat server: {}", chatServer);
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.