|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.jabber.jabberbeans.XMLData | +--org.jabber.jabberbeans.ContentPacket
A ContentPacket
is derived from a Packet
,a single
unit of information to be sent (or received) from the server. The three
base types of packets currently 'known' are IQ, Presence and Message.
The ContentPacket
is an abstract class that combines elements
of these three types together, such as destination and origination (to and
from) addresses, the xml identifier, packet type, etc. This creates a
significant improvement on the amount of duplicated code between these three
elements.
Field Summary | |
protected PacketError |
error
Extended description of the error (when type=error). |
protected java.util.Vector |
extensions
A list of extensions attached to this object. |
protected JID |
fromAddress
The address that this packet is coming from - your address (or blank) for outgoing packets, the originator's address for incoming packets. |
protected java.lang.String |
identifier
An identifier that is echoed in data replies/errors of this packet. |
protected JID |
toAddress
The address that this packet is being sent to - the destination for outgoing packets, you (the recipient) for incoming packets. |
protected java.lang.String |
type
A packet subtype. |
Constructor Summary | |
protected |
ContentPacket(PacketBuilder packet)
This constructor builds the packet portion of packet-derived objects. |
Method Summary | |
protected void |
appendAnyError(java.lang.StringBuffer sb)
appendAnyError will add the error information,if any exists
for this packet. |
protected void |
appendBaseAttribs(java.lang.StringBuffer sb)
appendBaseAttribs is a helper funnction which adds the
base attributes to a StringBuffer which is being used to be return
a XML representation of the packet.. |
java.util.Enumeration |
Extensions()
Extensions returns an enumeration of extensions, if
any |
PacketError |
getError()
getError gets the whole error tag, a tag
according to JEP-0086. |
java.lang.String |
getErrorCode()
getErrorCode gets the HTTP-style error code for this packet
. |
java.lang.String |
getErrorText()
getErrorText gets the error text, a fuller textual
description of the problem encountered. |
JID |
getFromAddress()
getFromAddress returns the address of the sender of this
message. |
java.lang.String |
getIdentifier()
getIdentifier returns a string which uniquely identifies
this packet in the XML stream. |
JID |
getToAddress()
getToAddress returns the address of the recipiant of this
message. |
java.lang.String |
getType()
getType returns the subtype of this packet. |
Methods inherited from class org.jabber.jabberbeans.XMLData |
appendAttrib, appendAttrib, appendChild, appendChild, appendItem, escapeString, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.jabber.jabberbeans.Packet |
appendItem, toString |
Methods inherited from interface org.jabber.jabberbeans.Extension.Extension |
appendItem, toString |
Field Detail |
protected JID toAddress
protected JID fromAddress
protected java.lang.String identifier
protected java.lang.String type
protected PacketError error
protected java.util.Vector extensions
Constructor Detail |
protected ContentPacket(PacketBuilder packet)
packet
- a PacketBuilder
which holds the value of the
packet parametersMethod Detail |
public JID getToAddress()
getToAddress
returns the address of the recipiant of this
message. Can be blank (null)
JID
who this packet was addressed to.public JID getFromAddress()
getFromAddress
returns the address of the sender of this
message. Can be blank (null)
JID
this packet originated from.public java.lang.String getIdentifier()
getIdentifier
returns a string which uniquely identifies
this packet in the XML stream. Any reply (such as an IQ type=result or
an error message) will carry this same identifier. Identifiers are not
meant to be duplicated in a stream.
String
valuepublic java.lang.String getType()
getType
returns the subtype of this packet. Its context
and correctness is determined by the final packet type (message, iq,etc)
according to the jabber protocol specifications on protocol.jabber.org.
String
holding the typepublic java.lang.String getErrorCode()
getErrorCode
gets the HTTP-style error code for this packet
. All packets can potentially return errors. Error information without
the packet having subtype type="error" is considered invalid.
String
holding the error codepublic java.lang.String getErrorText()
getErrorText
gets the error text, a fuller textual
description of the problem encountered. Error information without the
packet having subtype type="error" is considered invalid.
String
valuepublic PacketError getError()
getError
gets the whole error tag, a tag
according to JEP-0086.
PacketError
valuepublic java.util.Enumeration Extensions()
Extensions
returns an enumeration of extensions, if
any
Enumeration
value, or null if no extensionsprotected void appendBaseAttribs(java.lang.StringBuffer sb)
appendBaseAttribs
is a helper funnction which adds the
base attributes to a StringBuffer which is being used to be return
a XML representation of the packet..
sb
- a StringBuffer
valueprotected void appendAnyError(java.lang.StringBuffer sb)
appendAnyError
will add the error information,if any exists
for this packet.
sb
- StringBuffer which we are injecting data into
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |