xmlBlaster 2.2.0 API

org.xmlBlaster.util
Class MsgUnitRaw

java.lang.Object
  extended by org.xmlBlaster.util.MsgUnitRaw
All Implemented Interfaces:
java.io.Serializable

public final class MsgUnitRaw
extends java.lang.Object
implements java.io.Serializable

Encapsulates the xmlKey, content and qos.

Keep this class slim, it is serialized and passed with RMI

The constructor arguments are checked to be not null and corrected to "" or 'new byte[0]' if they are null

See Also:
Serialized Form

Field Summary
private  byte[] content
           
static java.lang.String CONTENT_TAG
           
private static byte[] EMPTY_BYTEARR
           
private  EncodableData encodedContent
           
private  byte[] key
           
static java.lang.String KEY_TAG
           
private  java.lang.Object msgUnit
           
private  byte[] qos
           
static java.lang.String QOS_TAG
           
 
Constructor Summary
MsgUnitRaw(byte[] key, EncodableData encodedContent, byte[] qos)
           
MsgUnitRaw(java.lang.Object msgUnit, byte[] key, byte[] content, byte[] qos)
           
MsgUnitRaw(java.lang.Object msgUnit, java.lang.String key, byte[] content, java.lang.String qos)
          Deprecated. provided only for backwards compatibility, this will be removed in later releases. The byte array variant will be used.
MsgUnitRaw(java.lang.String key, byte[] content, java.lang.String qos)
           
MsgUnitRaw(java.lang.String key, EncodableData encodedContent, java.lang.String qos)
          Deprecated. provided only for backwards compatibility, this will be removed in later releases. The byte array variant will be used.
 
Method Summary
static void dumpContent(java.lang.String extraOffset, java.io.OutputStream out, byte[] content, boolean forceReadable, boolean inhibitContentCDATAWrapper, java.lang.String contentCharset)
           
static void dumpContent(java.lang.String extraOffset, java.io.OutputStream out, byte[] content, boolean forceReadable, java.lang.String charset)
           
 byte[] getContent()
          Get the raw content, never null
 java.lang.String getContentStr()
          Get the raw content, never null
 java.lang.String getKey()
          The raw XML string, never null
 byte[] getKeyBytes()
           
 java.lang.Object getMsgUnit()
          You can decide to pass with the constructor a parsed MsgUnit
 java.lang.String getQos()
          The raw QoS XML string, never null
 byte[] getQosBytes()
          The raw QoS XML string, never null
 long size()
          The number of bytes of qos+key+content
 java.lang.String toXml(java.lang.String contentCharset)
           
 void toXml(java.lang.String extraOffset, java.io.OutputStream out, java.util.Properties props, java.lang.String contentCharset)
          Standard message dump.
 java.lang.String toXml(java.lang.String extraOffset, java.lang.String contentCharset)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY_BYTEARR

private static final transient byte[] EMPTY_BYTEARR

msgUnit

private final transient java.lang.Object msgUnit

qos

private final byte[] qos

key

private final byte[] key

content

private final byte[] content

encodedContent

private final EncodableData encodedContent

KEY_TAG

public static final java.lang.String KEY_TAG
See Also:
Constant Field Values

CONTENT_TAG

public static final java.lang.String CONTENT_TAG
See Also:
Constant Field Values

QOS_TAG

public static final java.lang.String QOS_TAG
See Also:
Constant Field Values
Constructor Detail

MsgUnitRaw

public MsgUnitRaw(java.lang.Object msgUnit,
                  java.lang.String key,
                  byte[] content,
                  java.lang.String qos)
Deprecated. provided only for backwards compatibility, this will be removed in later releases. The byte array variant will be used.

Parameters:
msgUnit -
key -
content -
qos -

MsgUnitRaw

public MsgUnitRaw(java.lang.String key,
                  EncodableData encodedContent,
                  java.lang.String qos)
Deprecated. provided only for backwards compatibility, this will be removed in later releases. The byte array variant will be used.

Parameters:
key -
encodedContent -
qos -

MsgUnitRaw

public MsgUnitRaw(java.lang.Object msgUnit,
                  byte[] key,
                  byte[] content,
                  byte[] qos)
Parameters:
msgUnit - Temporary object with parsed information, this is not evaluated internally
key -
content -
qos -

MsgUnitRaw

public MsgUnitRaw(java.lang.String key,
                  byte[] content,
                  java.lang.String qos)

MsgUnitRaw

public MsgUnitRaw(byte[] key,
                  EncodableData encodedContent,
                  byte[] qos)
Method Detail

getKey

public java.lang.String getKey()
The raw XML string, never null


getKeyBytes

public byte[] getKeyBytes()

getContent

public byte[] getContent()
Get the raw content, never null


getContentStr

public java.lang.String getContentStr()
Get the raw content, never null


getQos

public java.lang.String getQos()
The raw QoS XML string, never null


getQosBytes

public byte[] getQosBytes()
The raw QoS XML string, never null


size

public long size()
The number of bytes of qos+key+content


getMsgUnit

public java.lang.Object getMsgUnit()
You can decide to pass with the constructor a parsed MsgUnit

Returns:
MsgUnit with holds the parsed information, please treat as immutable, or null

toXml

public java.lang.String toXml(java.lang.String contentCharset)

toXml

public java.lang.String toXml(java.lang.String extraOffset,
                              java.lang.String contentCharset)
Parameters:
extraOffset -
contentCharset - TODO
Returns:

toXml

public void toXml(java.lang.String extraOffset,
                  java.io.OutputStream out,
                  java.util.Properties props,
                  java.lang.String contentCharset)
           throws java.io.IOException
Standard message dump. Used for logging and XmlScripting

Parameters:
extraOffset -
out -
contentCharset - TODO
Throws:
java.io.IOException

dumpContent

public static void dumpContent(java.lang.String extraOffset,
                               java.io.OutputStream out,
                               byte[] content,
                               boolean forceReadable,
                               java.lang.String charset)
                        throws java.io.IOException
Throws:
java.io.IOException

dumpContent

public static void dumpContent(java.lang.String extraOffset,
                               java.io.OutputStream out,
                               byte[] content,
                               boolean forceReadable,
                               boolean inhibitContentCDATAWrapper,
                               java.lang.String contentCharset)
                        throws java.io.IOException
Throws:
java.io.IOException

xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.