Examples of XMPPException


Examples of org.jivesoftware.smack.XMPPException

        // check if stream host is the local SOCKS5 proxy
        if (this.streamHost.getJID().equals(this.connection.getUser())) {
            Socks5Proxy socks5Server = Socks5Proxy.getSocks5Proxy();
            socket = socks5Server.getSocket(this.digest);
            if (socket == null) {
                throw new XMPPException("target is not connected to SOCKS5 proxy");
            }
        }
        else {
            socket = super.getSocket(timeout);

            try {
                activate();
            }
            catch (XMPPException e) {
                socket.close();
                throw new XMPPException("activating SOCKS5 Bytestream failed", e);
            }

        }

        return socket;
View Full Code Here

Examples of org.jivesoftware.smack.XMPPException

    private void cancelRequest() throws XMPPException {
        String errorMessage = "Could not establish socket with any provided host";
        XMPPError error = new XMPPError(XMPPError.Condition.item_not_found, errorMessage);
        IQ errorIQ = IQ.createErrorResponse(this.bytestreamRequest, error);
        this.manager.getConnection().sendPacket(errorIQ);
        throw new XMPPException(errorMessage, error);
    }
View Full Code Here

Examples of org.jivesoftware.smack.XMPPException

    public static byte[] receiveSocks5Message(DataInputStream in) throws IOException, XMPPException {
        byte[] header = new byte[5];
        in.readFully(header, 0, 5);

        if (header[3] != (byte) 0x03) {
            throw new XMPPException("Unsupported SOCKS5 address type");
        }

        int addressLength = header[4];

        byte[] response = new byte[7 + addressLength];
View Full Code Here

Examples of org.jivesoftware.smack.XMPPException

                // initialize connection to SOCKS5 proxy
                if (!establish(socket)) {

                    // initialization failed, close socket
                    socket.close();
                    throw new XMPPException("establishing connection to SOCKS5 proxy failed");

                }

                return socket;
            }
View Full Code Here

Examples of org.jivesoftware.smack.XMPPException

            (Presence) response.nextResult(SmackConfiguration.getPacketReplyTimeout());
        // Stop queuing results
        response.cancel();

        if (presence == null) {
            throw new XMPPException("No response from server.");
        }
        else if (presence.getError() != null) {
            throw new XMPPException(presence.getError());
        }
        // Whether the room existed before or was created, the user has joined the room
        this.nickname = nickname;
        joined = true;
        userHasJoined();

        // Look for confirmation of room creation from the server
        MUCUser mucUser = getMUCUserExtension(presence);
        if (mucUser != null && mucUser.getStatus() != null) {
            if ("201".equals(mucUser.getStatus().getCode())) {
                // Room was created and the user has joined the room
                return;
            }
        }
        // We need to leave the room since it seems that the room already existed
        leave();
        throw new XMPPException("Creation failed - Missing acknowledge of room creation.");
    }
View Full Code Here

Examples of org.jivesoftware.smack.XMPPException

                response.cancel();
            }
        }

        if (presence == null) {
            throw new XMPPException("No response from server.");
        }
        else if (presence.getError() != null) {
            throw new XMPPException(presence.getError());
        }
        this.nickname = nickname;
        joined = true;
        userHasJoined();
    }
View Full Code Here

Examples of org.jivesoftware.smack.XMPPException

        IQ answer = (IQ) response.nextResult(SmackConfiguration.getPacketReplyTimeout());
        // Stop queuing results
        response.cancel();

        if (answer == null) {
            throw new XMPPException("No response from server.");
        }
        else if (answer.getError() != null) {
            throw new XMPPException(answer.getError());
        }
        return Form.getFormFrom(answer);
    }
View Full Code Here

Examples of org.jivesoftware.smack.XMPPException

        IQ answer = (IQ) response.nextResult(SmackConfiguration.getPacketReplyTimeout());
        // Stop queuing results
        response.cancel();

        if (answer == null) {
            throw new XMPPException("No response from server.");
        }
        else if (answer.getError() != null) {
            throw new XMPPException(answer.getError());
        }
    }
View Full Code Here

Examples of org.jivesoftware.smack.XMPPException

        PacketCollector collector = connection.createPacketCollector(filter);
        connection.sendPacket(reg);
        IQ result = (IQ) collector.nextResult(SmackConfiguration.getPacketReplyTimeout());
        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 Form.getFormFrom(result);
    }
View Full Code Here

Examples of org.jivesoftware.smack.XMPPException

        PacketCollector collector = connection.createPacketCollector(filter);
        connection.sendPacket(reg);
        IQ result = (IQ) collector.nextResult(SmackConfiguration.getPacketReplyTimeout());
        collector.cancel();
        if (result == null) {
            throw new XMPPException("No response from server.");
        }
        else if (result.getType() == IQ.Type.ERROR) {
            throw new XMPPException(result.getError());
        }
    }
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.