Smack

org.jivesoftware.smackx.packet
Class PEPPubSub

java.lang.Object
  extended by org.jivesoftware.smack.packet.Packet
      extended by org.jivesoftware.smack.packet.IQ
          extended by org.jivesoftware.smackx.packet.PEPPubSub

public class PEPPubSub
extends IQ

Represents XMPP PEP/XEP-163 pubsub packets.

The 'http://jabber.org/protocol/pubsub' namespace is used to publish personal events items from one client to subscribed clients (See XEP-163).

Author:
Jeff Williams

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jivesoftware.smack.packet.IQ
IQ.Type
 
Field Summary
 
Fields inherited from class org.jivesoftware.smack.packet.Packet
DEFAULT_LANGUAGE, ID_NOT_AVAILABLE
 
Constructor Summary
PEPPubSub(PEPItem item)
          Creates a new PubSub.
 
Method Summary
 java.lang.String getChildElementXML()
          Returns the XML representation of a Personal Event Publish according the specification.
 java.lang.String getElementName()
          Returns the XML element name of the extension sub-packet root element.
 java.lang.String getNamespace()
          Returns the XML namespace of the extension sub-packet root element.
 
Methods inherited from class org.jivesoftware.smack.packet.IQ
createErrorResponse, createResultIQ, getType, setType, toXML
 
Methods inherited from class org.jivesoftware.smack.packet.Packet
addExtension, addExtensions, deleteProperty, equals, getDefaultLanguage, getError, getExtension, getExtension, getExtensions, getExtensionsXML, getFrom, getPacketID, getProperty, getPropertyNames, getTo, getXmlns, hashCode, nextID, removeExtension, setDefaultXmlns, setError, setFrom, setPacketID, setProperty, setTo
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PEPPubSub

public PEPPubSub(PEPItem item)
Creates a new PubSub.

Method Detail

getElementName

public java.lang.String getElementName()
Returns the XML element name of the extension sub-packet root element. Always returns "x"

Returns:
the XML element name of the packet extension.

getNamespace

public java.lang.String getNamespace()
Returns the XML namespace of the extension sub-packet root element. According the specification the namespace is always "jabber:x:roster" (which is not to be confused with the 'jabber:iq:roster' namespace

Returns:
the XML namespace of the packet extension.

getChildElementXML

public java.lang.String getChildElementXML()
Returns the XML representation of a Personal Event Publish according the specification. Usually the XML representation will be inside of a Message XML representation like in the following example:
 <message id="MlIpV-4" to="gato1@gato.home" from="gato3@gato.home/Smack">
     <subject>Any subject you want</subject>
     <body>This message contains roster items.</body>
     <x xmlns="jabber:x:roster">
         <item jid="gato1@gato.home"/>
         <item jid="gato2@gato.home"/>
     </x>
 </message>
 

Specified by:
getChildElementXML in class IQ
Returns:
the child element section of the IQ XML.

Smack

Copyright © 2003-2007 Jive Software.