Package org.apache.vysper.xmpp.modules.extension.xep0045_muc.stanzas

Examples of org.apache.vysper.xmpp.modules.extension.xep0045_muc.stanzas.Invite


        // add occupants to the room
        Room room = conference.findOrCreateRoom(ROOM1_JID, "Room 1");
        room.setPassword("secret");
        room.addOccupant(OCCUPANT1_JID, "nick");

        Invite invite = new Invite(null, OCCUPANT2_JID, reason);
        // send message to occupant 1
        assertNull(sendMessage(OCCUPANT1_JID, ROOM1_JID, null, null, new X(invite), null));

        X expectedX = new X(new Invite(OCCUPANT1_JID, null, reason), new Password("secret"));
        // verify stanzas to existing occupants on the exiting user
        assertMessageStanza(ROOM1_JID, OCCUPANT2_JID, null, null, null, expectedX,
                occupant2Queue.getNext());
        assertNull(occupant1Queue.getNext());
    }
View Full Code Here


    }
   
    public static Stanza createInviteMessageStanza(Stanza original, String password) throws EntityFormatException {
        X orginalX = X.fromStanza(original);
       
        Invite invite = orginalX.getInvite();
        if(invite == null  || invite.getTo() == null) {
            throw new IllegalArgumentException("Invalid invite element, must exist and contain to attribute");
        }
       
        Invite newInvite = new Invite(original.getFrom(), null, invite.getReason());
        return createInviteDeclineMessageStanza(original, invite.getTo(), password, newInvite);
    }
View Full Code Here

    }

    public static Stanza createInviteMessageStanza(Stanza original, String password) throws EntityFormatException {
        X orginalX = X.fromStanza(original);

        Invite invite = orginalX.getInvite();
        if (invite == null || invite.getTo() == null) {
            throw new IllegalArgumentException("Invalid invite element, must exist and contain to attribute");
        }

        Invite newInvite = new Invite(original.getFrom(), null, invite.getReason());
        return createInviteDeclineMessageStanza(original, invite.getTo(), password, newInvite);
    }
View Full Code Here

        // add occupants to the room
        Room room = conference.findOrCreateRoom(ROOM1_JID, "Room 1");
        room.setPassword("secret");
        room.addOccupant(OCCUPANT1_JID, "nick");

        Invite invite = new Invite(null, OCCUPANT2_JID, reason);
        // send message to occupant 1
        assertNull(sendMessage(OCCUPANT1_JID, ROOM1_JID, null, null, new X(NamespaceURIs.XEP0045_MUC_USER, invite), null));

        X expectedX = new X(new Invite(OCCUPANT1_JID, null, reason), new Password("secret"));
        // verify stanzas to existing occupants on the exiting user
        assertMessageStanza(ROOM1_JID, OCCUPANT2_JID, null, null, null, expectedX, occupant2Queue.getNext());
        assertNull(occupant1Queue.getNext());
    }
View Full Code Here

        // add occupants to the room
        Room room = conference.findOrCreateRoom(ROOM1_JID, "Room 1");
        room.setPassword("secret");
        room.addOccupant(OCCUPANT1_JID, "nick");

        Invite invite = new Invite(null, OCCUPANT2_JID, reason);
        // send message to occupant 1
        assertNull(sendMessage(OCCUPANT1_JID, ROOM1_JID, null, null, new X(invite), null));

        X expectedX = new X(new Invite(OCCUPANT1_JID, null, reason), new Password("secret"));
        // verify stanzas to existing occupants on the exiting user
        assertMessageStanza(ROOM1_JID, OCCUPANT2_JID, null, null, null, expectedX, occupant2Queue.getNext());
        assertNull(occupant1Queue.getNext());
    }
View Full Code Here

TOP

Related Classes of org.apache.vysper.xmpp.modules.extension.xep0045_muc.stanzas.Invite

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.