Package org.jivesoftware.smack.packet

Examples of org.jivesoftware.smack.packet.XMPPError$Type


                // Check whether a visitor can grant membership privileges to another visitor
                muc2.grantMembership(getBareJID(2));
                fail("User2 was able to grant membership privileges");
            }
            catch (XMPPException e) {
                XMPPError xmppError = e.getXMPPError();
                assertNotNull(
                    "No XMPPError was received granting membership privileges",
                    xmppError);
                assertEquals(
                    "A visitor was able to grant membership privileges to another visitor",
                    403,
                    xmppError.getCode());
            }

            // Check that the room's owner can grant membership privileges to a visitor
            muc.grantMembership(getBareJID(1));
            Thread.sleep(300);
View Full Code Here


                // Check whether a visitor can grant admin privileges to another visitor
                muc2.grantAdmin(getBareJID(2));
                fail("User2 was able to grant admin privileges");
            }
            catch (XMPPException e) {
                XMPPError xmppError = e.getXMPPError();
                assertNotNull("No XMPPError was received granting admin privileges", xmppError);
                assertEquals(
                    "A visitor was able to grant admin privileges to another visitor",
                    403,
                    xmppError.getCode());
            }

            // Check that the room's owner can grant admin privileges to a visitor
            muc.grantAdmin(getBareJID(1));
            Thread.sleep(300);
View Full Code Here

                // Check whether a visitor can grant ownership privileges to another visitor
                muc2.grantOwnership(getBareJID(2));
                fail("User2 was able to grant ownership privileges");
            }
            catch (XMPPException e) {
                XMPPError xmppError = e.getXMPPError();
                assertNotNull("No XMPPError was received granting ownership privileges", xmppError);
                assertEquals(
                    "A visitor was able to grant ownership privileges to another visitor",
                    403,
                    xmppError.getCode());
            }

            // Check that the room's owner can grant ownership privileges to a visitor
            muc.grantOwnership(getBareJID(1));
            Thread.sleep(300);
View Full Code Here

                // Check whether a member can get the list of owners
                muc2.getOwners();
                fail("User2 was able to get the list of owners");
            }
            catch (XMPPException e) {
                XMPPError xmppError = e.getXMPPError();
                assertNotNull("No XMPPError was received getting the list of owners", xmppError);
                assertEquals(
                    "A member was able to get the list of owners",
                    403,
                    xmppError.getCode());
            }
        }
        catch (Exception e) {
            e.printStackTrace();
            fail(e.getMessage());
View Full Code Here

            monitor.worked(1);

            connection.disconnect();
        } catch (XMPPException e) {
            String message = e.getMessage();
            XMPPError error = e.getXMPPError();
            if (error != null) {
                message = error.getMessage();
                if (message == null) {
                    if (error.getCode() == 409)
                        message = "The XMPP/Jabber account already exists.";
                    else
                        message = "An unknown error occured. Please register on provider's website.";
                }
            }
View Full Code Here

        FormField streamMethodField = getStreamMethodField(si
                .getFeatureNegotiationForm());

        if (streamMethodField == null) {
            String errorMessage = "No stream methods contained in packet.";
            XMPPError error = new XMPPError(XMPPError.Condition.bad_request, errorMessage);
            IQ iqPacket = createIQ(si.getPacketID(), si.getFrom(), si.getTo(),
                    IQ.Type.ERROR);
            iqPacket.setError(error);
            connection.sendPacket(iqPacket);
            throw new XMPPException(errorMessage, error);
View Full Code Here

                isIBB = true;
            }
        }

        if (!isByteStream && !isIBB) {
            XMPPError error = new XMPPError(XMPPError.Condition.bad_request,
                    "No acceptable transfer mechanism");
            throw new XMPPException(error.getMessage(), error);
        }

       //if (isByteStream && isIBB && field.getType().equals(FormField.TYPE_LIST_MULTI)) {
        if (isByteStream && isIBB) {
            return new FaultTolerantNegotiator(connection,
View Full Code Here

     * Reject a stream initiation request from a remote user.
     *
     * @param si The Stream Initiation request to reject.
     */
    public void rejectStream(final StreamInitiation si) {
        XMPPError error = new XMPPError(XMPPError.Condition.forbidden, "Offer Declined");
        IQ iqPacket = createIQ(si.getPacketID(), si.getFrom(), si.getTo(),
                IQ.Type.ERROR);
        iqPacket.setError(error);
        connection.sendPacket(iqPacket);
    }
View Full Code Here

                isIBB = true;
            }
        }

        if (!isByteStream && !isIBB) {
            XMPPError error = new XMPPError(XMPPError.Condition.bad_request,
                    "No acceptable transfer mechanism");
            throw new XMPPException(error.getMessage(), error);
        }

        if (isByteStream && isIBB) {
            return new FaultTolerantNegotiator(connection,
                    byteStreamTransferManager, inbandTransferManager);
View Full Code Here

    StreamInitiation initiation = request.getStreamInitiation();

    IQ rejection = FileTransferNegotiator.createIQ(
        initiation.getPacketID(), initiation.getFrom(), initiation
            .getTo(), IQ.Type.ERROR);
    rejection.setError(new XMPPError(XMPPError.Condition.forbidden));
    connection.sendPacket(rejection);
  }
View Full Code Here

TOP

Related Classes of org.jivesoftware.smack.packet.XMPPError$Type

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.