com.hazelcast.config
Class QueueConfig

java.lang.Object
  extended by com.hazelcast.config.QueueConfig
Direct Known Subclasses:
QueueConfigReadOnly

public class QueueConfig
extends Object

Contains the configuration for an IQueue


Field Summary
static int DEFAULT_ASYNC_BACKUP_COUNT
          Default value of the asynchronous backup count.
static int DEFAULT_EMPTY_QUEUE_TTL
          Default value for the TTL (time to live) for empty Queue.
static int DEFAULT_MAX_SIZE
          Default value for the maximum size of the Queue.
static int DEFAULT_SYNC_BACKUP_COUNT
          Default value for the sychronous backup count.
 
Constructor Summary
QueueConfig()
           
QueueConfig(QueueConfig config)
           
QueueConfig(String name)
           
 
Method Summary
 QueueConfig addItemListenerConfig(ItemListenerConfig listenerConfig)
          Add an item listener configuration to this queue configuration.
 QueueConfigReadOnly getAsReadOnly()
          Returns a read only copy of the queue configuration.
 int getAsyncBackupCount()
          Get the asynchronous backup count.
 int getBackupCount()
          Get the number of synchronous backups.
 int getEmptyQueueTtl()
          Returns the TTL (time to live) for emptying the Queue.
 List<ItemListenerConfig> getItemListenerConfigs()
          Get the list of item listener configurations for this queue configuration.
 int getMaxSize()
          Returns the maximum size of the Queue.
 String getName()
           
 QueueStoreConfig getQueueStoreConfig()
          Get the QueueStore (load and store queue items from/to a database) configuration.
 int getTotalBackupCount()
          Get the total number of backups: the backup count and the asynchronous backup count.
 boolean isStatisticsEnabled()
          Check if statistics are enabled.
 QueueConfig setAsyncBackupCount(int asyncBackupCount)
          Sets the number of asynchronous backups.
 QueueConfig setBackupCount(int backupCount)
          Sets the number of synchronous backups.
 QueueConfig setEmptyQueueTtl(int emptyQueueTtl)
          Sets the TTL (time to live) for emptying the Queue.
 QueueConfig setItemListenerConfigs(List<ItemListenerConfig> listenerConfigs)
          Set the list of item listener configurations for this queue configuration to this list.
 QueueConfig setMaxSize(int maxSize)
          Sets the maximum size of the Queue.
 QueueConfig setName(String name)
          Set the name for this queue configuration.
 QueueConfig setQueueStoreConfig(QueueStoreConfig queueStoreConfig)
          Set the QueueStore (load and store queue items from/to a database) configuration.
 QueueConfig setStatisticsEnabled(boolean statisticsEnabled)
          Set the statistics enabled value for this queue configuration.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_MAX_SIZE

public static final int DEFAULT_MAX_SIZE
Default value for the maximum size of the Queue.

See Also:
Constant Field Values

DEFAULT_SYNC_BACKUP_COUNT

public static final int DEFAULT_SYNC_BACKUP_COUNT
Default value for the sychronous backup count.

See Also:
Constant Field Values

DEFAULT_ASYNC_BACKUP_COUNT

public static final int DEFAULT_ASYNC_BACKUP_COUNT
Default value of the asynchronous backup count.

See Also:
Constant Field Values

DEFAULT_EMPTY_QUEUE_TTL

public static final int DEFAULT_EMPTY_QUEUE_TTL
Default value for the TTL (time to live) for empty Queue.

See Also:
Constant Field Values
Constructor Detail

QueueConfig

public QueueConfig()

QueueConfig

public QueueConfig(String name)

QueueConfig

public QueueConfig(QueueConfig config)
Method Detail

getAsReadOnly

public QueueConfigReadOnly getAsReadOnly()
Returns a read only copy of the queue configuration.

Returns:
A read only copy of the queue configuration.

getEmptyQueueTtl

public int getEmptyQueueTtl()
Returns the TTL (time to live) for emptying the Queue.

Returns:
The TTL (time to live) for emptying the Queue.

setEmptyQueueTtl

public QueueConfig setEmptyQueueTtl(int emptyQueueTtl)
Sets the TTL (time to live) for emptying the Queue.

Parameters:
emptyQueueTtl - Set the TTL (time to live) for emptying the Queue to this value.
Returns:
The Queue configuration.

getMaxSize

public int getMaxSize()
Returns the maximum size of the Queue.

Returns:
The maximum size of the Queue.

setMaxSize

public QueueConfig setMaxSize(int maxSize)
Sets the maximum size of the Queue.

Parameters:
maxSize - Set the maximum size of the Queue to this value.
Returns:
The Queue configuration.

getTotalBackupCount

public int getTotalBackupCount()
Get the total number of backups: the backup count and the asynchronous backup count.

Returns:
The total number of backups.

getBackupCount

public int getBackupCount()
Get the number of synchronous backups.

Returns:
The synchronous backup count.

setBackupCount

public QueueConfig setBackupCount(int backupCount)
Sets the number of synchronous backups.

Parameters:
backupCount - the number of synchronous backups to set
Returns:
the current QueueConfig
Throws:
IllegalArgumentException - if backupCount is smaller than 0, or larger than the maximum number of backups, or the sum of the backups and async backups is larger than the maximum number of backups
See Also:
setAsyncBackupCount(int)

getAsyncBackupCount

public int getAsyncBackupCount()
Get the asynchronous backup count.

Returns:
The asynchronous backup count.

setAsyncBackupCount

public QueueConfig setAsyncBackupCount(int asyncBackupCount)
Sets the number of asynchronous backups. 0 means no backups.

Parameters:
asyncBackupCount - the number of asynchronous synchronous backups to set
Returns:
the updated QueueConfig
Throws:
IllegalArgumentException - if asyncBackupCount smaller than 0, or larger than the maximum number of backup or the sum of the backups and async backups is larger than the maximum number of backups
See Also:
setBackupCount(int), getAsyncBackupCount()

getQueueStoreConfig

public QueueStoreConfig getQueueStoreConfig()
Get the QueueStore (load and store queue items from/to a database) configuration.

Returns:
The QueueStore configuration.

setQueueStoreConfig

public QueueConfig setQueueStoreConfig(QueueStoreConfig queueStoreConfig)
Set the QueueStore (load and store queue items from/to a database) configuration.

Parameters:
queueStoreConfig - Set the QueueStore configuration to this configuration.
Returns:
The QueueStore configuration.

isStatisticsEnabled

public boolean isStatisticsEnabled()
Check if statistics are enabled.

Returns:
true is statistics are enabled, false otherwise.

setStatisticsEnabled

public QueueConfig setStatisticsEnabled(boolean statisticsEnabled)
Set the statistics enabled value for this queue configuration.

Parameters:
statisticsEnabled - Set to true or false to enable or disable statistics.
Returns:
The queue configuration.

getName

public String getName()
Returns:
The name of this queue configuration.

setName

public QueueConfig setName(String name)
Set the name for this queue configuration.

Parameters:
name - The name to set for this queue configuration.
Returns:
This queue configuration.

addItemListenerConfig

public QueueConfig addItemListenerConfig(ItemListenerConfig listenerConfig)
Add an item listener configuration to this queue configuration.

Parameters:
listenerConfig - The item listener configuration to add to this queue configuration.
Returns:
This queue configuration.

getItemListenerConfigs

public List<ItemListenerConfig> getItemListenerConfigs()
Get the list of item listener configurations for this queue configuration.

Returns:
The list of item listener configurations for this queue configuration.

setItemListenerConfigs

public QueueConfig setItemListenerConfigs(List<ItemListenerConfig> listenerConfigs)
Set the list of item listener configurations for this queue configuration to this list.

Parameters:
listenerConfigs - The list of item listener configurations to set for this queue configuration.
Returns:
This queue configuration.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.