xmlBlaster 2.1.0 API

org.xmlBlaster.engine.queuemsg
Class SubscribeEntry

java.lang.Object
  extended by org.xmlBlaster.engine.queuemsg.SubscribeEntry
All Implemented Interfaces:
java.io.Serializable, I_MapEntry, I_Entry

public class SubscribeEntry
extends java.lang.Object
implements I_MapEntry

SubscribeEntry

Author:
Michele Laghi
See Also:
Serialized Form

Field Summary
private  java.lang.String key
           
private  java.lang.String qos
           
private static long serialVersionUID
           
private  java.lang.String sessionName
           
private  long size
           
private  Timestamp sortTimestamp
           
private  StorageId storageId
           
private  boolean stored
           
private  boolean swapped
           
private  long uniqueId
           
private  java.lang.String uniqueIdStr
           
 
Constructor Summary
SubscribeEntry(java.lang.String key, java.lang.String qos, java.lang.String sessionName, long uniqueId, long size, StorageId storageId)
          this constructor should be used by factories
 
Method Summary
 void added(StorageId storageId)
          Notification if this entry is added to storage.
 void embeddedObjectToXml(java.io.OutputStream out, java.util.Properties props)
          Dump content to xml representation
 java.lang.Object getEmbeddedObject()
          gets the content of this queue entry (the embedded object).
 java.lang.String getEmbeddedType()
          Gets the type of the object embedded in this entry, how the object is serialized.
 java.lang.String getKey()
           
 java.lang.String getLogId()
          Return a human readable identifier for logging output.
 XBMeat getMeat()
          For the new queues
 int getPriority()
          Allows to query the priority of this entry.
 java.lang.String getQos()
           
 XBRef getRef()
          For the new queues
 java.lang.String getSessionName()
           
 long getSizeInBytes()
          returns the size in bytes of this entry.
 Timestamp getSortTimestamp()
          Can be used by cache implementation to implement LRU
 StorageId getStorageId()
          Must be filled if retrieved from database.
 long getUniqueId()
          This is the second order criteria in the queue
 java.lang.String getUniqueIdStr()
           
 boolean isPersistent()
          Returns true if the entry is persistent (persistent on HD), false otherwise.
 boolean isStored()
           
 boolean isSwapped()
          Enforced by I_Map
 void isSwapped(boolean swapped)
          Enforced by I_Map
 void removed(StorageId storageId)
          Notification if this entry is removed from storage
 void setSortTimestamp(Timestamp timestamp)
          Can be used by cache implementation to implement LRU
 void setStored(boolean stored)
          Is invoked by the storage implementation with 'true' when the entry is put in a storage and with 'false' when the entry is removed from the storage.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

key

private final java.lang.String key

qos

private final java.lang.String qos

sessionName

private final java.lang.String sessionName

stored

private boolean stored

uniqueId

private final long uniqueId

uniqueIdStr

private final java.lang.String uniqueIdStr

size

private final long size

swapped

private transient boolean swapped

sortTimestamp

private transient Timestamp sortTimestamp

storageId

private transient StorageId storageId
Constructor Detail

SubscribeEntry

public SubscribeEntry(java.lang.String key,
                      java.lang.String qos,
                      java.lang.String sessionName,
                      long uniqueId,
                      long size,
                      StorageId storageId)
this constructor should be used by factories

Parameters:
qos -
uniqueId -
size -
storageId - TODO
Method Detail

getUniqueIdStr

public java.lang.String getUniqueIdStr()
Specified by:
getUniqueIdStr in interface I_MapEntry
Returns:
The unique ID as a string (cached for performance)
See Also:
I_MapEntry.getUniqueIdStr()

getPriority

public int getPriority()
Description copied from interface: I_Entry
Allows to query the priority of this entry. This is the highest order precedence in the sorted queue

Specified by:
getPriority in interface I_Entry
Returns:
The priority
See Also:
I_Entry.getPriority()

isPersistent

public boolean isPersistent()
Description copied from interface: I_Entry
Returns true if the entry is persistent (persistent on HD), false otherwise.

Specified by:
isPersistent in interface I_Entry
See Also:
I_Entry.isPersistent()

getUniqueId

public long getUniqueId()
Description copied from interface: I_Entry
This is the second order criteria in the queue

Specified by:
getUniqueId in interface I_Entry
Returns:
The unique Id of this entry.
See Also:
I_Entry.getUniqueId()

getEmbeddedObject

public java.lang.Object getEmbeddedObject()
Description copied from interface: I_Entry
gets the content of this queue entry (the embedded object). In persistent queues this is the data which is stored as a blob.

Specified by:
getEmbeddedObject in interface I_Entry
See Also:
I_Entry.getEmbeddedObject()

getQos

public java.lang.String getQos()

getKey

public java.lang.String getKey()

getSessionName

public java.lang.String getSessionName()

getEmbeddedType

public java.lang.String getEmbeddedType()
Description copied from interface: I_Entry
Gets the type of the object embedded in this entry, how the object is serialized.

Specified by:
getEmbeddedType in interface I_Entry
Returns:
String the identifier which tells the I_EntryFactory how to deserialize this entry.
ServerEntryFactory.ENTRY_TYPE_MSG_XML or ServerEntryFactory.ENTRY_TYPE_MSG_SERIAL or ClientEntryFactory.ENTRY_TYPE_MSG_XML
See Also:
I_Entry.getEmbeddedType()

getLogId

public java.lang.String getLogId()
Description copied from interface: I_Entry
Return a human readable identifier for logging output.

See the derived class for a syntax description.

Specified by:
getLogId in interface I_Entry
See Also:
I_Entry.getLogId()

getSizeInBytes

public long getSizeInBytes()
Description copied from interface: I_Entry
returns the size in bytes of this entry.

Specified by:
getSizeInBytes in interface I_Entry
See Also:
I_Entry.getSizeInBytes()

added

public void added(StorageId storageId)
Description copied from interface: I_Entry
Notification if this entry is added to storage.

NOTE: This event is NOT triggered on startup if entries come from harddisk from the last run. It is NOT triggered during swapping.

This callback may or may not be called from within the queue specific synchronized block

NOTE: This callback is currently only implemented for I_Queue, but not for I_Map!

Specified by:
added in interface I_Entry
See Also:
I_Entry.added(org.xmlBlaster.util.queue.StorageId)

removed

public void removed(StorageId storageId)
Description copied from interface: I_Entry
Notification if this entry is removed from storage

NOTE: This event is NOT triggered during swapping.

The callback is guaranteed to be NEVER called from inside a queue specific synchronized block.

NOTE: This callback is currently only implemented for I_Queue, but not for I_Map!

Specified by:
removed in interface I_Entry
Parameters:
storageId - The storage id
See Also:
I_Entry.removed(org.xmlBlaster.util.queue.StorageId)

setStored

public void setStored(boolean stored)
Description copied from interface: I_Entry
Is invoked by the storage implementation with 'true' when the entry is put in a storage and with 'false' when the entry is removed from the storage. The storage is for example a 'cache', a 'ram' or a 'jdbc' implementation.

Note that this callback is guaranteed to be called from within the queue specific synchronized block

Todo: Remove this in favour of added()/removed() (isStored() is currently only used by CacheQueueInterceptorPlugin.java) I'm not sure if this usage relies on being inside sync

This method may never throw any exception

Specified by:
setStored in interface I_Entry
Parameters:
stored - 'true' if the entry will be put into the storage, 'false' if it is removed.
See Also:
I_Entry.setStored(boolean)

isStored

public boolean isStored()
Specified by:
isStored in interface I_Entry
Returns:
boolean 'true' if the entry is still in the storage, 'false' if the entry has been removed or if it has not been put in the storage yet.
See Also:
I_Entry.isStored()

isSwapped

public boolean isSwapped()
Enforced by I_Map

Specified by:
isSwapped in interface I_MapEntry
See Also:
I_Map#isSwapped()

isSwapped

public void isSwapped(boolean swapped)
Enforced by I_Map

Specified by:
isSwapped in interface I_MapEntry
See Also:
I_Map#isSwapped(boolean)

getSortTimestamp

public final Timestamp getSortTimestamp()
Can be used by cache implementation to implement LRU

Specified by:
getSortTimestamp in interface I_MapEntry
Returns:
null if not previously set by setSortTimestamp()

setSortTimestamp

public final void setSortTimestamp(Timestamp timestamp)
Can be used by cache implementation to implement LRU

Specified by:
setSortTimestamp in interface I_MapEntry

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

Specified by:
embeddedObjectToXml in interface I_Entry
Parameters:
out - The stream to dump to
props - Control porperties
Throws:
java.io.IOException

getMeat

public XBMeat getMeat()
For the new queues

Specified by:
getMeat in interface I_Entry

getRef

public XBRef getRef()
For the new queues

Specified by:
getRef in interface I_Entry

getStorageId

public StorageId getStorageId()
Description copied from interface: I_MapEntry
Must be filled if retrieved from database.

Specified by:
getStorageId in interface I_MapEntry
Returns:
can be null

xmlBlaster 2.1.0 API

Copyright © 1999-2011 The xmlBlaster.org contributers.