public class PubSub extends IQ
IQ
packet. This is the topmost
element of all pubsub requests and replies as defined in the Publish-Subscribe
specification.Modifier and Type | Field and Description |
---|---|
static String |
ELEMENT |
static String |
NAMESPACE |
DEFAULT_LANGUAGE, ID_NOT_AVAILABLE
Constructor and Description |
---|
PubSub() |
PubSub(String to,
IQ.Type type) |
PubSub(String to,
IQ.Type type,
PubSubNamespace ns) |
Modifier and Type | Method and Description |
---|---|
static PubSub |
createPubsubPacket(String to,
IQ.Type type,
PacketExtension extension,
PubSubNamespace ns) |
String |
getChildElementXML()
Returns the XML representation of a pubsub element according the specification.
|
String |
getElementName()
Returns the XML element name of the extension sub-packet root element.
|
PacketExtension |
getExtension(PubSubElementType elem) |
String |
getNamespace()
Returns the XML namespace of the extension sub-packet root element.
|
PubSubNamespace |
getPubSubNamespace()
Returns the current value of the namespace.
|
void |
setPubSubNamespace(PubSubNamespace ns)
Set the namespace for the packet if it something other than the default
case of
PubSubNamespace.BASIC . |
createErrorResponse, createResultIQ, getType, setType, toXML
addCommonAttributes, addExtension, addExtensions, equals, getDefaultLanguage, getError, getExtension, getExtension, getExtensions, getExtensionsXML, getFrom, getPacketID, getTo, getXmlns, hashCode, nextID, removeExtension, setDefaultXmlns, setError, setFrom, setPacketID, setTo, toString
public static final String ELEMENT
public static final String NAMESPACE
public PubSub()
public PubSub(String to, IQ.Type type, PubSubNamespace ns)
public String getElementName()
public String getNamespace()
public void setPubSubNamespace(PubSubNamespace ns)
PubSubNamespace.BASIC
. The getNamespace()
method will return
the result of calling PubSubNamespace.getXmlns()
on the specified enum.ns
- - The new value for the namespace.public PacketExtension getExtension(PubSubElementType elem)
public PubSubNamespace getPubSubNamespace()
getNamespace()
method will return
the result of calling PubSubNamespace.getXmlns()
this value.public String getChildElementXML()
<iq type='set' id="MlIpV-4" to="pubsub.gato.home" from="gato3@gato.home/Smack"> <pubsub xmlns="http://jabber.org/protocol/pubsub"> : Specific request extension : </pubsub> </iq>
getChildElementXML
in class IQ
public static PubSub createPubsubPacket(String to, IQ.Type type, PacketExtension extension, PubSubNamespace ns)