Smack

org.jivesoftware.smackx.packet
Class PEPItem

java.lang.Object
  extended by org.jivesoftware.smackx.packet.PEPItem
All Implemented Interfaces:
PacketExtension

public abstract class PEPItem
extends Object
implements PacketExtension

Represents XMPP Personal Event Protocol packets.

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

Author:
Jeff Williams

Constructor Summary
PEPItem(String id)
          Creates a new PEPItem.
 
Method Summary
 String getElementName()
          Returns the XML element name of the extension sub-packet root element.
 String getNamespace()
          Returns the XML namespace of the extension sub-packet root element.
 String toXML()
          Returns the XML representation of a Personal Event Publish according the specification.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PEPItem

public PEPItem(String id)
Creates a new PEPItem.

Method Detail

getElementName

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

Specified by:
getElementName in interface PacketExtension
Returns:
the XML element name of the packet extension.

getNamespace

public String getNamespace()
Returns the XML namespace of the extension sub-packet root element.

Specified by:
getNamespace in interface PacketExtension
Returns:
the XML namespace of the packet extension.

toXML

public String toXML()
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:
toXML in interface PacketExtension
Returns:
the packet extension as XML.

Smack

Copyright © 2003-2007 Jive Software.