xmlBlaster 2.2.0 client API

org.xmlBlaster.util.qos.storage
Class QueuePropertyBase

java.lang.Object
  extended by org.xmlBlaster.util.qos.storage.QueuePropertyBase
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
CbQueueProperty, ClientQueueProperty, HistoryQueueProperty, MsgUnitStoreProperty, SessionStoreProperty, SubscribeStoreProperty, TopicStoreProperty

public abstract class QueuePropertyBase
extends java.lang.Object
implements java.lang.Cloneable

Helper class holding callback queue properties.

See ConnectQos for XML syntax.

See Also:
ConnectQos

Field Summary
protected  AddressBase[] addressArr
          The corresponding callback address, is set by derived classes
protected  long c
           
protected  PropBoolean debug
          To allow debugging the queue (experimental)
static long DEFAULT_bytesCacheDefault
          The max setting allowed for queue max size of cache in bytes is adjustable with property "queue.maxBytesCache=4000000" (4 MBytes is default)
static long DEFAULT_bytesDefault
          The max setting allowed for queue max size in bytes is adjustable with property "queue.maxBytes=4194304" (10 MBytes is default)
 long DEFAULT_maxEntries
          The max setting allowed for queue maxEntries is adjustable with property "queue.maxEntries=1000" (1000 messages is default)
static long DEFAULT_maxEntriesCacheDefault
          The max setting allowed for queue maxEntriesCache is adjustable with property "queue.maxEntriesCache=1000" (1000 messages is default)
static java.lang.String DEFAULT_onFailure
          Error handling when callback failed (after all retries etc.): Constants.ONOVERFLOW_DEADMESSAGE
static java.lang.String DEFAULT_onOverflow
          Error handling when queue is full: Constants.ONOVERFLOW_DEADMESSAGE | Constants.ONOVERFLOW_DISCARDOLDEST
static double DEFAULT_reloadSwapBytesRatio
          The default settings (as a ratio relative to the maxBytesCache) for the storeSwapBytes
static double DEFAULT_reloadSwapLevelRatio
          The default settings (as a ratio relative to the maxBytesCache) for the storeSwapLevel
static double DEFAULT_storeSwapBytesRatio
          The default settings (as a ratio relative to the maxBytesCache) for the storeSwapBytes
static double DEFAULT_storeSwapLevelRatio
          The default settings (as a ratio relative to the maxBytesCache) for the storeSwapLevel
static java.lang.String DEFAULT_type
          The queue plugin type "CACHE" "RAM" "JDBC" or others
static java.lang.String DEFAULT_version
          The queue plugin version "1.0" or similar
static AddressBase[] EMPTY_ADDRESS_ARR
           
protected  Global glob
           
protected  PropLong maxBytes
          The max.
protected  PropLong maxBytesCache
          The max.
protected  long maxBytesDefault
           
protected  PropLong maxEntries
          The max.
protected  PropLong maxEntriesCache
          The max.
protected  long maxEntriesCacheDefault
           
protected  java.lang.String nodeId
          To allow specific configuration parameters for specific cluster nodes
protected  PropString onFailure
           
protected  PropString onOverflow
           
protected  java.lang.String relating
          The unique queue or storage name, e.g.
protected  long reloadSwapBytes
          The settings for the storeSwapBytes
protected  long reloadSwapLevel
          The settings for the reloadSwapLevel
protected  long storeSwapBytes
          The settings for the storeSwapBytes
protected  long storeSwapLevel
          The settings for the storeSwapLevel
protected  PropString type
           
protected  PropString version
           
 
Constructor Summary
QueuePropertyBase(Global glob, java.lang.String nodeId)
           
 
Method Summary
 void checkConsistency()
          Should be called after parsing
 java.lang.Object clone()
          Returns a shallow clone, you can change savely all basic or immutable types like boolean, String, int.
 AddressBase[] getAddresses()
           
 boolean getDebug()
           
 Global getGlobal()
          returns the global object
 long getMaxBytes()
          Max message queue size.
 long getMaxBytesCache()
          Max message queue size for the cache of this queue.
 PropLong getMaxBytesCacheProp()
           
 PropLong getMaxBytesProp()
           
 long getMaxEntries()
          Max number of messages for this queue.
 long getMaxEntriesCache()
          Max number of messages for the cache of this queue.
 PropLong getMaxEntriesCacheProp()
           
 PropLong getMaxEntriesProp()
           
 java.lang.String getOnFailure()
          Returns the onFailure.
 java.lang.String getOnOverflow()
          Returns the onOverflow.
 java.lang.String getPrefix()
          The command line prefix to configure the queue or msgUnitStore
 java.lang.String getPropertyPrefix()
           
 java.lang.String getPropName(java.lang.String token)
          Helper for logging output, creates the property key for configuration (the command line property).
 java.lang.String getRelating()
          Returns the queue id.
 long getReloadSwapBytes()
          Gets the reloadSwapBytes for the queue (only used on cache queues).
 long getReloadSwapLevel()
          Gets the reloadSwapLevel for the queue (only used on cache queues).
 java.lang.String getRootTagName()
          Defaults to queue for <queue .../>, other used tag name is <persistence .../>
 long getStoreSwapBytes()
          Gets the storeSwapBytes for the queue (only used on cache queues).
 long getStoreSwapLevel()
          Gets the storeSwapLevel for the queue (only used on cache queues).
 java.lang.String getType()
          The plugin type.
 java.lang.String getTypeVersion()
          The plugin type and version.
 java.lang.String getVersion()
          The plugin version.
protected  void initialize(java.lang.String relating)
          Configure property settings, add your own defaults in the derived class
 boolean isEmbedded()
           
 boolean onFailureDeadMessage()
          The default mode is to send a dead letter if callback fails permanently
 void setDebug(boolean debug)
           
 void setEmbedded(boolean embedded)
           
 void setMaxBytes(long maxBytes)
          Max message queue size.
 void setMaxBytesCache(long maxBytesCache)
          Max message queue size for the cache of this queue.
 void setMaxEntries(long maxEntries)
          Max number of messages for this queue.
 void setMaxEntriesCache(long maxEntriesCache)
          Max number of messages for the cache of this queue.
 void setOnFailure(java.lang.String onFailure)
          Set the callback onFailure, it should fit to the protocol-relating.
 void setOnOverflow(java.lang.String onOverflow)
          Set the callback onOverflow, it should fit to the protocol-relating.
 void setRelating(java.lang.String relating)
           
 void setReloadSwapBytes(long reloadSwapBytes)
          Sets the reloadSwapBytes for the queue (only used on cache queues).
 void setReloadSwapLevel(long reloadSwapLevel)
          Sets the reloadSwapLevel for the queue (only used on cache queues).
 void setStoreSwapBytes(long storeSwapBytes)
          Sets the storeSwapBytes for the queue (only used on cache queues).
 void setStoreSwapLevel(long storeSwapLevel)
          Sets the storeSwapLevel for the queue (only used on cache queues).
 void setType(java.lang.String type)
          The plugin type
 void setVersion(java.lang.String version)
          The plugin version
 void startElement(java.lang.String uri, java.lang.String localName, java.lang.String name, org.xml.sax.Attributes attrs)
          Called for queue start tag
 java.lang.String toString()
           
 java.lang.String toXml()
          Dump state of this object into a XML ASCII string.
 java.lang.String toXml(java.lang.String extraOffset)
          Dump state of this object into a XML ASCII string.
 java.lang.String usage()
           
 java.lang.String usage(java.lang.String headerline)
          Get a usage string for queue configuration (in xmlBlaster.properties or on command line)
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

glob

protected final Global glob

DEFAULT_type

public static final java.lang.String DEFAULT_type
The queue plugin type "CACHE" "RAM" "JDBC" or others

See Also:
Constant Field Values

type

protected PropString type

DEFAULT_version

public static final java.lang.String DEFAULT_version
The queue plugin version "1.0" or similar

See Also:
Constant Field Values

version

protected PropString version

DEFAULT_maxEntriesCacheDefault

public static final long DEFAULT_maxEntriesCacheDefault
The max setting allowed for queue maxEntriesCache is adjustable with property "queue.maxEntriesCache=1000" (1000 messages is default)

See Also:
Constant Field Values

maxEntriesCacheDefault

protected long maxEntriesCacheDefault

DEFAULT_bytesDefault

public static final long DEFAULT_bytesDefault
The max setting allowed for queue max size in bytes is adjustable with property "queue.maxBytes=4194304" (10 MBytes is default)

See Also:
Constant Field Values

maxBytesDefault

protected long maxBytesDefault

DEFAULT_bytesCacheDefault

public static final long DEFAULT_bytesCacheDefault
The max setting allowed for queue max size of cache in bytes is adjustable with property "queue.maxBytesCache=4000000" (4 MBytes is default)

See Also:
Constant Field Values

c

protected long c

DEFAULT_storeSwapLevelRatio

public static final double DEFAULT_storeSwapLevelRatio
The default settings (as a ratio relative to the maxBytesCache) for the storeSwapLevel

See Also:
Constant Field Values

DEFAULT_storeSwapBytesRatio

public static final double DEFAULT_storeSwapBytesRatio
The default settings (as a ratio relative to the maxBytesCache) for the storeSwapBytes

See Also:
Constant Field Values

DEFAULT_reloadSwapLevelRatio

public static final double DEFAULT_reloadSwapLevelRatio
The default settings (as a ratio relative to the maxBytesCache) for the storeSwapLevel

See Also:
Constant Field Values

DEFAULT_reloadSwapBytesRatio

public static final double DEFAULT_reloadSwapBytesRatio
The default settings (as a ratio relative to the maxBytesCache) for the storeSwapBytes

See Also:
Constant Field Values

relating

protected java.lang.String relating
The unique queue or storage name, e.g. "history"


DEFAULT_maxEntries

public long DEFAULT_maxEntries
The max setting allowed for queue maxEntries is adjustable with property "queue.maxEntries=1000" (1000 messages is default)


maxEntries

protected PropLong maxEntries
The max. capacity of the queue in number of entries


maxBytes

protected PropLong maxBytes
The max. capacity of the queue in Bytes


maxEntriesCache

protected PropLong maxEntriesCache
The max. capacity of the cache of the queue in number of entries


maxBytesCache

protected PropLong maxBytesCache
The max. capacity of the queue in Bytes for the cache


storeSwapLevel

protected long storeSwapLevel
The settings for the storeSwapLevel


storeSwapBytes

protected long storeSwapBytes
The settings for the storeSwapBytes


reloadSwapLevel

protected long reloadSwapLevel
The settings for the reloadSwapLevel


reloadSwapBytes

protected long reloadSwapBytes
The settings for the storeSwapBytes


DEFAULT_onOverflow

public static final java.lang.String DEFAULT_onOverflow
Error handling when queue is full: Constants.ONOVERFLOW_DEADMESSAGE | Constants.ONOVERFLOW_DISCARDOLDEST

See Also:
Constant Field Values

onOverflow

protected PropString onOverflow

DEFAULT_onFailure

public static final java.lang.String DEFAULT_onFailure
Error handling when callback failed (after all retries etc.): Constants.ONOVERFLOW_DEADMESSAGE

See Also:
Constant Field Values

onFailure

protected PropString onFailure

EMPTY_ADDRESS_ARR

public static AddressBase[] EMPTY_ADDRESS_ARR

addressArr

protected AddressBase[] addressArr
The corresponding callback address, is set by derived classes


nodeId

protected java.lang.String nodeId
To allow specific configuration parameters for specific cluster nodes


debug

protected PropBoolean debug
To allow debugging the queue (experimental)

Constructor Detail

QueuePropertyBase

public QueuePropertyBase(Global glob,
                         java.lang.String nodeId)
Parameters:
glob - The global handle containing env informations
nodeId - If not null, the command line properties will look for prop[nodeId] as well, e.g. -queue/maxEntries and -queue/maxEntries[heron] will be searched
The nodeId should be stripped from special characters (see glob.getStrippedId()) e.g. '/' or '[' is not allowed in the nodeId
See Also:
Global.getStrippedId()
Method Detail

getPropertyPrefix

public java.lang.String getPropertyPrefix()
Returns:
The prefix (relating='') for properties e.g. "history" -> "-queue/history/maxEntries"

getPrefix

public java.lang.String getPrefix()
The command line prefix to configure the queue or msgUnitStore

Returns:
e.g. "persistence/msgUnitStore/" or "queue/history/"

getPropName

public java.lang.String getPropName(java.lang.String token)
Helper for logging output, creates the property key for configuration (the command line property).

Parameters:
prop - e.g. "maxEntries"
Returns:
e.g. "-queue/history/maxEntries" or "-queue/history/maxEntriesCache"

initialize

protected void initialize(java.lang.String relating)
Configure property settings, add your own defaults in the derived class

Parameters:
relating - e.g. "history" or "callback", similar to or etc.

setRelating

public void setRelating(java.lang.String relating)
Parameters:
relating - To what is this queue related: Constants.RELATING_CALLBACK | Constants.RELATING_SUBJECT | Constants.RELATING_CLIENT

getRelating

public final java.lang.String getRelating()
Returns the queue id.

Returns:
relating To what is this queue related: Constants.RELATING_CALLBACK | Constants.RELATING_SUBJECT

getMaxEntries

public final long getMaxEntries()
Max number of messages for this queue.

Returns:
number of messages

getMaxEntriesProp

public final PropLong getMaxEntriesProp()

setMaxEntries

public final void setMaxEntries(long maxEntries)
Max number of messages for this queue.

Parameters:
maxEntries -

getType

public final java.lang.String getType()
The plugin type.

Returns:
e.g. "CACHE" or null to choose current configured default plugin

setType

public final void setType(java.lang.String type)
The plugin type

Parameters:
type -

getVersion

public final java.lang.String getVersion()
The plugin version.

Returns:
e.g. "1.0" or null to configure current default plugin

setVersion

public final void setVersion(java.lang.String version)
The plugin version

Parameters:
version -

getTypeVersion

public final java.lang.String getTypeVersion()
The plugin type and version.

Returns:
e.g. "RAM,1.0" or null to configure current default plugin

getMaxEntriesCache

public final long getMaxEntriesCache()
Max number of messages for the cache of this queue.

Returns:
number of messages

getMaxEntriesCacheProp

public final PropLong getMaxEntriesCacheProp()

setMaxEntriesCache

public final void setMaxEntriesCache(long maxEntriesCache)
Max number of messages for the cache of this queue.

Parameters:
maxEntriesCache -

getMaxBytes

public final long getMaxBytes()
Max message queue size.

Returns:
Get max. message queue size in Bytes

getMaxBytesProp

public final PropLong getMaxBytesProp()

setMaxBytes

public final void setMaxBytes(long maxBytes)
Max message queue size.


getMaxBytesCache

public final long getMaxBytesCache()
Max message queue size for the cache of this queue.

Returns:
Get max. message queue size in Bytes

getMaxBytesCacheProp

public final PropLong getMaxBytesCacheProp()

getStoreSwapLevel

public final long getStoreSwapLevel()
Gets the storeSwapLevel for the queue (only used on cache queues).

Returns:
Get storeSwapLevel in bytes.

setStoreSwapLevel

public final void setStoreSwapLevel(long storeSwapLevel)
Sets the storeSwapLevel for the queue (only used on cache queues).

Parameters:
Set - storeSwapLevel in bytes.

getStoreSwapBytes

public final long getStoreSwapBytes()
Gets the storeSwapBytes for the queue (only used on cache queues).

Returns:
Get storeSwapBytes in bytes.

setStoreSwapBytes

public final void setStoreSwapBytes(long storeSwapBytes)
Sets the storeSwapBytes for the queue (only used on cache queues).

Parameters:
Set - storeSwapBytes in bytes.

getReloadSwapLevel

public final long getReloadSwapLevel()
Gets the reloadSwapLevel for the queue (only used on cache queues).

Returns:
Get reloadSwapLevel in bytes.

setReloadSwapLevel

public final void setReloadSwapLevel(long reloadSwapLevel)
Sets the reloadSwapLevel for the queue (only used on cache queues).

Parameters:
Set - reloadSwapLevel in bytes.

getReloadSwapBytes

public final long getReloadSwapBytes()
Gets the reloadSwapBytes for the queue (only used on cache queues).

Returns:
Get reloadSwapBytes in bytes.

setReloadSwapBytes

public final void setReloadSwapBytes(long reloadSwapBytes)
Sets the reloadSwapBytes for the queue (only used on cache queues).

Parameters:
Set - reloadSwapBytes in bytes.

setMaxBytesCache

public final void setMaxBytesCache(long maxBytesCache)
Max message queue size for the cache of this queue.


setOnOverflow

public final void setOnOverflow(java.lang.String onOverflow)
Set the callback onOverflow, it should fit to the protocol-relating.

Parameters:
onOverflow - The callback onOverflow, e.g. "et@mars.univers"

getOnOverflow

public final java.lang.String getOnOverflow()
Returns the onOverflow.

Returns:
e.g. "IOR:00001100022...." or "et@universe.com"

setOnFailure

public final void setOnFailure(java.lang.String onFailure)
Set the callback onFailure, it should fit to the protocol-relating.

Parameters:
onFailure - The callback onFailure, e.g. "et@mars.univers"

getOnFailure

public final java.lang.String getOnFailure()
Returns the onFailure.

Returns:
e.g. "IOR:00001100022...." or "et@universe.com"

onFailureDeadMessage

public final boolean onFailureDeadMessage()
The default mode is to send a dead letter if callback fails permanently


getAddresses

public AddressBase[] getAddresses()
Returns:
null if none available

startElement

public final void startElement(java.lang.String uri,
                               java.lang.String localName,
                               java.lang.String name,
                               org.xml.sax.Attributes attrs)
Called for queue start tag


usage

public java.lang.String usage()

getRootTagName

public java.lang.String getRootTagName()
Defaults to queue for <queue .../>, other used tag name is <persistence .../>


usage

public java.lang.String usage(java.lang.String headerline)
Get a usage string for queue configuration (in xmlBlaster.properties or on command line)


checkConsistency

public final void checkConsistency()
Should be called after parsing


toXml

public final java.lang.String toXml()
Dump state of this object into a XML ASCII string.


toXml

public final java.lang.String toXml(java.lang.String extraOffset)
Dump state of this object into a XML ASCII string.

Parameters:
extraOffset - indenting of tags for nice output
Returns:
The xml representation

getGlobal

public Global getGlobal()
returns the global object


clone

public java.lang.Object clone()
Returns a shallow clone, you can change savely all basic or immutable types like boolean, String, int.

Overrides:
clone in class java.lang.Object

getDebug

public final boolean getDebug()

setDebug

public final void setDebug(boolean debug)

setEmbedded

public void setEmbedded(boolean embedded)

isEmbedded

public boolean isEmbedded()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

xmlBlaster 2.2.0 client API

Copyright © 1999-2014 The xmlBlaster.org contributers.