Smack

org.jivesoftware.smackx.packet
Class PEPEvent

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

public class PEPEvent
extends java.lang.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
PEPEvent()
          Creates a new empty roster exchange package.
PEPEvent(PEPItem item)
          Creates a new empty roster exchange package.
 
Method Summary
 void addPEPItem(PEPItem item)
           
 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.
 java.lang.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

PEPEvent

public PEPEvent()
Creates a new empty roster exchange package.


PEPEvent

public PEPEvent(PEPItem item)
Creates a new empty roster exchange package.

Method Detail

addPEPItem

public void addPEPItem(PEPItem item)

getElementName

public java.lang.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 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

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

toXML

public java.lang.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.