xmlBlaster 2.2.0 API

org.xmlBlaster.client.queuemsg
Class MsgQueuePublishEntry

java.lang.Object
  extended by org.xmlBlaster.util.queuemsg.MsgQueueEntry
      extended by org.xmlBlaster.client.queuemsg.MsgQueuePublishEntry
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, I_Entry, I_QueueEntry

public final class MsgQueuePublishEntry
extends MsgQueueEntry

Wraps an publish() message into an entry for a sorted queue.

Author:
michele@laghi.eu, xmlBlaster@marcelruff.info
See Also:
Serialized Form

Field Summary
private  long immutableSizeInBytes
           
private static java.util.logging.Logger log
           
private static java.lang.String ME
           
private  MsgQosData msgQosData
           
private  MsgUnit msgUnit
          The MsgUnit with key/content/qos (raw struct)
private  SessionName receiver
           
private static long serialVersionUID
           
 
Fields inherited from class org.xmlBlaster.util.queuemsg.MsgQueueEntry
entryType, glob, persistent, priority, redeliverCounter, refToCloneOrigin, returnObj, storageId, uniqueIdString, uniqueIdTimestamp, wantReturnObj
 
Constructor Summary
MsgQueuePublishEntry(Global glob, MethodName entryType, PriorityEnum priority, StorageId storageId, Timestamp publishEntryTimestamp, long sizeInBytes, MsgUnit msgUnit)
          For persistence recovery
MsgQueuePublishEntry(Global glob, MsgUnit msgUnit, StorageId storageId)
          Use this constructor if a new message object is fed by method publish() (not oneway).
MsgQueuePublishEntry(Global glob, MsgUnit msgUnit, StorageId storageId, boolean oneway)
           
 
Method Summary
 java.lang.Object clone()
          Returns a shallow clone
 void embeddedObjectToXml(java.io.OutputStream out, java.util.Properties props)
          Dump content to xml representation
 java.lang.Object getEmbeddedObject()
          The embedded object.
 java.lang.String getKeyOid()
           
 MsgKeyData getMsgKeyData()
           
 MsgUnit getMsgUnit()
          Get the message unit, you must call getUpdateQos(int,int,int) before to generate the update QoS.
 SessionName getReceiver()
           
 SessionName getSender()
          Access the unique login name of the (last) publisher.
 long getSizeInBytes()
          Try to find out the approximate memory consumption of this message.
 boolean isDestroyed()
          Flag which marks the entry as destroyed, you should take it from queue and ignore/discard it
 boolean isExpired()
          Flag which marks the entry as outdated
 boolean isInternal()
           
 void setReceiver(SessionName receiver)
           
 
Methods inherited from class org.xmlBlaster.util.queuemsg.MsgQueueEntry
added, compare, equals, finalize, getEmbeddedType, getLogId, getMeat, getMethodName, getPriority, getPriorityEnum, getRedeliverCounter, getRef, getReturnObj, getStorageId, getUniqueId, getUniqueIdLong, incrRedeliverCounter, isPersistent, isStored, removed, setGlobal, setPersistent, setReturnObj, setStored, setWantReturnObject, toString, toXml, toXml, wantReturnObj
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

log

private static java.util.logging.Logger log

ME

private static final java.lang.String ME
See Also:
Constant Field Values

msgQosData

private final MsgQosData msgQosData

receiver

private SessionName receiver

msgUnit

private MsgUnit msgUnit
The MsgUnit with key/content/qos (raw struct)


immutableSizeInBytes

private final long immutableSizeInBytes
Constructor Detail

MsgQueuePublishEntry

public MsgQueuePublishEntry(Global glob,
                            MsgUnit msgUnit,
                            StorageId storageId)
                     throws XmlBlasterException
Use this constructor if a new message object is fed by method publish() (not oneway).

Parameters:
msgUnit - The raw data
Throws:
XmlBlasterException

MsgQueuePublishEntry

public MsgQueuePublishEntry(Global glob,
                            MsgUnit msgUnit,
                            StorageId storageId,
                            boolean oneway)
                     throws XmlBlasterException
Throws:
XmlBlasterException

MsgQueuePublishEntry

public MsgQueuePublishEntry(Global glob,
                            MethodName entryType,
                            PriorityEnum priority,
                            StorageId storageId,
                            Timestamp publishEntryTimestamp,
                            long sizeInBytes,
                            MsgUnit msgUnit)
For persistence recovery

Parameters:
priority - PriorityEnum.MIN1_PRIORITY etc does not work, the priority from qos is used (remove this parameter)
sizeInByte - The estimated size of the entry in RAM (can be totally different on HD).
Method Detail

isExpired

public boolean isExpired()
Description copied from class: MsgQueueEntry
Flag which marks the entry as outdated

Specified by:
isExpired in class MsgQueueEntry
See Also:
MsgQueueEntry.isExpired()

isDestroyed

public boolean isDestroyed()
Description copied from class: MsgQueueEntry
Flag which marks the entry as destroyed, you should take it from queue and ignore/discard it

Specified by:
isDestroyed in class MsgQueueEntry
See Also:
MsgQueueEntry.isDestroyed()

getMsgUnit

public MsgUnit getMsgUnit()
Get the message unit, you must call getUpdateQos(int,int,int) before to generate the update QoS.

See private getUpdateQos(int,int,int)

Specified by:
getMsgUnit in class MsgQueueEntry
Returns:
null (always)

getSizeInBytes

public long getSizeInBytes()
Try to find out the approximate memory consumption of this message.

Specified by:
getSizeInBytes in interface I_Entry
Overrides:
getSizeInBytes in class MsgQueueEntry
Returns:
The size in bytes

isInternal

public boolean isInternal()
Specified by:
isInternal in class MsgQueueEntry
Returns:
If it is an internal message (oid starting with "_").

getSender

public SessionName getSender()
Access the unique login name of the (last) publisher.

The sender of this message.

Specified by:
getSender in class MsgQueueEntry
Returns:
loginName of the data source which last publishd this message or null
See Also:
MsgQueueEntry.getSender()

setReceiver

public void setReceiver(SessionName receiver)
See Also:
MsgQueueEntry.getReceiver()

getReceiver

public SessionName getReceiver()
Specified by:
getReceiver in class MsgQueueEntry
Returns:
The name of the receiver (data sink) or null
See Also:
MsgQueueEntry.getReceiver()

getMsgKeyData

public MsgKeyData getMsgKeyData()

getKeyOid

public java.lang.String getKeyOid()
Specified by:
getKeyOid in class MsgQueueEntry
Returns:
The message key oid or null
See Also:
MsgQueueEntry.getKeyOid()

getEmbeddedObject

public java.lang.Object getEmbeddedObject()
The embedded object.

Returns:
qos.toXml, key.toXml, contentBytes

embeddedObjectToXml

public final void embeddedObjectToXml(java.io.OutputStream out,
                                      java.util.Properties props)
                               throws java.io.IOException
Description copied from interface: I_Entry
Dump content to xml representation

Parameters:
out - The stream to dump to
props - Control porperties
Throws:
java.io.IOException

clone

public java.lang.Object clone()
Returns a shallow clone

Overrides:
clone in class MsgQueueEntry

xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.