Package org.jivesoftware.smack.packet

Examples of org.jivesoftware.smack.packet.PacketExtension


        {
            int eventType = parser.next();
           
            if (eventType == XmlPullParser.START_TAG)
            {
              PacketExtension ext = PacketParserUtils.parsePacketExtension(parser.getName(), namespace, parser);
             
              if (ext != null)
              {
                pubsub.addExtension(ext);
              }
View Full Code Here


                                                           xmlBeansNamespace,
                                                           this);
    }

    public C getExtension(Packet packet) {
        PacketExtension extension = packet.getExtension(elementName,
                xmlBeansNamespace);
        if (extension == null) {
            return null;
        }
        return (C) (((XmlBeansPacketExtension)extension).getValue());
View Full Code Here

        }
        return list;
    }

    public void addExtension(Packet packet, C value) {
        PacketExtension oldExtension = packet.getExtension(elementName,
                                                           xmlBeansNamespace);
        packet.addExtension(new XmlBeansPacketExtension(this, value));
    }
View Full Code Here

     *
     * @param packet the packet used for reporting data.
     */
    public static ReportedData getReportedDataFrom(Packet packet) {
        // Check if the packet includes the DataForm extension
        PacketExtension packetExtension = packet.getExtension("x","jabber:x:data");
        if (packetExtension != null) {
            // Check if the existing DataForm is a result of a search
            DataForm dataForm = (DataForm) packetExtension;
            if (dataForm.getReportedData() != null)
                return new ReportedData(dataForm);
View Full Code Here

     *
     * @param packet the packet used for gathering data.
     */
    public static Form getFormFrom(Packet packet) {
        // Check if the packet includes the DataForm extension
        PacketExtension packetExtension = packet.getExtension("x","jabber:x:data");
        if (packetExtension != null) {
            // Check if the existing DataForm is not a result of a search
            DataForm dataForm = (DataForm) packetExtension;
            if (dataForm.getReportedData() == null)
                return new Form(dataForm);
View Full Code Here

        public void chatCreated(final Chat chat, boolean createdLocally) {
            chat.addMessageListener(this);
        }

        public void processMessage(Chat chat, Message message) {
            PacketExtension extension
                    = message.getExtension("http://jabber.org/protocol/chatstates");
            if (extension == null) {
                return;
            }

            ChatState state;
            try {
                state = ChatState.valueOf(extension.getElementName());
            }
            catch (Exception ex) {
                return;
            }
View Full Code Here

     *
     * @param packet the packet used for gathering data.
     */
    public static Form getFormFrom(Packet packet) {
        // Check if the packet includes the DataForm extension
        PacketExtension packetExtension = packet.getExtension("x","jabber:x:data");
        if (packetExtension != null) {
            // Check if the existing DataForm is not a result of a search
            DataForm dataForm = (DataForm) packetExtension;
            if (dataForm.getReportedData() == null)
                return new Form(dataForm);
View Full Code Here

     *
     * @param packet the packet used for reporting data.
     */
    public static ReportedData getReportedDataFrom(Packet packet) {
        // Check if the packet includes the DataForm extension
        PacketExtension packetExtension = packet.getExtension("x","jabber:x:data");
        if (packetExtension != null) {
            // Check if the existing DataForm is a result of a search
            DataForm dataForm = (DataForm) packetExtension;
            if (dataForm.getReportedData() != null)
                return new ReportedData(dataForm);
View Full Code Here

        if(parser.getEventType() != parser.START_TAG) throw new Exception();
       
        //zpracovat prvni element. musi to byt wb. ale mam to validovat? to prece ne
        // spoleham na to, ze je to validni..
        PacketExtension ext = parseRootElement();
       
        return ext;
    }
View Full Code Here

    connection.sendPacket(resp);
  }
  public void unsupportedInfo( IQ iq ) {
    IQ resp = IQ.createResultIQ(iq);
    resp.setType(Type.ERROR);
    resp.addExtension(new PacketExtension() {
      @Override
      public String getElementName() {
        return "error";
      }
      @Override
View Full Code Here

TOP

Related Classes of org.jivesoftware.smack.packet.PacketExtension

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.