org.jabber.jabberbeans.serverside
Class Log

java.lang.Object
  |
  +--org.jabber.jabberbeans.XMLData
        |
        +--org.jabber.jabberbeans.serverside.Log
All Implemented Interfaces:
Packet, java.io.Serializable

public class Log
extends XMLData
implements Packet

A Log object represents a single Log packet, which is used to send debug/error information between the server components and any data store.

e.g.:
<log type="notice|warn|error" from="service|'_internal'">
  content <log>

Note that there is no 'error' capacity, no 'to' attribute, and no xmlns extensions. IDs are pointless.

See Also:
ContentPacket, Serialized Form

Field Summary
protected  java.lang.String content
          A String holding the loggable message.
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  java.lang.String type
          A packet subtype.
 
Constructor Summary
Log(LogBuilder builder)
          Creates a new Log instance.
 
Method Summary
 void appendItem(java.lang.StringBuffer retval)
          appendItem appends the XML representation of the current packet data to the specified StringBuffer.
 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.
 java.lang.String getType()
          getType returns the subtype of this packet.
 
Methods inherited from class org.jabber.jabberbeans.XMLData
appendAttrib, appendAttrib, appendChild, appendChild, 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
toString
 

Field Detail

fromAddress

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.


identifier

protected java.lang.String identifier
An identifier that is echoed in data replies/errors of this packet. Identifiers are meant to be unique per XML stream, and not duplicated.


type

protected java.lang.String type
A packet subtype. For instance, a message can be a normal message, a message in a one-on-one chat, a groupchat message or a headline.


content

protected java.lang.String content
A String holding the loggable message.

Constructor Detail

Log

public Log(LogBuilder builder)
Creates a new Log instance.

Parameters:
builder - an LogBuilder holding appropriate values
Method Detail

getFromAddress

public JID getFromAddress()
getFromAddress returns the address of the sender of this message. Can be blank (null).

Returns:
JID this packet originated from.

getIdentifier

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.

Returns:
a String value

getType

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

Returns:
String holding the type

appendItem

public void appendItem(java.lang.StringBuffer retval)
appendItem appends the XML representation of the current packet data to the specified StringBuffer.

Specified by:
appendItem in interface Packet
Specified by:
appendItem in class XMLData
Parameters:
retval - The StringBuffer to append to