Package org.jivesoftware.smackx.packet

Examples of org.jivesoftware.smackx.packet.DiscoverInfo.addExtension()


                        synchronized (features) {
                            for (Iterator<String> it = getFeatures(); it.hasNext();) {
                                response.addFeature(it.next());
                            }
                            if (extendedInfo != null) {
                                response.addExtension(extendedInfo);
                            }
                        }
                    }
                    else {
                        // Disco#info was sent to a node. Check if we have information of the
View Full Code Here


    public void validateRoomWithEmptyForm()
    {
  DataForm dataForm = new DataForm("result");
 
  DiscoverInfo discoInfo = new DiscoverInfo();
  discoInfo.addExtension(dataForm);
  RoomInfo roomInfo = new RoomInfo(discoInfo);
  assertTrue(roomInfo.getDescription().isEmpty());
  assertTrue(roomInfo.getSubject().isEmpty());
  assertEquals(-1, roomInfo.getOccupantsCount());
    }
View Full Code Here

  FormField occupants = new FormField("muc#roominfo_occupants");
  occupants.addValue("3");
  dataForm.addField(occupants);

  DiscoverInfo discoInfo = new DiscoverInfo();
  discoInfo.addExtension(dataForm);
  RoomInfo roomInfo = new RoomInfo(discoInfo);
  assertEquals("The place for all good witches!", roomInfo.getDescription());
  assertEquals("Spells", roomInfo.getSubject());
  assertEquals(3, roomInfo.getOccupantsCount());
    }
View Full Code Here

                    // Initialize the variables from the parsed XML
                    variable = parser.getAttributeValue("", "var");
                }
                // Otherwise, it must be a packet extension.
                else {
                    discoverInfo.addExtension(PacketParserUtils.parsePacketExtension(parser
                            .getName(), parser.getNamespace(), parser));
                }
            } else if (eventType == XmlPullParser.END_TAG) {
                if (parser.getName().equals("identity")) {
                    // Create a new identity and add it to the discovered info.
View Full Code Here

                    // Initialize the variables from the parsed XML
                    variable = parser.getAttributeValue("", "var");
                }
                // Otherwise, it must be a packet extension.
                else {
                    discoverInfo.addExtension(PacketParserUtils.parsePacketExtension(parser
                            .getName(), parser.getNamespace(), parser));
                }
            } else if (eventType == XmlPullParser.END_TAG) {
                if (parser.getName().equals("identity")) {
                    // Create a new identity and add it to the discovered info.
View Full Code Here

                    // Initialize the variables from the parsed XML
                    variable = parser.getAttributeValue("", "var");
                }
                // Otherwise, it must be a packet extension.
                else {
                    discoverInfo.addExtension(PacketParserUtils.parsePacketExtension(parser
                            .getName(), parser.getNamespace(), parser));
                }
            } else if (eventType == XmlPullParser.END_TAG) {
                if (parser.getName().equals("identity")) {
                    // Create a new identity and add it to the discovered info.
View Full Code Here

                    // Initialize the variables from the parsed XML
                    variable = parser.getAttributeValue("", "var");
                }
                // Otherwise, it must be a packet extension.
                else {
                    discoverInfo.addExtension(PacketParserUtils.parsePacketExtension(parser
                            .getName(), parser.getNamespace(), parser));
                }
            } else if (eventType == XmlPullParser.END_TAG) {
                if (parser.getName().equals("identity")) {
                    // Create a new identity and add it to the discovered info.
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.