com.hazelcast.config

## Class QueueConfig

- java.lang.Object
- - com.hazelcast.config.QueueConfig

- All Implemented Interfaces:
    NamedConfig, DataSerializable, IdentifiedDataSerializable, com.hazelcast.nio.serialization.impl.Versioned, SplitBrainMergeTypeProvider
  Direct Known Subclasses:
    QueueConfigReadOnly

      public class QueueConfig
      extends Object
      implements SplitBrainMergeTypeProvider, IdentifiedDataSerializable, com.hazelcast.nio.serialization.impl.Versioned, NamedConfig

  Contains the configuration for an `IQueue`.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `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

    Constructors
    Constructor and Description
    `QueueConfig()`
    `QueueConfig(QueueConfig config)`
    `QueueConfig(String name)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `QueueConfig` | `addItemListenerConfig(ItemListenerConfig listenerConfig)` Add an item listener configuration to this queue.
    `boolean` | `equals(Object o)`
    `QueueConfigReadOnly` | `getAsReadOnly()` Deprecated. this method will be removed in 4.0; it is meant for internal usage only
    `int` | `getAsyncBackupCount()` Get the number of asynchronous backups for this queue.
    `int` | `getBackupCount()` Get the number of synchronous backups for this queue.
    `int` | `getEmptyQueueTtl()` Returns the TTL (time to live) for emptying the Queue.
    `int` | `getFactoryId()` Returns DataSerializableFactory factory ID for this class.
    `int` | `getId()` Returns type identifier for this class.
    `List<ItemListenerConfig>` | `getItemListenerConfigs()` Get the list of item listener configurations for this queue.
    `int` | `getMaxSize()` Returns the maximum size of the Queue.
    `MergePolicyConfig` | `getMergePolicyConfig()` Gets the `MergePolicyConfig` for this queue.
    `String` | `getName()`
    `Class` | `getProvidedMergeTypes()`
    `QueueStoreConfig` | `getQueueStoreConfig()` Get the QueueStore (load and store queue items from/to a database) configuration.
    `String` | `getQuorumName()` Returns the quorum name for queue operations.
    `int` | `getTotalBackupCount()` Get the total number of backups: the backup count plus the asynchronous backup count.
    `int` | `hashCode()`
    `boolean` | `isStatisticsEnabled()` Check if statistics are enabled for this queue.
    `void` | `readData(ObjectDataInput in)` Reads fields from the input stream
    `QueueConfig` | `setAsyncBackupCount(int asyncBackupCount)` Sets the number of asynchronous backups.
    `QueueConfig` | `setBackupCount(int backupCount)` Sets the number of synchronous backups for this queue.
    `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.
    `QueueConfig` | `setMaxSize(int maxSize)` Sets the maximum size of the Queue.
    `QueueConfig` | `setMergePolicyConfig(MergePolicyConfig mergePolicyConfig)` Sets the `MergePolicyConfig` for this queue.
    `QueueConfig` | `setName(String name)` Set the name for this queue.
    `QueueConfig` | `setQueueStoreConfig(QueueStoreConfig queueStoreConfig)` Set the QueueStore (load and store queue items from/to a database) configuration.
    `QueueConfig` | `setQuorumName(String quorumName)` Sets the quorum name for queue operations.
    `QueueConfig` | `setStatisticsEnabled(boolean statisticsEnabled)` Enables or disables statistics for this queue.
    `String` | `toString()`
    `void` | `writeData(ObjectDataOutput out)` Writes object fields to output stream

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, 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()

      Deprecated. this method will be removed in 4.0; it is meant for internal usage only
      Gets immutable version of this configuration.
      Returns:
        immutable version of this 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 plus the asynchronous backup count.
      Returns:
        the total number of backups

    - #### getBackupCount

          public int getBackupCount()

      Get the number of synchronous backups for this queue.
      Returns:
        the synchronous backup count

    - #### setBackupCount

          public QueueConfig setBackupCount(int backupCount)

      Sets the number of synchronous backups for this queue.
      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 number of asynchronous backups for this queue.
      Returns:
        the number of asynchronous backups

    - #### 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 for this queue.
      Returns:
        `true` if statistics are enabled, `false` otherwise

    - #### setStatisticsEnabled

          public QueueConfig setStatisticsEnabled(boolean statisticsEnabled)

      Enables or disables statistics for this queue.
      Parameters:
        `statisticsEnabled` - `true` to enable statistics for this queue, `false` to disable
      Returns:
        the updated QueueConfig

    - #### getName

          public String getName()

      Specified by:
        `getName` in interface `NamedConfig`
      Returns:
        the name of this queue

    - #### setName

          public QueueConfig setName(String name)

      Set the name for this queue.
      Specified by:
        `setName` in interface `NamedConfig`
      Parameters:
        `name` - the name to set for this queue
      Returns:
        this queue configuration

    - #### addItemListenerConfig

          public QueueConfig addItemListenerConfig(ItemListenerConfig listenerConfig)

      Add an item listener configuration to this queue.
      Parameters:
        `listenerConfig` - the item listener configuration to add to this queue
      Returns:
        the updated queue configuration

    - #### getItemListenerConfigs

          public List<ItemListenerConfig> getItemListenerConfigs()

      Get the list of item listener configurations for this queue.
      Returns:
        the list of item listener configurations for this queue

    - #### setItemListenerConfigs

          public QueueConfig setItemListenerConfigs(List<ItemListenerConfig> listenerConfigs)

      Set the list of item listener configurations for this queue.
      Parameters:
        `listenerConfigs` - the list of item listener configurations to set for this queue
      Returns:
        the updated queue configuration

    - #### getQuorumName

          public String getQuorumName()

      Returns the quorum name for queue operations.
      Returns:
        the quorum name

    - #### setQuorumName

          public QueueConfig setQuorumName(String quorumName)

      Sets the quorum name for queue operations.
      Parameters:
        `quorumName` - the quorum name
      Returns:
        the updated queue configuration

    - #### getMergePolicyConfig

          public MergePolicyConfig getMergePolicyConfig()

      Gets the `MergePolicyConfig` for this queue.
      Returns:
        the `MergePolicyConfig` for this queue

    - #### setMergePolicyConfig

          public QueueConfig setMergePolicyConfig(MergePolicyConfig mergePolicyConfig)

      Sets the `MergePolicyConfig` for this queue.
      Returns:
        the updated queue configuration

    - #### getProvidedMergeTypes

          public Class getProvidedMergeTypes()

      Specified by:
        `getProvidedMergeTypes` in interface `SplitBrainMergeTypeProvider`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### getFactoryId

          public int getFactoryId()

      Description copied from interface: `IdentifiedDataSerializable`
      Returns DataSerializableFactory factory ID for this class.
      Specified by:
        `getFactoryId` in interface `IdentifiedDataSerializable`
      Returns:
        factory ID

    - #### getId

          public int getId()

      Description copied from interface: `IdentifiedDataSerializable`
      Returns type identifier for this class. It should be unique per DataSerializableFactory.
      Specified by:
        `getId` in interface `IdentifiedDataSerializable`
      Returns:
        type ID

    - #### writeData

          public void writeData(ObjectDataOutput out)
                         throws IOException

      Description copied from interface: `DataSerializable`
      Writes object fields to output stream
      Specified by:
        `writeData` in interface `DataSerializable`
      Parameters:
        `out` - output
      Throws:
        `IOException` - if an I/O error occurs. In particular, an `IOException` may be thrown if the output stream has been closed.

    - #### readData

          public void readData(ObjectDataInput in)
                        throws IOException

      Description copied from interface: `DataSerializable`
      Reads fields from the input stream
      Specified by:
        `readData` in interface `DataSerializable`
      Parameters:
        `in` - input
      Throws:
        `IOException` - if an I/O error occurs. In particular, an `IOException` may be thrown if the input stream has been closed.

    - #### equals

          public final boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public final int hashCode()

      Overrides:
        `hashCode` in class `Object`

Copyright © 2019. All rights reserved.